Bitcoin Forum
May 03, 2024, 12:27:11 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I'm looking for an example of code or a tutorial that implements tapscript  (Read 107 times)
warpanomaly (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 25


View Profile
January 15, 2024, 12:56:13 AM
 #1

I'm looking to create a Bitcoin tapscript transaction, but I can't find an example or a tutorial that demonstrates how to do this. When I was building on Ethereum it was easy because there's a lot of tutorials about how to create a custom ERC-20 or ERC-721. I understand that comparing Ethereum to Bitcoin is like comparing apples to oranges. Bitcoin is designed to be a store of value while Ethereum is a platform designed to run code.

Still though... I want to practice writing tapscript transactions on Bitcoin. Can someone provide a code example or a tutorial about how to actually create a tapscript transaction?

Just to be clear, when I say a tapscript transaction, I mean constructing a UTXO that contains a script spending path. That means a taproot transaction that contains a merkle root with a taptree where spending from this UTXO means solving a logic condition in one of the tapleafs.
In order to achieve higher forum ranks, you need both activity points and merit points.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Ambatman
Full Member
***
Offline Offline

Activity: 308
Merit: 143


★Bitvest.io★ Play Plinko or Invest!


View Profile WWW
January 15, 2024, 08:13:53 AM
Merited by warpanomaly (2)
 #2

Bitcoin is designed to be a store of value while Ethereum is a platform designed to run code.

Bitcoin according to the original white paper wasn't created as a store of value but as a peer to peer electronic cash. Store of value was like an add on explored later on after its adoption.

About your question, not really into the technicals but the various BIP in bitcoin has peeked my interest as of late.

https://www.npmjs.com/package/@cmdcode/tapscript
Check the above link out
Tagged in a post in Github

This can also serve as a supplement but focused mainly on PSBTs https://lightning.engineering/posts/2023-06-14-virtual-psbt/

warpanomaly (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 25


View Profile
January 16, 2024, 09:33:34 AM
 #3

Quote

This was very helpful thanks
cmpeq
Copper Member
Jr. Member
*
Offline Offline

Activity: 33
Merit: 152


View Profile WWW
January 18, 2024, 04:31:29 PM
 #4

I'm looking to create a Bitcoin tapscript transaction, but I can't find an example or a tutorial that demonstrates how to do this. When I was building on Ethereum it was easy because there's a lot of tutorials about how to create a custom ERC-20 or ERC-721. I understand that comparing Ethereum to Bitcoin is like comparing apples to oranges. Bitcoin is designed to be a store of value while Ethereum is a platform designed to run code.

Still though... I want to practice writing tapscript transactions on Bitcoin. Can someone provide a code example or a tutorial about how to actually create a tapscript transaction?

Just to be clear, when I say a tapscript transaction, I mean constructing a UTXO that contains a script spending path. That means a taproot transaction that contains a merkle root with a taptree where spending from this UTXO means solving a logic condition in one of the tapleafs.

I'm eager to delve into Bitcoin tapscript transactions, but I'm struggling to find an example or tutorial guiding me through the process. When working with Ethereum, crafting custom ERC-20 or ERC-721 tokens was straightforward due to the abundance of tutorials available. I recognize the inherent differences between Bitcoin and Ethereum—Bitcoin as a store of value and Ethereum as a code-running platform.

Nevertheless, my curiosity persists, and I'm determined to practice tapscript transactions on Bitcoin. Could someone kindly share a code example or direct me to a tutorial illustrating the creation of a tapscript transaction? To clarify, I'm specifically interested in constructing a UTXO with a script spending path—a taproot transaction featuring a merkle root with a taptree. The goal is to enable spending from this UTXO by satisfying a logic condition within one of the tapleafs.
https://www.aoxapps.com/mobile-app-development-company


Check out https://www.youtube.com/watch?v=ixHVnvq4S7g, this goes step by step through the full flow from 0 to p2tr via script spending path (also helps you setup a local testnet + block explorer).


founder of QED
find me on twitter @cmpeq
warpanomaly (OP)
Newbie
*
Offline Offline

Activity: 19
Merit: 25


View Profile
January 18, 2024, 09:52:52 PM
 #5

Quote
Check out https://www.youtube.com/watch?v=ixHVnvq4S7g, this goes step by step through the full flow from 0 to p2tr via script spending path (also helps you setup a local testnet + block explorer).

I'm doing a deep dive into this tool. It looks awesome so far. Thanks for sharing!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!