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 usingser_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.