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:
$ minka wallet list
╔═════════════════════╤══════════╤══════════╤══════════╗
║ Handle │ Bridge │ Custom │ Routes ║
╟─────────────────────┼──────────┼──────────┼──────────╢
║ demo-bank-wallet │ None │ │ None ║
╟─────────────────────┼──────────┼──────────┼──────────╢
║ settlement-wallet │ None │ │ None ║
╚═════════════════════╧══════════╧══════════╧══════════╝As well as their balances:
$ minka wallet balances settlement-wallet
Balances:
$0.00 (usd)$ minka wallet balances demo-bank-wallet
Balances:
$700.00 (usd)And here are intents responsible for those balances:
$ minka intent list
╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Handle Action Source Target Amount Status ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ iBCFhzFpuCxuDI4hoErCp Destroy settlement-wallet - $300.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ eHFmr4O2iSrrxYGAmuRnt Transfer demo-bank-wallet settlement-wallet $300.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ 1tBaX8vZcH1V0bFmU7XKP Issue - demo-bank-wallet $1,000.00 usd completed ║
╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝Demonstrating unrestricted access
Now, we will make 2 transactions:
- the first one from
demo-bank-wallettosettlement-wallet- sending
$200.00
- sending
- and the second one from
settlement-wallettodemo-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.
minka intent create
? Handle: Di4lviGf2J15UfCb7kg1K
? Action: transfer
? Source: demo-bank-wallet
? Target: settlement-wallet
? Symbol: usd
? Amount: 200
? Add another action? No
? Add custom data for this intent? No
? Signers: my-bank
? Signer password for my-bank [hidden]
Intent summary:
---------------------------------------------------------------------------
Handle: Di4lviGf2J15UfCb7kg1K
Action: transfer
- Source: demo-bank-wallet
- Target: settlement-wallet
- Symbol: usd
- Amount: $200.00
? Sign this intent using signer my-bank? Yes
✅ Intent signed and sent to ledger tutorial-ledger
Intent summary:
---------------------------------------------------------------------------
Handle: Di4lviGf2J15UfCb7kg1K
Action: transfer
- Source: demo-bank-wallet
- Target: settlement-wallet
- Symbol: usd
- Amount: $200.00
Access rules:
#0
- Action: any
- Signer:
- public: fUXg1buyvzZ5RHXjty3Jwz1MKDKB/CKS+ssEWvrWdSk=
Luid: $int.-07zZfKm8K_QEm-WKAnd now we're sending $100.00 back (still using the demo-bank signer).
minka intent create
? Handle: QB8ZYRhTdaZPPUidspuJ9
? Action: transfer
? Source: settlement-wallet
? Target: demo-bank-wallet
? Symbol: usd
? Amount: 100
? Add another action? No
? Add custom data for this intent? No
? Signers: my-bank
? Signer password for my-bank [hidden]
Intent summary:
---------------------------------------------------------------------------
Handle: QB8ZYRhTdaZPPUidspuJ9
Action: transfer
- Source: settlement-wallet
- Target: demo-bank-wallet
- Symbol: usd
- Amount: $100.00
? Sign this intent using signer my-bank? Yes
✅ Intent signed and sent to ledger tutorial-ledger
Intent summary:
---------------------------------------------------------------------------
Handle: QB8ZYRhTdaZPPUidspuJ9
Action: transfer
- Source: settlement-wallet
- Target: demo-bank-wallet
- Symbol: usd
- Amount: $100.00
Access rules:
#0
- Action: any
- Signer:
- public: fUXg1buyvzZ5RHXjty3Jwz1MKDKB/CKS+ssEWvrWdSk=
Luid: $int.-07ze7YtT_zUaWahqAgain 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:
$ minka intent list
╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
║ Handle Action Source Target Amount Status ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ QB8ZYRhTdaZPPUidspuJ9 Transfer settlement-wallet demo-bank-wallet $100.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ Di4lviGf2J15UfCb7kg1K Transfer demo-bank-wallet settlement-wallet $200.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ iBCFhzFpuCxuDI4hoErCp Destroy settlement-wallet - $300.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ eHFmr4O2iSrrxYGAmuRnt Transfer demo-bank-wallet settlement-wallet $300.00 usd completed ║
╟────────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
║ 1tBaX8vZcH1V0bFmU7XKP Issue - demo-bank-wallet $1,000.00 usd completed ║
╚════════════════════════════════════════════════════════════════════════════════════════════════════════════════╝And here are the final wallet balances:
$ minka wallet balances demo-bank-wallet
Balances:
$600.00 (usd)$ minka wallet balances settlement-wallet
Balances:
$100.00 (usd)Our next step is to limit the access to wallets and only allow its owner to move the funds/balances.