Bitcoin Forum
May 14, 2024, 10:52:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Bitcoin development tapscript C# seemingly unsolvable task on: May 01, 2024, 04:55:17 AM
Hi guys, I made this post on Bitcointalk a while ago:


Quote
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.
2  Bitcoin / Development & Technical Discussion / I need help embedding a message into a Tapscript spend on: April 12, 2024, 04:39:36 PM
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.
3  Bitcoin / Development & Technical Discussion / How can taproot transactions manage to store so much data? on: April 04, 2024, 10:35:29 AM
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?
4  Bitcoin / Development & Technical Discussion / I'm looking for an example of code or a tutorial that implements tapscript on: January 15, 2024, 12:56:13 AM
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.
5  Bitcoin / Development & Technical Discussion / I'm trying to understand the exact mechanism of a UTXO spend on: January 07, 2024, 12:12:06 AM
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/titAohe

Clearly 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?
6  Bitcoin / Development & Technical Discussion / Why can't I find any resources on how to mint ordinal NFTs via code? on: January 01, 2024, 10:13:45 AM
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: 

Code:
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?
7  Bitcoin / Development & Technical Discussion / I'm Trying to Make A Script That Spends BTC from A Taproot (bech32m) Address on: December 28, 2023, 08:55:12 PM
I want to build an app that uses taproot addresses in C#. The problem is that I can't find any good tutorials on how to spend BTC from a taproot address in C#. I want to use NBitcoin https://github.com/MetacoSA/NBitcoin, and I am trying to build a simple C# command line app that spends btc from an address as a mvp of taproot spending functionality. I know that NBitcoin has the capacity to spend BTC from a taproot address because this exists in the tests, https://github.com/MetacoSA/NBitcoin/blob/40ca72b3e4da8baf58e6c06801cd4b0e66cb8b59/NBitcoin.Tests/sample_tests.cs#L15. So how can I build the simplest possible send btc from a taproot address console app in C#? Has anyone here ever done this?
8  Other / Meta / Do Users Own Their Posts? Is There a Compelled License for User Content? on: December 23, 2023, 09:20:16 AM
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.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!