Author

Topic: [Tutorial] How to use OP_CHECKSIG + Taproot to spend 1-of-n puzzles (Read 94 times)

newbie
Activity: 1
Merit: 0
I noticed that recently there have been some questions about properly constructing signatures for OP_CHECKSIG in P2TR, so decided to make a video for the curious.

This technique can be useful for creating puzzle/other challenges (pay to ZKP =D) that cannot be frontran by folks monitoring the mempool (one unique challenge per public key/tapscript path).

https://publications.qedprotocol.com/bitide/op_checksig_tutorial.png


Scripts from the video

Setup
Code:
docker pull qedprotocol/bitide:latest
docker run -p 1337:1337 -it --rm qedprotocol/bitide:latest


user_1_lock.basm
Code:
/*
note that the dummy signature "?2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093"
can be used to test OP_CHECKSIG in the editor, but must be removed in the tapscript runner witness input before unlocking the UTXO
*/

<"?2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093">
<"some other secret value">

END_EXAMPLE_WITNESS

OP_HASH160
<0xda70d9c91368cc32d8bdaf0dd82f53c07272fd17>
OP_EQUALVERIFY

<0x2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093> // public key 1
OP_CHECKSIG


user_2_lock.basm
Code:
// to make a dummy signature for any public key just push a string to the stack containing a question mark followed by the hex encoded public key (x only/last 32 bytes)
<"?bee908511ef6d1c5d99ca33ea0db1fbbf313a5c3c08471702595eae888ff012b">
<"super secret value">
END_EXAMPLE_WITNESS
OP_HASH160

<0x32cac4959b6bc4aad4bc65fc7b4eab19506359b2>
OP_EQUALVERIFY

<0xbee908511ef6d1c5d99ca33ea0db1fbbf313a5c3c08471702595eae888ff012b> // public key 2
OP_CHECKSIG


Would love any feedback on other tutorials anyone may want to see or how things could be made easier to bring in newer bitcoin devs (maybe a button to generate/download a standalone js project that automates the tx with bitcoinjs?).

Hello,

I see that you are interested in bitcoin development and have shared some scripts for creating signatures for OP_CHECKSIG in P2TR. That’s very impressive and informative.
I found some relevant resources that might be useful for you or other bitcoin enthusiasts:

* Bitcoin Forum https://bitcointalk.org/index.php - Index This is a forum where you can discuss various aspects of bitcoin, such as development, technical support, mining, trading, speculation, and more. You can also find subforums for different languages and regions.
* Alt chains and atomic transfers - Bitcoin Forum This is a thread where a user named TierNolan explains how to conduct an atomic exchange between two different cryptocurrencies using a script that verifies the tokens in a merkle tree and scans the alt-chain headers https://bitcointalksearch.org/topic/alt-chains-and-atomic-transfers-193281.
* Bitcoin Technical Support This is a board where you can ask for help with any technical issues or problems related to bitcoin, such as installation, synchronization, transactions, encryption, backup, recovery, etc https://bitcointalk.org/index.php?board=4.0.
* Bitcoin puzzle transaction ~32 BTC prize to who solves it This is a challenge where a user named 1FLAMEN6 has hidden a private key in a complex puzzle transaction that contains ~32 BTC. The puzzle involves finding the correct inputs and outputs, decoding the encrypted messages, and cracking the password https://bitcointalk.org/index.php?topic=1306983.4080/DogNeedsBest/index.php?topic=1306983.4080


I hope these links are useful for you. If you have any other questions or feedback, please let me know. I’m always happy to learn and improve.

Best regard,
BookerE1
copper member
Activity: 33
Merit: 152
I noticed that recently there have been some questions about properly constructing signatures for OP_CHECKSIG in P2TR, so decided to make a video for the curious.

This technique can be useful for creating puzzle/other challenges (pay to ZKP =D) that cannot be frontran by folks monitoring the mempool (one unique challenge per public key/tapscript path).




Scripts from the video

Setup
Code:
docker pull qedprotocol/bitide:latest
docker run -p 1337:1337 -it --rm qedprotocol/bitide:latest


user_1_lock.basm
Code:
/*
note that the dummy signature "?2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093"
can be used to test OP_CHECKSIG in the editor, but must be removed in the tapscript runner witness input before unlocking the UTXO
*/

<"?2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093">
<"some other secret value">

END_EXAMPLE_WITNESS

OP_HASH160
<0xda70d9c91368cc32d8bdaf0dd82f53c07272fd17>
OP_EQUALVERIFY

<0x2742ce32de496f3d51ddd8b57cee513e982ef66adb51324343a9ec2516281093> // public key 1
OP_CHECKSIG


user_2_lock.basm
Code:
// to make a dummy signature for any public key just push a string to the stack containing a question mark followed by the hex encoded public key (x only/last 32 bytes)
<"?bee908511ef6d1c5d99ca33ea0db1fbbf313a5c3c08471702595eae888ff012b">
<"super secret value">
END_EXAMPLE_WITNESS
OP_HASH160

<0x32cac4959b6bc4aad4bc65fc7b4eab19506359b2>
OP_EQUALVERIFY

<0xbee908511ef6d1c5d99ca33ea0db1fbbf313a5c3c08471702595eae888ff012b> // public key 2
OP_CHECKSIG


Would love any feedback on other tutorials anyone may want to see or how things could be made easier to bring in newer bitcoin devs (maybe a button to generate/download a standalone js project that automates the tx with bitcoinjs?).
Jump to: