Skip to content

Gaiad gentx command incorrect for offline/multisig keys #3730

Closed
@sunnya97

Description

If you use the gaiad gentx command with an offline key or multisig as the operator, it gives you bytes to sign.

$ gaiad gentx --name=multitest --amount=1stake

Bytes to sign:
{"account_number":"0","chain_id":"testing","fee":{"amount":[],"gas":"200000"},"memo":"56e39eda5725bac3646da34d2b3125bb41859d0a@10.0.1.35:26656","msgs":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"commission":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"delegator_address":"cosmos1gnu4d9xg0a8rrxdns3zw75vxh9txngslc2zw9m","description":{"details":"","identity":"","moniker":"testing","website":""},"min_self_delegation":"1","pubkey":"cosmosvalconspub1zcjduepqm0p2hyfm6wg8rtc26ps9d9704kendjwt2zsuh8d872nds7lv75as2judmq","validator_address":"cosmosvaloper1gnu4d9xg0a8rrxdns3zw75vxh9txngsla7kmfg","value":{"amount":"1","denom":"stake"}}}],"sequence":"0"}

Enter Amino-encoded signature:

Two issues here.

  1. It is missing the type information of StdTx. The entire above output needs to wrapped in:
{"type":"auth/StdTx","value":[output]}
  1. The key for the msgs in the tx json above is msgs but it should be msg.

The final proper output of this should have looked like this:

{"type":"auth/StdTx","value":{"account_number":"0","chain_id":"testing","fee":{"amount":[],"gas":"200000"},"memo":"7b3f8010567055f58038148bd66e091a4c0bf59e@192.168.86.156:26656","msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"commission":{"max_change_rate":"0.010000000000000000","max_rate":"0.200000000000000000","rate":"0.100000000000000000"},"delegator_address":"cosmos1gnu4d9xg0a8rrxdns3zw75vxh9txngslc2zw9m","description":{"details":"","identity":"","moniker":"testing","website":""},"min_self_delegation":"1","pubkey":"cosmosvalconspub1zcjduepqt7gyfy0luwzjsdjev20z9shy54vl4rx2tejp8f5zaxrh3zgu3yrqdd6t9q","validator_address":"cosmosvaloper1gnu4d9xg0a8rrxdns3zw75vxh9txngsla7kmfg","value":{"amount":"100000000","denom":"stake"}}}],"sequence":"0"}}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions