Skip to content

ChrisSon15/bisq-musig

 
 

Repository files navigation

Bisq MuSig2 Protocol

This is module inside Bisq2. it implements a new Multisig protocol for Bisq2, this protocol is similar to the protocol used in Bisq1. It enables to buy/sell bitcoin from other peers without needing any trust in the other peer or into any coordinator or any third party. Since there is no intermediary to conduct the exchange, this is as close as its gets to the original bitcoin idea of conducting transaction in a p2p manner secured just by cryptography. Main changes to the Bisq1 protocol are:

  • more private, looks like a normal transaction without script.
  • fewer fees, happy path uses only one transaction
  • uses taproot
  • instead of scripts it uses advance cryptographic schemes like MuSig2 and Adaptor-signatures.
  • protocol is designed to handle unresponsive traders automatically

overview

This project is the handling the cryptographic part of the overall protocol. Even though it is the centerpiece there are more pieces necessary to pull this off. Here is an Overview drawing:

modules

docs

Detailed docs are in the Concepts section. To get a more indepth understanding of what this module is doing, please read SingleTxOverview This module's programming language is Rust. Technologies include:

  • bitcoin taproot transactions
  • scriptless scripts (MuSig2, adaptor signatures)
  • Rust
  • gRPC
  • Compact Block Filters (CBF)
  • Bitcoin Development Kit (BDK), especially bdk-wallet
  • crate tokio

If you have any knowledge in one of these areas, you please consider contributing to this project.

contribution

You can contact us at matrix. If you want to get a feeling about this project, check it out and start the test case:

cargo test

See the rpc/README.md for details on running the Java integration tests.

Accepted contributions are eligible for compensation, so you could earn money for your work.

Setting up precommit hooks (Optional)

The project comes bundle with a git pre-commit hook script that lints and format the code before each commits. To set it up you need to run the following command.

bash install-hooks.sh

NOTE: Make sure you have jq installed

The command will copy the pre-commit script to your local .git/hooks/pre-commit file. This helps us keeping clean build and focus on the essentials parts when reviewing pull requests.

logging / tracing

A small helper crate called bmp_tracing lives in the workspace. It exposes a single initialization function that all binaries and test environments should call once at startup. The API is intentionally minimal:

bmp_tracing::init("info");

The function reads the standard RUST_LOG environment variable and falls back to the supplied default level. You can disable logging completely by setting RUST_LOG=off.

running the tests

The Rust tests automatically spin up a TestEnv with bitcoind and electrs as needed, so you may need some RAM and patience.

cargo test

Tests are run single-threaded by default for stability. To run them in parallel (faster but may be flaky):

TEST_MULTITHREADED=true cargo test

The Java integration tests are orchestrated via Maven:

cd rpc
mvn clean verify

reading the Markdown files

Some of the markdown files have LaTeX included, you can best view them using RustRover. Github sucks at displaying LaTeX. There is also an html export on the github pages of the project at github pages

About

No description, website, or topics provided.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 87.8%
  • Java 10.9%
  • Shell 1.2%
  • Other 0.1%