Deposit funds
Describing the process of adding new balances to the Ledger system
Use case
One of the most fundamental use cases is deposit/withdrawal functionality.
A bank might want to deposit funds that can be used inside the Minka Ledger and transact with other participants (accounts/wallets) in the system (banks, private or business accounts, etc.)
A bank might also want to withdraw excess funds from the Ledger system.
And in this tutorial we will go through the process of issuing new balances.
Creating a bank wallet
Creating a bank wallet is something a bank usually does with its own signer. To showcase deposit/withdraw functionality we need a "demo" bank wallet, so we will create bank signer and bank wallet using that signer.
To create a wallet we will pretend to be a bank and do the same steps we did previously:
- create a new "bank" signer (
demo-bank
) - create a wallet using that signer
In real life, this bank signer
would never be on our (clearinghouse) computer and we would never have access to a private key (secret
) from the bank. But here we're creating it so we can have a bank wallet
on this ledger
. And then we can showcase other actions that are possible for clearinghouse (publishing and removing currency from the system).
Now our "demo-bank" will create its wallet
:
Notice how luid
from this record starts with $wlt...
, indicating it's a wallet record.
And also note, we used demo-bank
signer to create this wallet, and not the clearinghouse
signer.
Here is how we can check the balance of this newly created wallet:
The wallet is empty, but now we can go to the next step, and that's issuing money to bank's wallet.
Publish (issue) new balance
We will issue $1,000
to the demo-bank-wallet
using usd
currency we created in previous tutorial.
Balance change in the wallet
is represented in Minka Ledger system by intent
. And intent is just another type of record.
To learn more about how wallet balance updates work, and where they are stored, check out this document.
handle
is a record ID which you can set to whatever value you want. But in most cases you can just leave the default one.
The defult handle is is created automatically (just for intents) as a convenience.
We can see new intent
is created and luid
starts with $int...
which indicates intent record.
And it is signed with clearinghouse
signer.
We can also list all the intents using the following command:
And we can check demo-bank-wallet
balance and see that the new amount is $1,000: