Title: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on December 18, 2023, 04:15:37 PM https://publications.qedprotocol.com/bitide/p2tr-screenshot-md.png (https://www.youtube.com/watch?v=ixHVnvq4S7g) BitIDE - The Bitcoin TapScript IDE Quick Links >> Open BitIDE Web << (https://bitide.qedprotocol.com/) (*NEW*) Setup Local Testnet + Block Explorer + Deploy your first TapScript (https://www.youtube.com/watch?v=ixHVnvq4S7g) BTCitcoin Script on Steroids Custom OpCodes for Code Reuse Meta Programming and JavaScript Macros Symbol/Tag Based Stack Management Integrated Local Block Explorer + Local RegTest Testnet Developer First Full trace debugger with human readable symbol tagging Polyfills for disabled op codes Transpile to Bitcoin Mainnet compatible TapScript with the press of a button Install and start a fresh testnet environment with a single command Cross platform: Browser based and local docker versions Install and Start Local Environment (Includes Testnet, BitIDE and Block Explorer) Code: docker run -p 1337:1337 -it --rm qedprotocol/bitide:latest *NEW* Install and Start Local Environment for Elements/Liquid (Includes Elements 23.3.1 (https://github.com/ElementsProject/elements/tree/elements-23.2.1) Local Testnet, BitIDE and Block Explorer) Code: docker run -p 1337:1337 -it --rm qedprotocol/bitide-liquid:latest (Docker pull to update to the latest version) Watch the Pay to Script Path Tutorial https://publications.qedprotocol.com/bitide/p2tr-screenshot-md.png (https://www.youtube.com/watch?v=ixHVnvq4S7g) Watch the Getting Started Tutorial https://publications.qedprotocol.com/bitide/bitide_tut.png (https://www.youtube.com/watch?v=Mp3ldiz2KQ8) Release Notes Code:
More to come, would appreciate any feedback/feature requests! Hope this helps encorage more innovation within the framework of the features Bitcoin has already enabled and spur on debates for future BIPs. Title: Re: [Release] BitIDE - TapScript IDE with Macros, Scripting, Custom Opcodes & More Post by: cmpeq on December 19, 2023, 01:43:07 AM Just forgot :P, For the curious, here are the promised polyfills for OP_XOR, OP_OR and OP_AND:
OP_XOR_POLYFILL Code: b.OP_0().tag("result"); OP_OR_POLYFILL Code: var numBits = 31; OP_AND_POLYFILL Code: var numBits = 31; OP_NAND Code: var numBits = 31; Title: Re: [Release] BitIDE - TapScript IDE with Macros, Scripting, Custom Opcodes & More Post by: NotATether on December 19, 2023, 06:02:50 AM It looks good, but there doesn't seem to be a desktop version. If this is using a JS framework, you know, like React or Angular or Vue or like that, you can just slap Electron on it and you'll be good to go on all platforms.
Maybe you can add a feature where a the compiled script can run on testnet if you deposit a small amount of BTC for the transaction fee. You can make the outputs 0. Title: Re: [Release] BitIDE - TapScript IDE with Macros, Scripting, Custom Opcodes & More Post by: cmpeq on December 19, 2023, 12:47:28 PM It looks good, but there doesn't seem to be a desktop version. If this is using a JS framework, you know, like React or Angular or Vue or like that, you can just slap Electron on it and you'll be good to go on all platforms. Maybe you can add a feature where a the compiled script can run on testnet if you deposit a small amount of BTC for the transaction fee. You can make the outputs 0. Great idea! will definitely add an offline electron version in the next release. Also right now we are working on a 1-liner that spins up a clean regtest network in a docker container with funded wallets and automining so you don't have to mess around with faucets, but testnet integration also makes a lot of sense. Title: Re: [Release] BitIDE - TapScript IDE with Macros, Scripting, Custom Opcodes & More Post by: garlonicon on December 19, 2023, 08:55:49 PM Quote You can make the outputs 0. Not only that. You can also hide your scripts behind a TapScript, and then spend by key, if your TapScript will turn out to be unspendable or expensive.Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 06, 2024, 10:47:32 AM Hey all, added docker image for offline development, integration with local testnet (regtest), a block explorer and and a GUI that walks you through how to perform a pay to tapscript (script path) transaction (I saw a lot of people have been asking about this on the forum, so hope this helps).
Grab the new version and start a new local testnet with a one liner: Code: docker run -p 1337:1337 -it --rm qedprotocol/bitide:latest Also shot a quick tutorial video for anyone that wants to get started with TapScript: https://publications.qedprotocol.com/bitide/p2tr-screenshot-md.png (https://www.youtube.com/watch?v=ixHVnvq4S7g) Edit: If you want to use bitcoin-cli with your testnet, just change the docker command to: Code: docker run -p 1337:1337 -p 18443:18443 -it --rm qedprotocol/bitide:latest Title: Re: [Release] BitIDE - TapScript IDE with Macros, Scripting, Custom Opcodes & More Post by: cmpeq on January 09, 2024, 07:50:28 AM Quote You can make the outputs 0. Not only that. You can also hide your scripts behind a TapScript, and then spend by key, if your TapScript will turn out to be unspendable or expensive.Great idea, we will also added support for key paths in the next version! In the meantime, for development purposes it shouldn't be an issue if you are using the docker image with bundled regtest + explorer and use Fund via RPC (regtest btc is free ;)), as clicking the button first runs generatetoaddress to mine 50 btc to the default wallet, and then transfers 1 BTC to the P2TR address (see screenshot below). https://publications.qedprotocol.com/bitide/flow1.png Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: warpanomaly on January 15, 2024, 02:45:38 AM Is BitIDE open source?
Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 16, 2024, 12:59:25 PM Is BitIDE open source? Cleaning up the source and adding some tests, will be open sourced this week =) Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: warpanomaly on January 16, 2024, 07:11:26 PM Quote Cleaning up the source and adding some tests, will be open sourced this week =) Awesome! Thanks! Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: d3bt3 on January 17, 2024, 01:29:00 PM Is BitIDE open source? Cleaning up the source and adding some tests, will be open sourced this week =) Will appreciate the source. But is the real testnet version of this available? Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 17, 2024, 04:06:33 PM Is BitIDE open source? Cleaning up the source and adding some tests, will be open sourced this week =) Will appreciate the source. But is the real testnet version of this available? Yep! BitIDE works with regtest, testnet and mainnet. To fund and unlock a script UTXO on the official Bitcoin testnet, just chose "Testnet" in the tapscript executor window and follow the steps below: https://publications.qedprotocol.com/bitide/testnet-full.png Note that Fund via RPC only works with regtest (you can't just mint testnet tBTC at will), so for step two you need to either faucet the address with a testnet faucet or send from your testnet wallet before clicking "Check for UTXOs" Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 19, 2024, 01:51:33 AM I see this is not mobile friendly 😂 , but this is great to see people are actually developing something useful rather than trying to spam the network for more money. Just wanted to tell you, fantastic work, amazing and thank you. Hope you could add some ECC related functions to have things in one place. 🤭 No plans for a mobile version (don't code on your phone haha), but more features on the way, namely: 1. Export standalone bitcoinjs-lib code in the TapScript runner (so you can see how to perform all the steps programmatically as well) 2. Support for OP_CHECKSIG/other sig related stuff + basic wallet/key manager 3. Option to pay with keypath rather than script in the TapScript runner (currently we just use a "Nothing Up My Sleeve" point which no one knows the private key of) 4. Support for Liquid Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: vjudeu on January 19, 2024, 05:32:07 AM Quote currently we just use a "Nothing Up My Sleeve" point which no one knows the private key of You should not use that, unless it is strictly necessary. It is better to pick a public key, that is just N-of-N multisig of everyone involved. In this way, there is always a chance to spend by key (and make it cheaper) if everyone agrees.In general, Taproot addresses should be "always spendable by key, and sometimes spendable by key, and by TapScript". Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 21, 2024, 01:41:03 PM Quote currently we just use a "Nothing Up My Sleeve" point which no one knows the private key of You should not use that, unless it is strictly necessary. It is better to pick a public key, that is just N-of-N multisig of everyone involved. In this way, there is always a chance to spend by key (and make it cheaper) if everyone agrees.In general, Taproot addresses should be "always spendable by key, and sometimes spendable by key, and by TapScript". For situations where a multisig is appropriate ;) Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: ercewubam on January 21, 2024, 03:23:15 PM Quote For situations where a multisig is appropriate Could you give any example, where it is not?Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 21, 2024, 10:37:29 PM Quote For situations where a multisig is appropriate Could you give any example, where it is not?Let's say I want to crack a sha256 password hash (your own personal password and not someone else's, of course). If know the hash is 5bf01f36fa15d5ccf2dea7a53c777426d559a9a8d1384e58bc8d3dc423cd2f12, I could offer a reward in bitcoin for anyone who can provide the preimage to the password with the following script: Code: OP_SHA256 You can try it out if you like on testnet (the password is supersecretpassword) 2. Recursive Covenants (https://blog.blockstream.com/en-covenants-in-elements-alpha/#recursive-covenants) + Trustless peg-in/peg-out for layer 2s Imagine we have a layer 2 which posts a withdrawals tree of the chain to bitcoin, and we want to allow users to trustlessly withdraw their bitcoins from layer 2. When block producers submit a block they spend and existing block script which has two outputs: 1. an output to a withdrawal UTXO script which can be spent by the users who withdrew funds from layer 2 back to layer 1 in the most recent block (includes a withdrawal tree merkle root) 2. a new block UTXO for the next block (recurse) The withdrawal script can only be spent by spending a recursive covenant which includes a delta merkle proof proving the validity of the spend of one of the withdrawals and an additional recursive covenant that creates a new withdrawal script with the updated withdrawal tree root (the withdrawal made is set to the null value so you can't spend a withdrawal more than once). The locked BTC in the layer 2 block UTXO can only be sent to a script which publishes a new block (1 output) or a withdrawal script which allows users to withdraw a portion of the BTC and sends the rest to a new script with the updated merkle root (2 outputs). In our withdrawal script, we verify a merkle proof which links the previously submitted state root/withdrawals tree root with a spender: Code: <0x8fe1e5f7bc9333914565f011a63942d988c88b00547b35af859635b00cbbc64c> // old root, must be this value as enforced by the block UTXO covenant Now we just check the old and new roots from the inputs to make sure the match the computed ones (ie. proof that the withdrawal exists in the tree, and that the merkle tree with merkle root new root has all the same leaves as old tree, except for the leaf at the specified index that has just been spent (and has been nulled out): Code: /* Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: vjudeu on January 22, 2024, 05:48:43 AM Quote Password Recovery When it comes to any puzzles, there is for example this puzzle: https://bitcointalk.org/index.php?topic=5469657.0And then, people may think, that SHA-1 was used, to create them, and make TapScripts, unspendable by key: Code: 1) OP_SHA1 <3045ae6fc8422f64ed579528d38120eae12196d5> OP_EQUAL So, instead of using unspendable key-path, it can be just "multisig behind all interested parties". It is possible to start with a single key, just like the creator of the famous puzzle, where keys #120 and #125 are sweeped, but nobody knows, if those keys are really broken, or if the author just moved those funds. And if you have any kind of reward, then by using multisig, you can start with a single key, and then move those coins by key, to combine the same rewards into bigger coins. Which means, if Alice and Bob sent funds to some different keys, with the same attached TapScript, then they could move them to a multisig, and a TapScript. And that move may be more attractive to the puzzle solver, because having single coin is cheaper to move, than having thousands of small deposits (not to mention address reuse, which is a bad practice, and should be avoided). Quote Recursive Covenants + Trustless peg-in/peg-out for layer 2s If you have more than one person, behind some coin, then it may be possible, that all of them will be online. In that case, there is no reason to use expensive TapScript path, and reveal the whole covenant on-chain. The group, which wants to be detached, can just propose a withdrawal transaction, and collect all signatures from all parties, and then it will look the same, as if everything would be owned by a single user.To sum up: I cannot see a reason, why not to use multisig. If you are alone, then it gives you a chance to experiment with TapScript, without trapping your coins in unspendable paths. If there are at least two people (for example: Alice tells Bob that she will pay for Password Recovery), then, 2-of-2 multisig is applicable. If there are more than two people, then N-of-N multisig is applicable in a general case. And then, for example if Bob cannot provide the password, Alice can say: "well, you tried cracking it for 10 years, and you failed, it is now useless information for me, so I sweep my funds, you don't have to work longer on that". And if Bob agrees, then it is at least possible for Alice to get her funds back. But if it is behind TapScript-only, then it may be unspendable forever. Also, there are obvious mistakes possible, for example wrong endianness, and then, key-path can be used to fix those cases, instead of losing coins forever. Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 22, 2024, 05:10:02 PM Quote Password Recovery When it comes to any puzzles, there is for example this puzzle: https://bitcointalk.org/index.php?topic=5469657.0And then, people may think, that SHA-1 was used, to create them, and make TapScripts, unspendable by key: Code: 1) OP_SHA1 <3045ae6fc8422f64ed579528d38120eae12196d5> OP_EQUAL So, instead of using unspendable key-path, it can be just "multisig behind all interested parties". It is possible to start with a single key, just like the creator of the famous puzzle, where keys #120 and #125 are sweeped, but nobody knows, if those keys are really broken, or if the author just moved those funds. And if you have any kind of reward, then by using multisig, you can start with a single key, and then move those coins by key, to combine the same rewards into bigger coins. Which means, if Alice and Bob sent funds to some different keys, with the same attached TapScript, then they could move them to a multisig, and a TapScript. And that move may be more attractive to the puzzle solver, because having single coin is cheaper to move, than having thousands of small deposits (not to mention address reuse, which is a bad practice, and should be avoided). Quote Recursive Covenants + Trustless peg-in/peg-out for layer 2s If you have more than one person, behind some coin, then it may be possible, that all of them will be online. In that case, there is no reason to use expensive TapScript path, and reveal the whole covenant on-chain. The group, which wants to be detached, can just propose a withdrawal transaction, and collect all signatures from all parties, and then it will look the same, as if everything would be owned by a single user.To sum up: I cannot see a reason, why not to use multisig. If you are alone, then it gives you a chance to experiment with TapScript, without trapping your coins in unspendable paths. If there are at least two people (for example: Alice tells Bob that she will pay for Password Recovery), then, 2-of-2 multisig is applicable. If there are more than two people, then N-of-N multisig is applicable in a general case. And then, for example if Bob cannot provide the password, Alice can say: "well, you tried cracking it for 10 years, and you failed, it is now useless information for me, so I sweep my funds, you don't have to work longer on that". And if Bob agrees, then it is at least possible for Alice to get her funds back. But if it is behind TapScript-only, then it may be unspendable forever. Also, there are obvious mistakes possible, for example wrong endianness, and then, key-path can be used to fix those cases, instead of losing coins forever. So, instead of using unspendable key-path, it can be just "multisig behind all interested parties". Totally agree! I think the rule of thumb is: use a multisig if you know the interested parties ahead of time, otherwise use NUMS. For the example of the puzzle/hash cracking, one may have to spend a significant portion of time/compute to crack the hash, so if they original challenge holder can just transfer away the funds at will, it may be a disincentive to commit resources to the problem. In the case of the layer 2, I would push back, however. To be secure, the multisig should be controlled by the owners of layer 2 wrapped BTC so they can reclaim the BTC on Layer 1 back whenever they like. This is impossible if the layer 2 BTC is transferrable. Consider the following scenario: 3 bitcoin holders each bridge 10 BTC to layer 2, locking a total of 30 BTC in a multisig (lets call the set of keys in the multisig K), minting a total 30 l2BTC on the layer 2. Since the K should proportionally represent owners of l2BTC, they should each control a key in the multisig. The 3 original users then purchase NFTs on the L2 with their l2BTC on an L2-DEX, spending all 30 BTC. Now the original set K does not represent the token holders and is instead controlled by a group which owns no l2BTC. Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on January 30, 2024, 10:39:09 AM Just released BitIDE 0.7.0 which includes bug fixes and support for Liquid BTC (https://liquid.net/) + a new docker image which includes a local Elements 23.2.1 (https://github.com/ElementsProject/elements/releases/tag/elements-23.2.1) regtest testnet.
To upgrade to the latest version of BitIDE, run: Code: docker pull qedprotocol/bitide:latest To start a Liquid/Elements regtest + install the Liquid compatible version of BitIDE, run: Code: docker pull qedprotocol/bitide-liquid:latest You can also change the vm mode in the web version of BitIDE by selecting "Liquid" in the new IDE Settings tab: https://publications.qedprotocol.com/bitide/liquid-setup.png Currently supported Elements/Liquid only op codes (https://github.com/ElementsProject/elements/blob/master/doc/tapscript_opcodes.md):
More will be added soon! Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: kesibo on February 11, 2024, 09:15:37 AM Great this IDE, I was looking for such a program 5 years ago, but could not find it.
I played around with the IDE and it works beautifully. Especially, the 'show all frames' is super helpful. My question: I want to us HTLC like contracts, and want to use Opcodes "OP_CHECKLOCKTIMEVERIFY" and "OP_CHECKSEQUENCEVERIFY", but I couldn't get these to work. I get the following error: Code: [Error: Error: RuntimeError: Error: missing op code OP_CHECKSEQUENCEVERIFY in trace builder] Furthermore, It would be great to have some more examples such as to create 2 out of 3 lock script etc etc. Thanks again for this great tool! Title: Re: BitIDE - TapScript IDE with Local Testnet, Explorer and Custom Op Codes (P2TR) Post by: cmpeq on February 11, 2024, 06:03:44 PM Great this IDE, I was looking for such a program 5 years ago, but could not find it. I played around with the IDE and it works beautifully. Especially, the 'show all frames' is super helpful. My question: I want to us HTLC like contracts, and want to use Opcodes "OP_CHECKLOCKTIMEVERIFY" and "OP_CHECKSEQUENCEVERIFY", but I couldn't get these to work. I get the following error: Code: [Error: Error: RuntimeError: Error: missing op code OP_CHECKSEQUENCEVERIFY in trace builder] Furthermore, It would be great to have some more examples such as to create 2 out of 3 lock script etc etc. Thanks again for this great tool! Hey there! We just released support for OP_CHECKSIG and added a wallet/key manager to generate script signatures in v0.8.6, and v0.9.0 should be out later this week with support for OP_CHECKMULTISIG/OP_CHECKMULTISIGVERIFY/OP_CHECKSIGADD/OP_CHECKLOCKTIMEVERIFY/OP_CHECKSEQUENCEVERIFY. For those interested in test driving OP_CHECKSIG, you can check out this step-by-step video tutorial (https://www.youtube.com/watch?v=0u3UaWb03qA) and update BitIDE as shown below: Update BitIDE Bitcoin Core Edition: Code: docker pull qedprotocol/bitide:latest Update BitIDE Liquid Edition: Code: docker pull qedprotocol/bitide-liquid:latest Appreciate the feedback and apologize for the incomplete VM implementation, we are closing in on 100% coverage, but still have a few more ops to implement. |