bitauth / bitauth-ide

an online IDE for bitcoin (cash) contracts
https://ide.bitauth.com
MIT License
83 stars 18 forks source link

BTC Support? #28

Open bitjson opened 4 years ago

bitjson commented 4 years ago

If anyone is interested in using Bitauth IDE to develop BTC authentication templates, please comment here.

The application is architected to make switching between VMs possible, it just requires a bit of development work to activate.

cernael commented 4 years ago

Yes please. I'm currently trying to sketch out a multisig scheme for BTC, and while I probably won't end up becoming too exotic, it would be good to be able to easily verify that I've not accidentally gotten dependent on a BCH-only quirk. :-)

qertoip commented 4 years ago

I would also very much welcome BTC support. Your IDE is great!

as1ndu commented 4 years ago

Hi everyone. What exactly needs to be done? Is there a comprehensive list on what’s pending?

bitjson commented 4 years ago

Hey @as1ndu – I'd love to take pull requests enabling BTC. The biggest challenge is getting the BTC virtual machine implemented in bitcoin-ts. Implementing the virtual machine in bitcoin-ts allows us to step through and examine the evaluation of a program (see this blog post for an example of usage on BCH). It also provides meaningful error messages and other helpful information that VM implementations used in full nodes don't typically offer.

Once the BTC virtual machine is implemented in bitcoin-ts, adding BTC support to the IDE should be quite easy. (The IDE is designed to allow drop-in support for any VM implementation which supports the bitcoin-ts VM interface.)

A good part of the BTC VM is already implemented, there are just a few major components which aren't implemented:

So we're actually quite close to full BTC support, it's just the last 10% that needs to be completed before we can say we have a "correct" implementation. Generally, as long as you're not doing unusual things (like using the deprecated signing algorithm), you can do development in the IDE against the BCH VM (without using the new opcodes added by BCH), and your scripts will work fine on BTC.

You can see how the BCH VM is implemented in this directory. As you dig around, you'll find a great deal of it comes from the common VM directory, which includes all the components which are shared between BTC, BCH, BSV, and other Bitcoin forks.

The outline of the BTC VM is here, but I don't have any immediate plans to finish it myself. I'd love to take pull requests! And I'm very happy to answer questions or help in any way.

bitjson commented 4 years ago

I'm currently trying to sketch out a multisig scheme for BTC, and while I probably won't end up becoming too exotic, it would be good to be able to easily verify that I've not accidentally gotten dependent on a BCH-only quirk. :-)

@cernael – if you're still working on this, feel free to share your script in the telegram group, I'd be happy to help.

as1ndu commented 4 years ago

thanks @bitjson

arshbot commented 2 years ago

At the time of the fork, BCH dropped support for the original signing serialization algorithm (on BTC, the pre-SegWit algorithm)

What algo is this referring to?

A60AB5450353F40E commented 1 year ago

What algo is this referring to?

Signature preimage building algo: https://documentation.cash/protocol/forks/replay-protected-sighash