Configure account permissions, co-sign transactions, inspect signature weight, and use TronLink multi-sign. For the underlying permission model, see concepts/multisig.
Multi-signature allows other users to access the account in order to better manage it. There are three types of access:
- owner: access to the owner of the account.
- active: access to other features of accounts, and access that authorizes a certain feature. Block production authorization is not included if it's for witness purposes.
- witness: only for witness; block production authorization will be granted to one of the other users.
> Updateaccountpermission TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ {"owner_permission":{"type":0,"permission_name":"owner","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"witness_permission":{"type":1,"permission_name":"witness","threshold":1,"keys":[{"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ","weight":1}]},"active_permissions":[{"type":2,"permission_name":"active12323","threshold":2,"operations":"7fff1fc0033e0000000000000000000000000000000000000000000000000000","keys":[{"address":"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR","weight":1},{"address":"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP","weight":1}]}]}or
wallet> updateAccountPermission
=== UpdateAccountPermission Interactive Mode ===
Select permission to modify:
1. owner_permission
2. witness_permission
3. active_permissions
4. Add new active_permission
5. Delete active_permission
6. Show preview and Confirm
7. Exit
> The account TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ gives the owner access to itself, active access to TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR and TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP. Active access will need signatures from both accounts in order to take effect.
If the account is not a witness, it's not necessary to set witness_permission, otherwise an error will occur.
> SendCoin TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW 10000000000000000Will show "Please confirm and input your permission id, if input y or Y means default 0, other non-numeric characters will cancel transaction."
This will require the transfer authorization of active access. Enter: 2
Then select accounts and put in the local password, i.e. TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR needs a private key of TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR to sign a transaction.
Select another account and enter the local password, i.e. TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP will need a private key of TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP to sign a transaction.
The weight of each account is 1, threshold of access is 2. When the requirements are met, users will be notified with "Send 10000000000000000 Sun to TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW successful !!".
This is how multiple accounts use multi-signature when using the same cli. Use the instruction addTransactionSign according to the obtained transaction hex string if signing at multiple cli. After signing, the users will need to broadcast final transactions manually.
Obtain weight information according to a transaction.
> getTransactionSignWeight
0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101The information displays as follows:
{
"result":{
"code":"PERMISSION_ERROR",
"message":"Signature count is 2 more than key counts of permission : 1"
},
"permission":{
"operations":"7fff1fc0033e0100000000000000000000000000000000000000000000000000",
"keys":[
{
"address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
"weight":1
}
],
"threshold":1,
"id":2,
"type":"Active",
"permission_name":"active"
},
"transaction":{
"result":{
"result":true
},
"txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
"transaction":{
"signature":[
"c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
"3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
],
"txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
"raw_data":{
"contract":[
{
"parameter":{
"value":{
"amount":10000000000000000,
"owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
"to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
},
"type_url":"type.googleapis.com/protocol.TransferContract"
},
"type":"TransferContract",
"Permission_id":2
}
],
"ref_block_bytes":"0318",
"ref_block_hash":"60e195d3609c8661",
"expiration":1554123306262,
"timestamp":1554101706260
},
"raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
}
}
}Get signature information according to a transaction.
> getTransactionApprovedList
0a8c010a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d1241c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b0112413d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101{
"result":{
},
"approved_list":[
"TKwhcDup8L2PH5r6hxp5CQvQzZqJLmKvZP",
"TNhXo1GbRNCuorvYu5JFWN3m2NYr9QQpVR"
],
"transaction":{
"result":{
"result":true
},
"txid":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
"transaction":{
"signature":[
"c18ca91f1533ecdd83041eb0005683c4a39a2310ec60456b1f0075b4517443cf4f601a69788f001d4bc03872e892a5e25c618e38e7b81b8b1e69d07823625c2b01",
"3d61eb0f8868990cfa138b19878e607af957c37b51961d8be16168d7796675384e24043d121d01569895fcc7deb37648c59f538a8909115e64da167ff659c26101"
],
"txID":"7da63b6a1f008d03ef86fa871b24a56a501a8bbf15effd7aca635de6c738df4b",
"raw_data":{
"contract":[
{
"parameter":{
"value":{
"amount":10000000000000000,
"owner_address":"TRGhNNfnmgLegT4zHNjEqDSADjgmnHvubJ",
"to_address":"TJCnKsPa7y5okkXvQAidZBzqx3QyQ6sxMW"
},
"type_url":"type.googleapis.com/protocol.TransferContract"
},
"type":"TransferContract",
"Permission_id":2
}
],
"ref_block_bytes":"0318",
"ref_block_hash":"60e195d3609c8661",
"expiration":1554123306262,
"timestamp":1554101706260
},
"raw_data_hex":"0a020318220860e195d3609c86614096eadec79d2d5a6e080112680a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412370a1541a7d8a35b260395c14aa456297662092ba3b76fc01215415a523b449890854c8fc460ab602df9f31fe4293f18808084fea6dee11128027094bcb8bd9d2d"
}
}
}Create multi-sign transactions and view the multi-sign transaction list through the TronLink service. Requires a secretId and secretKey — see config.conf.
wallet> tronlinkmultisign
=== Multi-Sign Manager ===
1. Multi-sign transaction list
2. Create multi-sign transaction
0. Exit
Please enter the number to operate:- concepts/multisig — permission / weight / threshold model
- wallet — managing the keystores used to co-sign