mirror of
https://github.com/hanzoai/mpc.git
synced 2026-10-30 19:45:28 +00:00
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.
34 lines
1.0 KiB
Bash
Executable File
34 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Function to decrypt secrets
|
|
decrypt_secret() {
|
|
gpg --pinentry-mode loopback --passphrase "$1" -d "$2" 2>/dev/null
|
|
}
|
|
|
|
# Prompt for PASS value
|
|
read -sp "Enter the PASS value: " PASS
|
|
echo
|
|
|
|
# Set up environment variables
|
|
export GPG_TTY=$(tty)
|
|
|
|
# Decrypt secrets
|
|
NATS_PASSWORD=$(decrypt_secret "$PASS" ~/.password-store/apex-nats-password.gpg)
|
|
CONSUL_PASSWORD=$(decrypt_secret "$PASS" ~/.password-store/apex-consul-password.gpg)
|
|
CONSUL_TOKEN=$(decrypt_secret "$PASS" ~/.password-store/apex-consul-token.gpg)
|
|
BADGER_PASSWORD=$(decrypt_secret "$PASS" ~/.password-store/lux-mpc-badger-password.gpg)
|
|
|
|
# Prompt for command
|
|
read -p "Enter the command to execute: " user_command
|
|
|
|
# Execute the command with environment variables
|
|
env NATS_PASSWORD="$NATS_PASSWORD" \
|
|
CONSUL_PASSWORD="$CONSUL_PASSWORD" \
|
|
CONSUL_TOKEN="$CONSUL_TOKEN" \
|
|
BADGER_PASSWORD="$BADGER_PASSWORD" \
|
|
ENVIRONMENT=production \
|
|
$user_command
|
|
|
|
# Clear sensitive variables
|
|
unset PASS NATS_PASSWORD CONSUL_PASSWORD CONSUL_TOKEN BADGER_PASSWORD
|