ordinals / ord

👁‍🗨 Rare and exotic sats
https://ordinals.com
Creative Commons Zero v1.0 Universal
3.85k stars 1.38k forks source link

Off-by-one error in wallet.rs #3508

Closed gmart7t2 closed 7 months ago

gmart7t2 commented 7 months ago

If we wait for the commit to have 6 confirmations before sending the reveal, the reveal will have at least 7 confirmations when it confirms.

sed -i 's/Runestone::COMMIT_CONFIRMATIONS/(Runestone::COMMIT_CONFIRMATIONS - 1)/' src/wallet.rs
casey commented 7 months ago

I think we fixed this in 0.18.0, but double check and make sure we didn't fuck it up 😅

casey commented 7 months ago

Whoops, we definitely didn't fix this!

max-uxuy commented 6 months ago

What about pub const COMMIT_CONFIRMATIONS: u16 = 6; There are not found in any document or proposal, if the commit transaction and the reveal transaction in the same blockchain, how about it is?

raphjaph commented 6 months ago

https://docs.ordinals.com/runes/specification.html#etchings

To prevent front running an etching that has been broadcast but not mined, if a non-reserved rune name is being etched, the etching transaction must contain a valid commitment to the name being etched.

A commitment consists of a data push of the rune name, encoded as a little-endian integer with trailing zero bytes elided, present in an input witness tapscript where the output being spent has at least six confirmations.