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

Runtime for testing Bitcoin smart contracts #1145

Open
nud3l opened this issue Jul 27, 2023 · 1 comment · May be fixed by #1179
Open

Runtime for testing Bitcoin smart contracts #1145

nud3l opened this issue Jul 27, 2023 · 1 comment · May be fixed by #1179
Assignees
Labels
enhancement New feature or request

Comments

@nud3l
Copy link
Member

nud3l commented Jul 27, 2023

Is your feature request related to a problem? Please describe.
A key use case for building smart contracts on Interlay will be the ability to read trustlessly from Bitcoin via the BTC light client.

Developing Bitcoin smart contracts requires access to at least a basic runtime with the following functionalities deployed in addition to essential runtime pallets (tokens, ...).

  • Contracts pallet
  • BTC-relay
  • Sudo

Spinning up a test environment for Interlay is quite involved (https://github.com/interlay/interbtc-api/blob/master/docker-compose.yml).

I would like to simplify the effort to setup a development environment that provides access to the functionality listed above.

Describe the solution you'd like
Move the BTC relayer functionality to an off-chain worker so that anyone can setup a interlay or kintsugi runtime has to start a local substrate node. They can then chose to relay Bitcoin testnet blocks or run a local Bitcoin regtest network.

@nud3l nud3l added the enhancement New feature or request label Jul 27, 2023
@sander2 sander2 self-assigned this Aug 14, 2023
@sander2
Copy link
Member

sander2 commented Aug 14, 2023

Started on this task. I'm trying to add the relay to the node service. The reason for not going the offchain worker is that the offchain worker is executed in wasm (no_std), which makes interfacing with the bitcoin daemon more complicated.

There are two possible approaches when going the service route: we can either use the jsonrpc interface, or try to submit the extrinsics directly from the node internals. I'm trying the latter option because I'd like to avoid a subxt+metadata dependency if possible and I've found a way to construct and submit extrinsics although it's still untested atm

@sander2 sander2 linked a pull request Sep 1, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants