Withdraw funds
Describing the process of removing balances from the Ledger system
Use case
In this tutorial we will focus on banks removing/withdrawing the funds from the Minka Ledger system.
Here is a more detailed overview of the steps when it comes to withdrawal process.
Creating a settlement wallet
When a bank chooses to make a withdrawal, it will make a transaction to a settlement wallet
that belongs to a clearinghouse.
This means a clearinghouse needs to have such a wallet.
And here we will create one.
Bank decides to withdraw funds
The first step in this process is for the bank to send the amount they wish to withdraw to the settlement-wallet
.
Just as a reminder, currently we have 2 wallets in our ledger (demo-bank-wallet
and settlement-wallet
) which you can check using this CLI command in your terminal:
To initiate payout, demo-bank
signer/user, will create an intent
to make a transfer
from demo-bank-wallet
to settlement-wallet
.
This is also how regular balance transfers are made between any other two wallets in the system (and not just settlement-wallet
).
We can also see this new intent in the list of intents:
The resulting balance of demo-bank-wallet
is now $700
:
And the balance of the settlement-wallet
is $300
:
Payout and removing the funds
After the previous steps are done, clearinghouse will:
- make a payout to the bank
- remove balance from the Ledger system
To achieve this, a clearinghouse
signer will make a new (destroy
) intent that removes the balance from the settlement-wallet
:
We can check that new intent
was created:
And we can also check the new settlement-wallet
balance:
This shows the balance is truly removed from the Ledger system and currency withdrawal is completed.