Thursday, September 11, 2025
HomeBitcoinp2pkh - Easy methods to embody arbitrary information when spending an UTXO...

p2pkh – Easy methods to embody arbitrary information when spending an UTXO whereas holding the transaction legitimate?

I wish to embody some random (for me it isn’t actually random 🙂) information when unlocking an UTXO.

I wish to hold the spending secured by a traditional signature.

At first, I thought of utilizing P2WPKH, however from what I perceive, the witness should include precisely two parts (the signature and the general public key). If there are extra, the transaction turns into invalid.

1.Am I appropriate?

Then I thought of utilizing a traditional P2PKH, the place within the scriptSig I may add my information first (e.g. a easy push of 20 bytes), earlier than the signature and the general public key.
This could protect safety, as a result of after script execution solely the top-level stack ingredient is checked, so my further information wouldn’t trigger any situation.

2.Am I appropriate?

Nevertheless, I additionally discovered that whereas that is positive from the consensus and safety perspective, coverage guidelines would forestall such a transaction from being relayed throughout the community because it has multiple ingredient left on stack.

3.Am I appropriate?

It is vitally necessary for me to incorporate extra information when spending funds, however I’m not positive how to do that. Any concepts? Maybe to make use of another transaction kind to realize this?

Any assistance is welcome — even solutions to solely one of many above questions.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments