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
737 B
Go
34 lines
737 B
Go
package config
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
|
|
"github.com/rs/zerolog"
|
|
|
|
"github.com/rs/zerolog/log"
|
|
"github.com/rs/zerolog/pkgerrors"
|
|
)
|
|
|
|
func InitLogger() {
|
|
zerolog.ErrorStackMarshaler = pkgerrors.MarshalStack
|
|
|
|
output := zerolog.ConsoleWriter{Out: os.Stdout}
|
|
output.FormatLevel = func(i interface{}) string {
|
|
return strings.ToUpper(fmt.Sprintf("| %-6s|", i))
|
|
}
|
|
output.FormatMessage = func(i interface{}) string {
|
|
return fmt.Sprintf("***%s****", i)
|
|
}
|
|
output.FormatFieldName = func(i interface{}) string {
|
|
return fmt.Sprintf("%s:", i)
|
|
}
|
|
output.FormatFieldValue = func(i interface{}) string {
|
|
return strings.ToUpper(fmt.Sprintf("%s", i))
|
|
}
|
|
|
|
log.Logger = log.Output(output)
|
|
log.Debug().Msg("Logger initialized!")
|
|
}
|