Keys and signatures
Let's introduce the concept of signers (users)
Overview
As we mentioned before, every action in Minka Ledger system is a database JSON record that needs to be signed. And in order to sign it, you need to generate your public and private key pair.
You will NOT be creating any kind of "user" on the server, nor will such user exist anywhere (in any way, shape, or form).
Users themselves do not exist as an entity. We only work here with keys.
And those keys are used to sign every record you create.
Public vs private
Public and private keys might look something like this:
private
/ secret
key must not be shared with anyone. It must be stored in a place that is secure and not accessible by unauthorized people.
Private key is used to sign everything you do inside the Minka Ledger system.
public
key can be shared with anyone.
And it can be used by everyone to verify your signature.
Minka Ledger system is easily auditable because public keys allow you to verify anyone's signature.
Wallet record example
If you create a wallet
record, it might look something like this:
Notice that the value inside data -> access -> signer -> public
is your public key.
This means you have full access and you can do any action ("action": "any"
) when you sign it with your private key.
If, for example, anyone else tries to make a transaction from your wallet, that transaction will fail. Because they will sign it with a different public/private key pair.
Next steps
Now that you understand how the keys and signatures work, in our next tutorial we'll create our own public and private keys (i.e., our "user"/signer).