Merge branch 'experiments/bitcoin-native'

This commit is contained in:
Dave Hrycyszyn
2024-06-27 10:57:18 +01:00
29 changed files with 1913 additions and 186 deletions

View File

@@ -50,11 +50,29 @@ Next dev tasks:
### Side Watcher
The Side Watcher is a simple relayer node that sits between the Side Chain (Cosmos) and the decentralized Side Nodes. At the moment, it simply relays transactions between nodes via a websocket.
The Side Watcher is a simple relayer node that sits between the Side Chain (Cosmos) and the decentralized Side Nodes. At the moment, it simply relays transactions between nodes via a websocket. We aim to eliminate this component from the architecture, but for the moment it simplifies networking and consensus agreement while we experiment with higher-value concepts.
Next, the Side Watcher needs to:
To fulfill the promises in the Lite Paper, the Side Watcher needs to:
[ ] make a block for the P2P when the Side Chain creates a block (see litepaper)
[ ] make a block for the P2P when the Side Chain creates a block
[ ] 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.
There is a second, unused Bitcoin client in place which uses Blockstream's Electrum server, but this didn't seem to be working properly with respect to Signet Bitcoin network during my testing, so I went with the esplora / Mutiny version instead.