bips icon indicating copy to clipboard operation
bips copied to clipboard

BIP 345: Fix OP_VAULT_RECOVER specification for the recovery-sPK-hash

Open shesek opened this issue 8 months ago • 2 comments

The recovery scriptPubKey needs to be prefixed with its CompactSize-encoded length when computing the sPK hash.

I verified this by:

  • Checking the functional tests, where recovery_spk_tagged_hash() is implemented using ser_string() which adds the CompactSize-encoded length prefix
  • Using an implementation in Minsc to construct a transaction spending using OP_VAULT_RECOVER and broadcasting it to mutinynet (see line 2 for the recovery sPK hash computation)
  • Checking with @jamesob

Alternatively, the implementation could be amended to match the current specification and drop the length prefix. Since this is committing to a single element, the length isn't really necessary.

shesek avatar Mar 22 '25 22:03 shesek

cc @jamesob for feedback

jonatack avatar Mar 24 '25 18:03 jonatack

Given that BIP 345 was withdrawn: @jamesob and @shesek, Is this pull request still relevant or should it be closed?

murchandamus avatar Jun 20 '25 22:06 murchandamus

Looks good to me - doesn't hurt to keep updated.

jamesob avatar Aug 08 '25 18:08 jamesob