Skip to content

f3rmion/generic_mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

generic_mpc

Experimental Axum relay for a t-of-n MPC wallet lifecycle:

  • wallet creation and authenticated participant requests;
  • GOLDEN-style DKG over the bjj-bn254-bp suite;
  • local participant share reconstruction;
  • FROST-style threshold signing where devices keep DKG secret shares local and the relay combines only per-session signature shares.

This repository is a pre-production PoC for protocol review and conformance work. Do not use it for internet-facing or high-value wallets.

Current Shape

The relay stores the public DKG/signing transcript and enforces phase, deadline, authorization, canonical CBOR, and replay rules. Participant devices own their local DKG secret shares. During signing, each selected device posts Round 1 commitments, then a Round 2 signature share for one message. The relay combines those signature shares into a self-contained signature envelope.

The linked suite is bjj-bn254-bp: Baby Jubjub for identity/NIKE inputs and BN254 G1 for output/VSS/Bulletproof commitments.

Useful Commands

cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test --all-targets
GENERIC_MPC_RELAY_PORT=3903 scripts/live-smoke-2of3.sh

Run the relay:

GENERIC_MPC_RELAY_ADDR=127.0.0.1:3903 cargo run --release --bin relay

Drive a local 2-of-3 DKG plus signing smoke:

GENERIC_MPC_RELAY_PORT=3903 \
GENERIC_MPC_THRESHOLD=2 \
GENERIC_MPC_TOTAL=3 \
GENERIC_MPC_READY_SNAPSHOT_OUT=target/tmp/ready-wallet.cbor \
cargo run --release --bin drive_wallet

Replay signing from participant-local READY snapshots:

GENERIC_MPC_READY_SNAPSHOT_IN=target/tmp/ready-wallet.node-1.cbor,target/tmp/ready-wallet.node-2.cbor \
cargo run --release --bin sign_ready_snapshot

Code Map

  • src/api.rs: Axum routes, auth, lifecycle state, relay-side signing combiner.
  • src/dkg.rs: DKG session state machine.
  • src/golden.rs: suite-facing GOLDEN algebra/provider boundaries.
  • src/api/suite_bjj_bn254_bp.rs: registered bjj-bn254-bp provider.
  • src/bjj_bn254_bp.rs: Round0 construction and verification helpers.
  • src/bn254_bp.rs: Bulletproof-style R1CS/eVRF proof substrate.
  • src/frost_bn254.rs: minimal BN254 FROST-style signing implementation.
  • src/ready_snapshot.rs: participant-local READY fixture format.
  • tests/ready_snapshot_replay.rs: fixture-backed threshold signing replay.

Local Docs

  • tests/fixtures/README.md: participant-local READY fixture details.

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors