bips icon indicating copy to clipboard operation
bips copied to clipboard

BIP346: OP_TXHASH and OP_CHECKTXHASHVERIFY

Open stevenroose opened this issue 2 years ago • 9 comments

Semantic changes

I thought it might be valuable to keep track of actual semantic changes being made since the initial out-of-draft version.

  • 2023-12-19: Added relative indices for individual mode.

Implementations

  • A proposed implementation for Bitcoin Core is available here: https://github.com/bitcoin/bitcoin/pull/29050
  • A proposed implementation for rust-bitcoin is available here: https://github.com/rust-bitcoin/rust-bitcoin/pull/2275

stevenroose avatar Sep 30 '23 11:09 stevenroose

Alternatively, but slightly even more complicating the cases, since the first two fields (version, locktime), are not very valuable without anything else (especially since we have OP_CLTV), we could introduce four special-cased bytes to mimick other popular SIGHASH modes: 0x00, 0x01, 0x02 and 0x03. Though locktime might be useful with OP_TX at some point. So I would argue against that. Mimicking "regular" sighashes isn't super useful in the first place because any system that expects to use regular sighashes can use current regular schnorr keys.

stevenroose avatar Oct 23 '23 16:10 stevenroose

I just pushed an updated version of this BIP. It has a reference implementation that produces test vectors that are tested against an implementation for Bitcoin Core and for rust-bitcoin.

I think it should be ready for review. I have one small last TODO in the specification related to txfs malleability.

stevenroose avatar Dec 11 '23 08:12 stevenroose

Assigned BIP 346.

Roasbeef avatar Apr 24 '24 17:04 Roasbeef

Hey @stevenroose, this pull request has had unaddressed review for over six months. Are you still working on this? If not, is there someone else that wants to pick this project up?

murchandamus avatar Nov 14 '24 20:11 murchandamus

Hey @stevenroose, this pull request has had unaddressed review for over six months. Are you still working on this? If not, is there someone else that wants to pick this project up?

pinging @stevenroose

jonatack avatar Dec 17 '24 22:12 jonatack

Hey all, sorry for the long delay. I addressed some of the above comments, and also made some changes to the BIP, together with @reardencode. Changes are the following:

  • slightly modified the TEMPLATE special case to more correctly be equivalent to CTV
  • removed the 0x00 ALL special case, instead
  • add a special 1-byte version of the TxFieldSelector, that maps directly into a full TxFieldSelector
    • this 1-byte txfs can directly emulate APO, APOAS and all currently existing sighashes, as outlined in the bip text
  • added wording for the bip to be an upgrade path of an existing CTV deployment

stevenroose avatar Jan 14 '25 15:01 stevenroose

@stevenroose mind updating this draft per the review feedback (thanks!)

jonatack avatar Mar 12 '25 21:03 jonatack

Hey @stevenroose, this PR has had unaddressed review for over five months. The document seems close to ready for being merged in Draft status. Could you provide an update on what you expect the next steps to be here? Are you still planning to finish this? Would you like someone else to help?

murchandamus avatar Jun 20 '25 21:06 murchandamus

Hi @stevenroose, are you still planning to update/finish this BIP draft? Would it be worth bringing in someone to help?

jonatack avatar Aug 19 '25 16:08 jonatack