如下图所示,右边是EOS wallet钱包,里面只放私钥,而且钱包只有密码,unlock钱包的时候需要钱包密码。
image.png
左边是EOS Account账户,可以看成一个保险箱,里面有EOS token和智能合约,而需要转移里面的EOS Token(或者执行智能合约),你需要钱包中对应的私钥来解锁这个保险箱。
EOS Dawn 3.0测试版本中创建一个账户的命令是:
cleos create account {创建者账户名} {新的账户名} 公钥1 公钥2
其中{创建者账户名}是为这个创建动作支付EOS的账户,公钥1和公钥2分别是两个不同权限的密钥对的公钥。
image.png
所以把权限系统加上,图就变成上面这个样子,一个保险柜有两个开关,不过打开后可以进行操作的权限是不同的。2个私钥可以存在一个钱包里,也可以如上图所示存在不同的钱包里(由不同的人控制)。
root@7cc6d6a2b9dc:/# cleos wallet create -n wbs
"/opt/eosio/bin/keosd" launched
Creating wallet: wbs
Save password to use in the future to unlock this wallet.
Without password imported keys will not be retrievable.
"PW5KMYJGubxrSJ7E4ozjoRcGBXZ23WtRZzTWcF4LqEmDXeWTpc1n9"
root@7cc6d6a2b9dc:/# cleos wallet lock -n wbs
Locked: wbs
root@7cc6d6a2b9dc:/# cleos wallet unlock -n wbs
password: Unlocked: wbs
root@7cc6d6a2b9dc:/# cleos create key
Private key: 5J4FyXaQmqq1N3zgV7e5R5pTwkiyGjzkNB3sbi858tGhN6Fw7P6
Public key: EOS6UZTiCRmm6SQQQFntSWMRrfSy3xyVMPVcRdj4ajj2T94poTKEn
root@7cc6d6a2b9dc:/# cleos wallet import -n wbs 5J4FyXaQmqq1N3zgV7e5R5pTwkiyGjzkNB3sbi858tGhN6Fw7P6
imported private key for: EOS6UZTiCRmm6SQQQFntSWMRrfSy3xyVMPVcRdj4ajj2T94poTKEn
root@7cc6d6a2b9dc:/# cleos wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 -n wbs
imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
root@7cc6d6a2b9dc:/# cleos create account eosio user EOS6UZTiCRmm6SQQQFntSWMRrfSy3xyVMPVcRdj4ajj2T94poTKEn EOS6UZTiCRmm6SQQQFntSWMRrfSy3xyVMPVcRdj4ajj2T94poTKEn
executed transaction: ab5c0b1406101427abfa9ca562148348ffacaeb16be594a5d49b2d07320902fe 200 bytes 277 us
# eosio <= eosio::newaccount {"creator":"eosio","name":"user","owner":{"threshold":1,"keys":[{"key":"EOS6UZTiCRmm6SQQQFntSWMRrfSy...
warning: transaction executed locally, but may not be confirmed by the network yet
网友评论