diff --git a/README.md b/README.md index 0dc1f7c..0e4ce90 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,19 @@ To fulfill the promises in the Lite Paper, the Side Watcher needs to: [ ] submit P2P chain data to the Side Chain Later, we will aim to remove the Side Watcher from the architecture, by (a) moving to pure P2P transactions between Side Nodes, and (b) doing leader election of a Side Node to reach agreement on the submitted block. + +## Bitcoin integration + +There is a Bitcoin client integrated into the node, which can do simple coin transfers using esplora and the Mutinynet server's Signet (30 second blocktime). + +The client's demo driver can be run by doing: + +``` +cargo run -- init dave +cargo run -- init sammy +cargo run -- btc +``` + +You'll need to have funded the "dave" address prior to running the `btc` command - otherwise the transfer will fail gracefully. + +I was using this primarily as a way to experiment with constructing and broadcasting Bitcoin transactions, with the hope that it would be possible to move on to more advanced constructions (e.g. state channels). However, now that I look at all the options, it seems that multi-party state channels in Bitcoin are (probably) impossible to construct. diff --git a/side-node/src/bitcoin/driver.rs b/side-node/src/bitcoin/driver.rs index e5e69fc..3286043 100644 --- a/side-node/src/bitcoin/driver.rs +++ b/side-node/src/bitcoin/driver.rs @@ -10,7 +10,9 @@ use crate::bitcoin::clients; /// /// Also, it very handily works with the mutinynet.com esplora server, which is configured /// with 30 second block times. -pub(crate) async fn run() -> Result<(), anyhow::Error> {} +pub(crate) async fn run() -> Result<(), anyhow::Error> { + simple_transfer().await +} async fn simple_transfer() -> Result<(), anyhow::Error> { let mut dave = clients::esplora::create_wallet("dave", Network::Signet)?;