Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTC Support? #28

Open
bitjson opened this issue Nov 11, 2019 · 8 comments
Open

BTC Support? #28

bitjson opened this issue Nov 11, 2019 · 8 comments

Comments

@bitjson
Copy link
Member

bitjson commented Nov 11, 2019

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.

@bitjson bitjson changed the title BTC Support BTC Support? Nov 11, 2019
@cernael
Copy link

cernael commented Nov 25, 2019

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
Copy link

qertoip commented Dec 29, 2019

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

@as1ndu
Copy link

as1ndu commented Jan 3, 2020

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

@bitjson
Copy link
Member Author

bitjson commented Jan 22, 2020

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:

  • At the time of the fork, BCH dropped support for the original signing serialization algorithm (on BTC, the pre-SegWit algorithm), but BTC still supports that algorithm outside of SegWit programs. So to create a correct implementation, we'll need to implement it (including the known bugs).
  • Also, SegWit support needs to be added. It's a relatively small change in the context of the VM (we're not adding support to e.g. a full node), but the challenge will be ensuring it is correct.

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
Copy link
Member Author

bitjson commented Jan 22, 2020

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
Copy link

as1ndu commented Jan 22, 2020

thanks @bitjson

@arshbot
Copy link

arshbot commented Feb 23, 2022

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
Copy link

What algo is this referring to?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants