Key Generation
key
key
command generates keypairs, gets addresses from keys, and gets signature.key
command are as follows.new
address
sign
Note
Keypair
Private key and public key are created through keypair generation.
The generated keypair is used to create an account, register a keypair of a node, and create a signature of operation and seal.
new
new
is used for creating a new keypair.Random Keypair
$ ./mitum key new
$ ./mitum key new
hint: mpr
privatekey: L1ZERchoY53vC5TJQ3WnZEWmg97L2Utw5rgFrCwM7ekTu9zJkZYjmpr
publickey: 28nFxuC5ETygieSGEYTkewwnCZseB4TNYGMRtxz31bvxzmpu
Keypair from Seed
$ ./mitum key new --seed <string seed>
$ ./mitum key new --seed abcdefghijklmnopqrstuvwxyzABCDEFGHIJ
hint: mpr
privatekey: KypAAGYtVFdTFLS8muPJhwfJBFCFHKSe594yYmKK3FPteh7sie4Dmpr
publickey: 25BcZrcyiE3TD2BZEqkdDuaYB9zHxpdW82BNn8HkCLTijmpu
address
address
command is used for generating addresses from keys.$ ./mitum key address <threshold> [<publickey>,<weight>]
address
command is used as follows.threshold |
100 |
keys |
{key: 21Sn1o…, weight: 50}, {key: utzCef…, weight: 50} |
$ ./mitum key address 100 21Sn1owHXRx336aaerU1WbbKjiZXMcrJsnxBHP9etNx6zmpu,50 utzCefA1Szmmt3rAwqW5yEhxK1x3hG3Y3yThEK3gZmv3mpu,50
37x8YoAGA93B3HmDVNterRf1NTgz9tfN1gQn4jYuBYCHmca
Multi Sig Account
Account is a data structure that has currency and balance in Mitum Currency.
Account has a unique value called address and can be identified through this.
Register a public key for user’s Account authentication.
Mitum Currency accounts can register multiple public keys because multi signatures are possible.
address |
HjyXhhuHAZBGaEw2S5cKZhDwqVc1StbkJMtdgGm3F1dnmca |
threshold |
100 |
keys |
{key: rd89Gx…, weight: 50}, {key: skRdC6…, weight: 50} |
balance |
{currency: MCC, amount: 10000}, {currency: MCC2, amount: 20000} |
Note
There are several conditions that each account should follow.
The range of
threshold
should be 1 <= threshold <= 100.The range of each
weight
should be 1 <= weight <= 100.The sum of every weight of the account should be greater than or equal to
threshold
.Each key must be a BTC compressed public key with suffix
mpu
.mca
follows the address as a suffix.
These are examples of available account states.
CASE1 (single)
threshold: 100
keys: {key: rd89Gx…, weight: 100}
CASE2 (single)
threshold: 50
keys: {key: rd89Gx…, weight: 60}
CASE3 (multi)
threshold: 100
keys: {key: rd89Gx…, weight: 40}, {key: skRdC6…, weight: 30}, {key: mymMwq…, weight: 30}
CASE4 (multi)
threshold: 50
keys: {key: rd89Gx…, weight: 20}, {key: skRdC6…, weight: 20}, {key: mymMwq…, weight: 10}
weight
or threshold
are different.sign
sign
command is used for getting the signature of the private key for a specific message.$ ./mitum key sign <privatekey> <signature base>
$mitum key sign L5nDx2QtZVBPtJvUQ13cj3bMhC487JdxrwXTdS6JgzTvnSHestCxmpr bWVzc2FnZQ=
381yXZHrm73kGD8z7FAksBjxy49wPRWn3WRdP22befdbFff6WYSdK8rz9TLpFWuEW7rmmphF3rHkrvTPvhVQ5kXNGLmELBwZ