Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ledger sig conversion #390

Merged
merged 1 commit into from
Mar 5, 2024
Merged

fix: ledger sig conversion #390

merged 1 commit into from
Mar 5, 2024

Conversation

j75689
Copy link
Collaborator

@j75689 j75689 commented Mar 4, 2024

Description

New: v0.10.18

./build/tbnbcli.new staking bsc-delegate --amount 20000021:BNB --validator bva1pnww8kx30sz4xfcqvn8wjhrn796nf4dq77hcpa --side-chain-id chapel --chain-id Binance-Chain-Ganges --node https://data-seed-pre-0-s1.bnbchain.org:443 --trust-node --from ld0 --ledger
DEBUG!!! msgByte: {"account_number":"91733","chain_id":"Binance-Chain-Ganges","data":null,"memo":"","msgs":[{"type":"cosmos-sdk/MsgSideChainDelegate","value":{"delegation":{"amount":"20000021","denom":"BNB"},"delegator_addr":"tbnb1v4wm6hexfkxgv7gu2va6adn2qg7udz3l73g9cc","side_chain_id":"chapel","validator_addr":"bva1pnww8kx30sz4xfcqvn8wjhrn796nf4dq77hcpa"}}],"sequence":"16","source":"0"}
Please confirm if address displayed on ledger is identical to tbnb1v4wm6hexfkxgv7gu2va6adn2qg7udz3l73g9cc (yes/no)?yes
Please verify the transaction data on ledger
!!DEBUG ledger sig 3045022100fc64069412faac462832d61672f99aa57ba23673f4c37902c85da88a8f23dbba02202b82c9c0e41be2b342e9f0c033c5451a99d15da233d08c9090bfdffbe203349b
DEBUG!!! sigBytes: 00fc64069412faac462832d61672f99aa57ba23673f4c37902c85da88a8f23db202b82c9c0e41be2b342e9f0c033c5451a99d15da233d08c9090bfdffbe20334
ERROR: {"codespace":1,"code":4,"abci_code":65540,"message":"signature verification failed"}

Old: v0.10.6

./build/tbnbcli.old staking bsc-delegate --amount 20000021:BNB --validator bva1pnww8kx30sz4xfcqvn8wjhrn796nf4dq77hcpa --side-chain-id chapel --chain-id Binance-Chain-Ganges --node https://data-seed-pre-0-s1.bnbchain.org:443 --trust-node --from ld0 --ledger 
DEBUG!!! msgByte: [123 34 97 99 99 111 117 110 116 95 110 117 109 98 101 114 34 58 34 57 49 55 51 51 34 44 34 99 104 97 105 110 95 105 100 34 58 34 66 105 110 97 110 99 101 45 67 104 97 105 110 45 71 97 110 103 101 115 34 44 34 100 97 116 97 34 58 110 117 108 108 44 34 109 101 109 111 34 58 34 34 44 34 109 115 103 115 34 58 91 123 34 116 121 112 101 34 58 34 99 111 115 109 111 115 45 115 100 107 47 77 115 103 83 105 100 101 67 104 97 105 110 68 101 108 101 103 97 116 101 34 44 34 118 97 108 117 101 34 58 123 34 100 101 108 101 103 97 116 105 111 110 34 58 123 34 97 109 111 117 110 116 34 58 34 50 48 48 48 48 48 50 49 34 44 34 100 101 110 111 109 34 58 34 66 78 66 34 125 44 34 100 101 108 101 103 97 116 111 114 95 97 100 100 114 34 58 34 116 98 110 98 49 118 52 119 109 54 104 101 120 102 107 120 103 118 55 103 117 50 118 97 54 97 100 110 50 113 103 55 117 100 122 51 108 55 51 103 57 99 99 34 44 34 115 105 100 101 95 99 104 97 105 110 95 105 100 34 58 34 99 104 97 112 101 108 34 44 34 118 97 108 105 100 97 116 111 114 95 97 100 100 114 34 58 34 98 118 97 49 112 110 119 119 56 107 120 51 48 115 122 52 120 102 99 113 118 110 56 119 106 104 114 110 55 57 54 110 102 52 100 113 55 55 104 99 112 97 34 125 125 93 44 34 115 101 113 117 101 110 99 101 34 58 34 49 54 34 44 34 115 111 117 114 99 101 34 58 34 48 34 125]
Please confirm if address displayed on ledger is identical to tbnb1v4wm6hexfkxgv7gu2va6adn2qg7udz3l73g9cc (yes/no)?y
Please verify the transaction data on ledger
!!DEBUG ledger sig 3045022100fc64069412faac462832d61672f99aa57ba23673f4c37902c85da88a8f23dbba02202b82c9c0e41be2b342e9f0c033c5451a99d15da233d08c9090bfdffbe203349b
DEBUG!!! sigBytes: fc64069412faac462832d61672f99aa57ba23673f4c37902c85da88a8f23dbba2b82c9c0e41be2b342e9f0c033c5451a99d15da233d08c9090bfdffbe203349b
ERROR: {"codespace":1,"code":14,"abci_code":65550,"message":"msg not supported"}

Rationale

In the convertDERtoBER method, when converting ledger sig(btcd) to tendermint.secp256k1 signature, the method of reading the S, R value length is not correct.

@j75689 j75689 merged commit 30e9cba into master Mar 5, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants