elements icon indicating copy to clipboard operation
elements copied to clipboard

txout nonce is inconsistently stored in coinsview

Open apoelstra opened this issue 4 years ago • 3 comments

We currently do not de/serialize the txout nonce in the Coin class, meaning that after restarting the node, all nonces in the utxoset are cleared, resulting in a network where everyone has an (inconsequentially) different version of the UTXO set.

Currently the nonce is not used for anything consensus-critical, but it may be in the future --- for example, we might want input nonces covered by a future sighash version --- so this is a massive footgun.

apoelstra avatar May 28 '21 17:05 apoelstra

I recommend going through and explicitly censoring the nonce stored in any CoinsView that represents the UTXO set.

roconnor-blockstream avatar May 29 '21 16:05 roconnor-blockstream

I think we're going to just fix the serialization (after confirming that the rescan is not horribly long)

apoelstra avatar Jun 01 '21 12:06 apoelstra

Addressed by https://github.com/ElementsProject/elements/pull/1008.

stevenroose avatar Nov 25 '21 17:11 stevenroose