Let us first understand how basic transfers work. Everyone on the Autonomi Network, both clients (wallet apps, the CLI, etc) and nodes (data storage) has a public/private keypair.
The public key is used to receive tokens. It is equivalent to bitcoin or ethereum addresses. The private key (secret key) is used to sign transactions and prove ownership of money.
This is what a public key looks like:
93d01b3c6c0d41c4e50c855c753f906ba478f97a838415e6d74615a4b037a7101e724f935727bbf23d17293ab74a3027
Money in a wallet is stored as CashNotes
. These are like a cheque, or a digital bearer certificate, for a given value. They contain all the necessary information for the owner to spend the value in them.
Unlike cash, CashNotes
have owners; they have no value for anyone else as they are useless without the private key. Also they need to be ‘reissued’ to a payee before they can be spent. This is to prevent double-spend.
In summary, CashNotes provide a quick, safe, flexible way to make payments that is compatible with multisig/threshold signature cryptography and can be used online and eventually offline. They simplify many aspects of the Network economy and remove the need for section wallets or similar mechanisms to manage token transfers.
Here’s how they work in practice. When someone wants to send money, they create a ‘transaction’ whereby they spend their own CashNotes
in exchange for new CashNotes
that are owned by the recipient.
Since those CashNotes
contain secrets that might affect the privacy of the sender and the recipient (e.g. their public key), they are never sent or stored on the Network. Instead, the sender creates ‘CashNoteRedemptions’, small files that contain the minimum information that the recipient needs to verify the transaction and re-create their own CashNote on their side.
CashNoteRedemptions are encrypted and packed into a transfer which is sent directly to the recipient. The recipient of the transfer can then decrypt it using their secret key, verify and rebuild the CashNotes, before adding them to their wallet. At that point, the transfer is complete!
You can send a transfer with:
safe wallet send <amount> <to [public_key]>
Example:
This will print the encrypted transfer which can be published or sent directly to the recipient.
They can receive it with: safe wallet receive <transfer>