AccountNumber sounds like it's an account ID. It's more of a nonce.
bash cosmos-sdk$ ./build/gaiacli tx staking delegate --amount 100stake --help
delegate liquid tokens to a validator
Usage:
gaiacli tx staking delegate [flags]
Flags:
--account-number uint AccountNumber number to sign the tx
--amount string Amount of coins to bond
...
Wouldn't it be less weird to call this --account-nonce? There would be no expectation that this number can be used as a lookup, for example. We don't index accounts by account number.
I rather like this proposal. It makes much more clear what the number is used for. 馃憤 from me.
Hmm OK, but it's not the nonce of the account - that's the sequence number. I think we would risk confusing those two (as in e.g. Ethereum the account nonce is what we call the sequence number).
second what @cwgoes stated. The account sequence number is the actual nonce.
They're both nonces, one is sequential, the other is not. I think it's still better to call a nonce a nonce than to call it a number, even if there's a different kind of nonce in the same struct, called a sequence. But here's a picture of a yak.
_,,,_
.-'` ( '.
.-' ,_ ; \___ _,
__.' ) \'.__.'(:;'.__.'/
__..--"" ( '.__{':');}__.'
.' ( ; ( .-|` ' |-.
/ ( ) ) '-p q-'
( ; ; ; ; |.---.|
) ( ( ; \ o o)
| ) ; | ) ) /'.__/
) ; ) ; | ; //
( ) _,\ ; //
; ( ,_,,-~""~`"" \ ( //
\_.'\\_ '. /<_
\\_)--\ \ \--\
jgs )--\""` )--\"`
`""` `""`
How about we keep AccountNumber
and change SequenceNumber
to Nonce
?
How about we keep
AccountNumber
and changeSequenceNumber
toNonce
?
Unfortunately this will break the Ledger application.
If this change is necessary, we might need to allow for both names in the ledger app, it is feasible.
Still, I agree that using nonce instead of number brings more clarity to the purpose of those numbers.
There one additional mixup in gaiacli that makes this change a bit more useful to avoid confusion. :|
When creating an account gaiacli keys add
has flags for account and index (numbers). Those two are used as part of the derivation path 44'/118'/{account}'/0/{index}
, a totally unrelated use. I have noticed that some people mixup the account (HDPath) with the accountNumber (nonce).
I would definitely start using nonce where nonces are. Or as @jaekwon may prefer, the accountYak.
They're both nonces
Sequence number is same as nonce in Ethereum and it prevents replay attacks. However I don't understand what is the necessity of having account number? What would be happening it we didn't have account number at the first place?
We have account numbers for account pruning purposes IIRC. That being said, I'm not sure if there is anything actionable -- doesn't seem there is clear consensus on any particular direction.
@alexanderbez Thanks, I found this which explains it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
They're both nonces, one is sequential, the other is not. I think it's still better to call a nonce a nonce than to call it a number, even if there's a different kind of nonce in the same struct, called a sequence. But here's a picture of a yak.
_,,,_ .-'` ( '. .-' ,_ ; \___ _, __.' ) \'.__.'(:;'.__.'/ __..--"" ( '.__{':');}__.' .' ( ; ( .-|` ' |-. / ( ) ) '-p q-' ( ; ; ; ; |.---.| ) ( ( ; \ o o) | ) ; | ) ) /'.__/ ) ; ) ; | ; // ( ) _,\ ; // ; ( ,_,,-~""~`"" \ ( // \_.'\\_ '. /<_ \\_)--\ \ \--\ jgs )--\""` )--\"` `""` `""`