Files
mpc/scripts/launch-3-nodes.sh
zeekay 19b49809fd Implement threshold MPC signing with CGGMP21, FROST, and LSS protocols
This commit adds complete multi-party computation (MPC) threshold signing
for multiple cryptographic protocols:

CGGMP21 (ECDSA/secp256k1):
- Key generation for Bitcoin/Ethereum/EVM chains
- Threshold signing with t-of-n security
- Recovery byte calculation for Ethereum compatibility

FROST/Taproot (EdDSA/BIP-340):
- EdDSA key generation for Solana/Sui/Polkadot
- BIP-340 compatible Schnorr signatures (64 bytes)
- CBOR serialization for TaprootConfig crypto types

LSS (Linear Secret Sharing):
- Dynamic resharing support (change participants)
- ECDSA signing with blinding protocol
- Protocol adapter for unified interface

Key fixes:
- Use MarshalBinary/UnmarshalBinary for protocol messages
- CBOR serialization for FROST TaprootConfig (not JSON)
- Correct type assertion for taproot.Signature ([]byte)
- Sorted party IDs for deterministic ordering

E2E tests pass for both ECDSA and EdDSA signing.
2026-01-24 23:41:43 -08:00

44 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
echo "🚀 Launching 3-node MPC cluster..."
echo ""
# Generate identities for all nodes if not exist
for node in node0 node1 node2; do
if [ ! -f "identity/${node}_identity.json" ]; then
echo "Generating identity for $node..."
./lux-mpc-cli generate-identity --node $node --peers peers.json --output-dir identity
fi
done
echo ""
echo "Starting nodes with environment prefix..."
echo "Environment: local (from config.yaml)"
echo ""
# Start nodes in background
echo "Starting lux-local-node0..."
./lux-mpc start --name node0 > logs/node0.log 2>&1 &
echo "PID: $!"
sleep 2
echo "Starting lux-local-node1..."
./lux-mpc start --name node1 > logs/node1.log 2>&1 &
echo "PID: $!"
sleep 2
echo "Starting lux-local-node2..."
./lux-mpc start --name node2 > logs/node2.log 2>&1 &
echo "PID: $!"
echo ""
echo "✅ All nodes launched!"
echo ""
echo "Check status:"
echo " - Logs: tail -f logs/*.log"
echo " - Consul UI: http://localhost:8500"
echo " - NATS: http://localhost:8222"
echo ""
echo "To stop all nodes: pkill lux-mpc"