Issues with Bitcoin Inscription Using C#

6 replies 227 views
fox404Member
Posts: 4 · Reputation: 42
#1Feb 7, 2020, 06:42 PM
Hey folks, I posted about this a bit ago and thought it’d be easy... but boy was I wrong. Trying to make a Bitcoin inscription in C#. The libraries out there do it for Javascript and some others, but I can't find any for C#. I’ve got a script that’s close, but I keep hitting a signature error. And yeah, I get it, inscriptions are kinda controversial, but I'm just trying to build an app with this.
5 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#2Feb 7, 2020, 09:51 PM
Since you just need to include a SHA-256 hash, you should use OP_RETURN. I haven't checked, but you’d think there’s a C# library for creating Bitcoin TX with OP_RETURN by now. It’s been around long enough.
3 Reply Quote Share
fox404Member
Posts: 4 · Reputation: 42
#3Feb 8, 2020, 01:42 AM
I know about OP_RETURN, but it won't work for my project. My app needs the string to be read with an ordinal envelope. Instead of "Hello world!", I'll use the SHA256 hash. I’m using an ordinal block explorer and giving the envelope an identifier "ord" so the hash shows up there for my app to read. But this isn’t an ordinal in the usual sense, just FYI.
1 Reply Quote Share
mr_apeNewbie
Posts: 401 · Reputation: 35
#4Feb 10, 2020, 01:27 AM
Look, the Bitcoin blockchain isn’t a data storage solution. It’s a payment system, and stuffing it with data is kinda abusive. Even if it’s just a tiny bit of info. You really should just use OP_RETURN or consider altcoins made for storing data.
2 Reply Quote Share
0xNodeMember
Posts: 671 · Reputation: 80
#5Feb 10, 2020, 06:08 AM
Have you checked if your functions for creating transactions work with other types? Like, is it just the TapScript code messing things up?
0 Reply Quote Share
fox404Member
Posts: 4 · Reputation: 42
#6Feb 10, 2020, 09:39 AM
Yeah, I actually have a more complex version for the script. It creates the inscription address, I send some BTC to it, then the script uses that UTXO. The JS script works great, but the C# one throws a signature error when I try to spend from the newly created address path. Spending along the address keypath works in C#, but not along the script keypath. Comparing the outputs from both scripts, something's off.
3 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#7Feb 10, 2020, 01:31 PM
And a regular block explorer can show OP_RETURN data. If your app gets popular, it might affect Bitcoin users. I’m also curious why you didn’t just go with an email or phone number if your app’s centralized.
1 Reply Quote Share

Related topics