🔑 Keys
The main strength of the network is on it's keys
Keys are generated directly in the browser:
const keyPair = await subtle.generateKey(
{
name: "RSA-PSS",
modulusLength: 2048,
publicExponent: new Uint8Array([1, 0, 1]),
hash: "SHA-256",
},
true,
["sign", "verify"]
);
This creates a key pair of Public and Private keys.
Public Ley: can be public and will be used to verify all signatures generated with this key-pair.
Private Key: is private and not be shared.
For a new key to be allowed to add new blocks to the network, an existing entity (with the proper permissions) must add it through a block with the content:
// ADD NEW USER
grantKey({
name: "KEYNAME",
pubKey:
"-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhki...IVizEoJZIz8JA9tkjZ+ZVPBfYlBQIDAQAB -----END PUBLIC KEY-----",
});
Last updated