Make Transactions
In this tutorial, you will make transactions between wallets — first a simple wallet-to-wallet transfer, then using account addresses within wallets.
This tutorial references layout template files for download that are not yet available. Contact the Minka team for access to the template files.
Making first transaction between wallets
![]()
Before we make the transaction, we will check the balances of the wallets to see what is their initial state.
Due to our default-policy policy that allows records (in this case wallets) to be read only by their owner, we have to login as tesla-signer signer first. Remember to use tesla for password as well, as it is defined in signers.json layout file. To login, use the following command:
minka ledger loginTo check the balance of the tesla-wallet wallet, we will use the following CLI command:
minka wallet balances tesla-walletWe can do the same for the minka-wallet wallet, using the minka-signer signer.
We see that the inital balances for these wallets are:
| Wallet | USD Balance | DOP Balance |
|---|---|---|
| tesla-wallet | 1,000,000.00 | 5,000,000.00 |
| minka-wallet | 1,000,000.00 | 5,000,000.00 |
Now, we will make a transaction between tesla-wallet and minka-wallet wallets. To do that, make sure you log in as tesla-signer signer again. The transfer intent will be initiated using layout file p2p-transaction.json. Apply this layout file using the following command:
minka layout apply --localWhen running the balance commands again (with separate signers for each wallet), we will see that the balance of the tesla-wallet wallet has decreased by 5000 and the balance of the minka-wallet wallet has increased by 5000, and the new balances are:
| Wallet | USD Balance | DOP Balance |
|---|---|---|
| tesla-wallet | 995,000.00 | 5,000,000.00 |
| minka-wallet | 1,005,000.00 | 5,000,000.00 |
Making transaction between wallets using complex addressing
In the previous example, we used the tesla-wallet and minka-wallet wallets directly. In this example, we will show how complex addressing can be used to make a transaction between wallets.
Introduction to wallet addressing
Wallet handle is read as a pattern <schema>:<handle>@<parent>. While schema and parent are optional, handle is required.
Here are some examples of wallet handles and how their components are interpreted:
| Wallet Handle | Schema | Handle | Parent |
|---|---|---|---|
account:1001001234@tesla-wallet | account | 1001001234 | tesla-wallet |
1001009876@minka-wallet | - | 1001009876 | minka-wallet |
tel:15261234578 | tel | 15261234578 | - |
tel@zaba | - | tel | zaba |
zaba | - | zaba | - |
Once wallet components are identified, ledger engine is using the following hierarchy to find the wallet handle in the ledger:
<schema>:<handle>@<parent><schema>@<parent><parent><schema>
When wallet is found in the hierarchy, it is used as the source or target of the transaction. Otherwise, the wallet is not found, the transaction is not possible and the error is returned.
For more detailed information about wallet addressing, refer to the About Wallets documentation.
Transaction between tesla-wallet and minka-wallet using complex addressing
In this example, we will make a transaction between tesla-wallet and minka-wallet wallets, using complex addressing.
Source wallet will be account:1001001234@tesla-wallet and target wallet will be account:1001009876@minka-wallet. Once these wallets handles are passed through the hierarchy, they will be resolved in the following way:
account:1001001234@tesla-walletaccount:1001001234@tesla-wallet-> wallet foundaccount@tesla-wallet-> wallet foundtesla-wallet-> wallet found
account:1001009876@minka-walletaccount:1001009876@minka-wallet-> wallet foundaccount@minka-wallet-> wallet foundminka-wallet-> wallet found
This means that the transaction will be made between tesla-wallet and minka-wallet wallets.
Download the p2p-transaction-complex.json layout file and apply it.
When running the balance commands again (with separate signers for each wallet), we will see that the balance of the tesla-wallet wallet has decreased by 20000 and the balance of the minka-wallet wallet has increased by 20000, and the new balances are:
| Wallet | USD Balance | DOP Balance |
|---|---|---|
| tesla-wallet | 975,000.00 | 5,000,000.00 |
| minka-wallet | 1,025,000.00 | 5,000,000.00 |