Show Posts
|
Pages: [1]
|
Have you verified that your transaction creation functions are working fine for other types of transactions and that it is just the TapScript code that's causing errors? Yeah I have a more complex version of each script that creates the inscription address, I send a BTC transaction to that address, then the script spends the UTXO that I sent the address. The Javascript scripts works perfectly and creates an inscription when I spend along the script path of the freshly created address. The C# script fails with a signature error when I try to spend from the script path of the freshly created address. My C# script works fine spending along the address keypath, but not the script keypath. Looking at the output transactions from the Javacript script and C# script, I've narrowed it down to the the tapscript not being created correctly in the C# script.
|
|
|
Btw, I know that creating Bitcoin inscriptions or anything that could be considered similar to an ordinal or BRC-20 is somewhat controversial but that's not the goal here. I want to create an inscription to build an app that requires a TINY AMOUNT of "hard" storage stored in the form of an inscription. It's SUPER TINY (literally the size of a sha-256 hash) and not going to clog up Bitcoin but I just can't find anyone that can help me fix the bug in my script. Does anyone know how to make by C# script work like my Javascript script does?
Since you only want to include output of SHA-256 hash (which have size 256-bit or 32-byte), you better use OP_RETURN. I didn't do any research, but i expect there should be C# library which let you create Bitcoin TX with OP_RETURN support since OP_RETURN has been around for 10+ years. I already know about OP_RETURN, but unfortunately I can't use it for this project. The app requires the string to be read with the ordinal envelope aka: OP_FALSE OP_IF OP_PUSH "ord" OP_PUSH 1 OP_PUSH "text/plain;charset=utf-8" OP_PUSH 0 OP_PUSH "Hello, world!" OP_ENDIF But obviously instead of "Hello world!", it will be the SHA256 hash. I'm taking advantage of an ordinal block explorer to by giving the envelope the ordinal identifier "ord" so the SHA256 hash is picked up on the ordinal block explorer where my app can read the hash. Even though I am using the ordinal envelope and using an ordinal block explorer to read the data, this is not an ordinal in a traditional sense. Every user on my app will write 1 ordinal as a registering function for my app. It will not clog up the bitcoin blockchain and will not spam the bitcoin network. Gas fees will not go up because of my app, don't worry. So does anybody know how to fix my C# script so it works like my Javascript script does?
|
|
|
Hi guys, I made this post on Bitcointalk a while ago: I have a script that works perfectly in creating an inscription taproot address with Javascript https://gist.github.com/ChristianOConnor/fa07462990a74606f486f97031783e50. I committed the private key and inscription text to the code. There's nothing in the wallet so it shouldn't be a security problem. The address outputted by the script is tb1pzr0236kw9vnavfl6zjk4xvfsvptfwq2202newug2se5tsg2fmrhsa4hv7z. Again, I've tested the javascript code including spending an inscription output and it works perfectly. I unsuccessfully tried porting the above script to C#. It doesn't produce the correct address. This is the C# script https://gist.github.com/ChristianOConnor/2399a864f38666a2a3305b9ad7d374d1 preloaded with the same private key and inscription string. It incorrectly produces this address: tb1p90cf5jsmvv2cwu7wq2k60pewtpu5xvlfypxwjeag4aq9yhaccgks68fc8j. Can anyone fix my C# script so that it produces the correct address aka tb1pzr0236kw9vnavfl6zjk4xvfsvptfwq2202newug2se5tsg2fmrhsa4hv7z. This would be unpaid, but if you can fix the C# script I'll open source it and MIT license the code. P.S. Could you please perpetually MIT license your fix for the C# script. I thought it was a going to be a simple task but OMG I was wrong. I'm trying to create a Bitcoin inscription with C#. I've found libraries that can do this in Javascript and a few other languages but non in C#. I can't find an example. I made a script that ALMOST does this but I get a signature error. Btw, I know that creating Bitcoin inscriptions or anything that could be considered similar to an ordinal or BRC-20 is somewhat controversial but that's not the goal here. I want to create an inscription to build an app that requires a TINY AMOUNT of "hard" storage stored in the form of an inscription. It's SUPER TINY (literally the size of a sha-256 hash) and not going to clog up Bitcoin but I just can't find anyone that can help me fix the bug in my script. Does anyone know how to make by C# script work like my Javascript script does? And I don't need open time stamps. This project is different.
|
|
|
I have a script that works perfectly in creating an inscription taproot address with Javascript https://gist.github.com/ChristianOConnor/fa07462990a74606f486f97031783e50. I committed the private key and inscription text to the code. There's nothing in the wallet so it shouldn't be a security problem. The address outputted by the script is tb1pzr0236kw9vnavfl6zjk4xvfsvptfwq2202newug2se5tsg2fmrhsa4hv7z. Again, I've tested the javascript code including spending an inscription output and it works perfectly. I unsuccessfully tried porting the above script to C#. It doesn't produce the correct address. This is the C# script https://gist.github.com/ChristianOConnor/2399a864f38666a2a3305b9ad7d374d1 preloaded with the same private key and inscription string. It incorrectly produces this address: tb1p90cf5jsmvv2cwu7wq2k60pewtpu5xvlfypxwjeag4aq9yhaccgks68fc8j. Can anyone fix my C# script so that it produces the correct address aka tb1pzr0236kw9vnavfl6zjk4xvfsvptfwq2202newug2se5tsg2fmrhsa4hv7z. This would be unpaid, but if you can fix the C# script I'll open source it and MIT license the code. P.S. Could you please perpetually MIT license your fix for the C# script.
|
|
|
They do. They wrap arbitrary data in a tapscript and inject it in the witness part of the transaction. But I thought tapscripts only stored the merkle root on chain. Each one of the leafs gets collapsed down to a single hash (the merkle root) and that's the only thing that gets committed to the chain. Therefore, if you have a any data longer than a hash, it will vanish into the merkle root. My above explanation could be wrong so please correct me if it's wrong. Is that why you have to spend it in order to get the ordinal on chain? Does the committed ordinal data only exist in the proof that you provide?
|
|
|
So, to sum up, there are many ways to make the whole system secure, without pushing everything on-chain. But users just decided to put their data anyway, even if there is no need to do so. Thank you very much for your answer. I think I'm starting to wrap my head around this better... So when someone makes an ordinal they are not using tapscript right? They are simply writing Opcodes into the transaction just like you would with a non-taproot transaction? If I did a typical P2PKH transaction I would put "scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG" as my locking script, but If I wanted to do an ordinal I would make my locking script "scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG OP_FALSE OP_IF OP_PUSH "ord" OP_PUSH 1 OP_PUSH "text/plain;charset=utf-8" OP_PUSH 0 OP_PUSH "Hello, world!" OP_ENDIF" ? Does this mean that I could do an ordinal in a non-taproot address bitcoin transaction? So I could mint an ordinal with a P2PKH address?
|
|
|
I don't quite understand how ordinals are able to store so much data on chain. I know about the ordinals envelope.
OP_FALSE OP_IF OP_PUSH "ord" OP_PUSH 1 OP_PUSH "text/plain;charset=utf-8" OP_PUSH 0 OP_PUSH "Hello, world!" OP_ENDIF
According to the ordinals handbook, in this example, the text "Hello, world!" is stored on chain. But I thought that the taproot upgrade simply enables people to tweak the public key to embed a merkle root on chain by tweaking the public key to create a modified address. Even then, the merkle root isn't actually stored on chain. You just have to know it to spend coins from that address right?
I know my understanding is wrong because if all you needed to know to spend coins from the script path was the merkle root you wouldn't need to know the hash of any of the leaves. So can you guys fill in the gaps in my understanding?
I know that bitcoin transactions have some code for scripting in the actual hexadecimal transaction. For example a simple locking script in a bitcoin transaction output looks like this "scriptPubKey": "OP_DUP OP_HASH160 HASH_OF_PUBKEY_IN_HEX OP_EQUALVERIFY OP_CHECKSIG" so to spend that transaction whoever has the private key of the address in the UTXO provides an unlocking script consisting of the signature and public key. But this is just a little bit of data that bitcoin transactions store, how does taproot allow for such larger amounts of data to be stored?
|
|
|
I'm doing a deep dive into this tool. It looks awesome so far. Thanks for sharing!
|
|
|
Cleaning up the source and adding some tests, will be open sourced this week =) Awesome! Thanks!
|
|
|
This was very helpful thanks
|
|
|
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.
|
|
|
My understanding of a bitcoin transaction is as follows. Each UTXO (that's not a null value UTXO like an OP_RETURN), has a value, scriptPubKey (hereafter referred to as a "locking script"), and index (hereafter referred to as "n"). In order to spend a UTXO, you have have to supply an unlocking script which contains a signature from the address possessing the UTXO (this proves that the spender actually has the private key for the address), and the UTXO owner's public key so the signature can be verified. I made this diagram to show what I believe a bitcoin transaction spend to look like: https://imgur.com/a/titAoheClearly I don't grasp the entire structure of a BTC transaction as indicated by the fact that I put several "IDK"s in the diagram. Can someone fill in the gaps in my knowledge?
|
|
|
Nice! Thanks for the resources! I will dig into this.
|
|
|
See? It is valid, and instead of 1MejoVXRvsmwyDpTpkw3VJ82NsjjT8SyEw mainnet address, you have n2Ah6YcQjuDCkLJ5YKuRKDLMEsLSPhKwWQ regtest address. And because a lot of altcoins just copy-pasted Bitcoin code, you can migrate their coinbase transactions as well. Fascinating... I'm surprised that there's away around storing the entire blockchain history. Thanks for the post.
|
|
|
This is true here and now, but in the future, it can be changed. Because each time when something is sent as fees, the new coinbase transaction starts a new "chain of signatures". Which means, if you want to migrate transactions from one chain to another, then you have to follow signatures only to the nearest coinbase transaction. Because then, it could be made from original fees, or from any other fees, which means, it may be possible in the future to discard the chain of signatures, after the nearest coinbase transaction, if Ordinals or other abuse will force full node operators to do so, and to optimize some things in some future model (for example UTXO-based model). Are you sure about this? I think the mining nodes would still have to keep an entire transaction history. Nodes that sync from the genesis block need every block to calculate/verify the hashes of every block leading up to the latest block. This requires at least some nodes to have every single block. This means that there can never be zero seeders for the entire bitcoin blockchain. Please correct me if I'm wrong. P.S. I looked into commitment signatures and I think this would be a great replacement for ordinals in the application that I plan on building.
|
|
|
I have spent a few days now looking into how to mint ordinal NFTs. I am a hobbyist developer so I consider myself pretty tech literate and ordinal NFTs are NOT user friendly lol. What's even more concerning is that ordinal services never provide a code example. They usually make you upload an image or piece of text to a webpage, pay an invoice QR code with the lightning network, wait (a long long time), and eventually receive an ordinal NFT to a btc taproot address. This doesn't make sense. Why can't I find a script on Github and do this myself? Doesn't minting an ordinal NFT require the simple construction of an envelope transaction like: OP_FALSE OP_IF OP_PUSH "ord" OP_PUSH 1 OP_PUSH "text/plain;charset=utf-8" OP_PUSH 0 OP_PUSH "Hello, world!" OP_ENDIF Assigning 1 satoshi to the output, and running the command? Why has no one written out a self contained script that mints ordinal NFTs?
|
|
|
I am new to this forum. Before I start sharing code and stuff like that, if I post something (and am the original author), do I still own it? And am I still free to license that content how I choose? I ask this because I've heard of forums where the terms and conditions contains something about all posts being CC-BY-SA or GPL etc... No offense to those licenses, but personally I'm not a fan of copyleft licenses. I prefer the MIT license for open source code. To summarize... Do us forum users own the code we post on " https://bitcointalk.org" and if so, are we compelled to license our posts under a specific license like CC-BY-SA or GPL? Please provide a source if you can.
|
|
|
|