Unrestricted wallet access
Showcasing unrestricted behavior we had so far in this tutorial
Before we start restricting wallet access we will demonstrate its current behavior.
Namely, we will show that users (signers
) who do not own the wallet can control its balance and make transfer
intents.
Current wallets and balances
As a refresher, we're going to display current data in our ledger
that we created throughout this tutorial.
Let's first see the list of wallets:
As well as their balances:
And here are intents
responsible for those balances:
Demonstrating unrestricted access
Now, we will make 2 transactions:
- the first one from
demo-bank-wallet
tosettlement-wallet
- sending
$200.00
- sending
- and the second one from
settlement-wallet
todemo-bank-wallet
- sending back
$100.00
- sending back
However, both times we will use demo-bank
signer (even though the settlement-wallet
belongs to the clearinghouse and should not be controlled by any bank).
This should result in demo-bank-wallet
having $600.00
and settlement-wallet
having $100.00
in the end.
And now we're sending $100.00
back (still using the demo-bank
signer).
Again we can see that this transaction
went through without any problems.
demo-bank
signer successfully transferred balance from the wallet that belongs to a clearinghouse.
Here is the list of all intents:
And here are the final wallet balances:
Our next step is to limit the access to wallets and only allow its owner to move the funds/balances.