Documentation
¶
Overview ¶
Package adapters - Bitcoin adapter with Taproot support
Package adapters - Cardano adapter for Ed25519 threshold signatures ¶
Package adapters - Celo blockchain adapter (Ethereum-compatible with modifications)
Package adapters - Dilithium/ML-DSA post-quantum signature adapter
Package adapters - Ethereum/EVM chain adapter implementation
Package adapters - Generic EVM blockchain adapter Supports: Ethereum, BSC, Polygon, Lux, Arbitrum, Optimism, Base, etc.
Package adapters provides chain-specific implementations for threshold signatures ¶
Package adapters - ML-DSA/Dilithium threshold signature with Shamir LSS
Package adapters - NEAR blockchain adapter for Ed25519 threshold signatures ¶
Package adapters - Ringtail post-quantum threshold signature implementation ¶
Package adapters - Solana adapter for Ed25519 threshold signatures ¶
Package adapters - Sui blockchain adapter for Ed25519 threshold signatures ¶
Package adapters - TON blockchain adapter for Ed25519 threshold signatures ¶
Package adapters provides chain-specific implementations for threshold signatures
Index ¶
- Constants
- Variables
- func GetChainRequirements(chain string) map[string]interface{}
- func GetDefaultCardanoConfig(networkID byte, era CardanoEra) map[string]interface{}
- func GetDefaultCeloConfig(chainID *big.Int) map[string]interface{}
- func GetDefaultNEARConfig(networkID string) map[string]interface{}
- func GetDefaultSuiConfig() map[string]interface{}
- func GetDefaultTONConfig(workchain int32) map[string]interface{}
- func GetSupportedChains() []string
- func LagrangeAtZero(th *ThresholdConfig) (map[party.ID]F, error)
- func SerializeTxBlob(tx *XRPLTransaction) ([]byte, error)
- func TestMLDSAThreshold() error
- func TranscriptBinding(chainID string, keyID string, epochID uint64, participants []party.ID, ...) []byte
- func ValidateThresholdConfig(config *ThresholdConfig) error
- type AccessKey
- type AccessListEntry
- type AccountStatus
- type ActionType
- type AdapterFactory
- type AddKeyAction
- type AddressType
- type AssetName
- type BitcoinAdapter
- func (b *BitcoinAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (b *BitcoinAdapter) CreateMultisigScript(pubkeys []curve.Point, threshold int) ([]byte, error)
- func (b *BitcoinAdapter) CreateP2TRAddress(internalKey curve.Point, scriptTree []byte) (string, error)
- func (b *BitcoinAdapter) Digest(tx interface{}) ([]byte, error)
- func (b *BitcoinAdapter) Encode(full FullSig) ([]byte, error)
- func (b *BitcoinAdapter) SetNetwork(network BitcoinNetwork)
- func (b *BitcoinAdapter) SetTaprootTweak(tweak []byte)
- func (b *BitcoinAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (b *BitcoinAdapter) ValidateConfig(config *UnifiedConfig) error
- type BitcoinNetwork
- type CallArg
- type CallArgType
- type CardanoAdapter
- func (c *CardanoAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (c *CardanoAdapter) Digest(tx interface{}) ([]byte, error)
- func (c *CardanoAdapter) Encode(full FullSig) ([]byte, error)
- func (c *CardanoAdapter) EstimateFee(tx *CardanoTransaction) uint64
- func (c *CardanoAdapter) GenerateCardanoAddress(paymentPubKey, stakePubKey [32]byte) CardanoAddress
- func (c *CardanoAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (c *CardanoAdapter) ValidateConfig(config *UnifiedConfig) error
- type CardanoAddress
- type CardanoEra
- type CardanoMetadata
- type CardanoTransaction
- type CeloAccessListEntry
- type CeloAdapter
- func (c *CeloAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (c *CeloAdapter) Digest(tx interface{}) ([]byte, error)
- func (c *CeloAdapter) Encode(full FullSig) ([]byte, error)
- func (c *CeloAdapter) EstimateFee(tx *CeloTransaction) uint64
- func (c *CeloAdapter) GenerateCeloAddress(publicKey curve.Point) [20]byte
- func (c *CeloAdapter) MapPhoneNumberToAddress(phoneHash [32]byte) [20]byte
- func (c *CeloAdapter) SetChainID(chainID *big.Int)
- func (c *CeloAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (c *CeloAdapter) ValidateConfig(config *UnifiedConfig) error
- type CeloLegacyTransaction
- type CeloTransaction
- type Certificate
- type CertificateType
- type ChainConfig
- type Command
- type CommandType
- type DeployContractAction
- type DilithiumAdapter
- func (d *DilithiumAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (d *DilithiumAdapter) Benchmark(parties int, threshold int) *DilithiumBenchmark
- func (d *DilithiumAdapter) Digest(tx interface{}) ([]byte, error)
- func (d *DilithiumAdapter) DilithiumDKG(parties []party.ID, threshold int) (*DilithiumPublicKey, map[party.ID]*DilithiumSecretShare, error)
- func (d *DilithiumAdapter) Encode(full FullSig) ([]byte, error)
- func (d *DilithiumAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (d *DilithiumAdapter) ValidateConfig(config *UnifiedConfig) error
- type DilithiumBenchmark
- type DilithiumExtensions
- type DilithiumFullSig
- type DilithiumParams
- type DilithiumPartialSig
- type DilithiumPublicKey
- type DilithiumSecretShare
- type DilithiumState
- type ECDSAExtensions
- type ECDSAFullSig
- type ECDSAPartialSig
- type EIP1559Transaction
- type EIP4844Transaction
- type EVMAdapter
- func (e *EVMAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (e *EVMAdapter) Digest(tx interface{}) ([]byte, error)
- func (e *EVMAdapter) Encode(full FullSig) ([]byte, error)
- func (e *EVMAdapter) EstimateGas(tx *EVMTransaction) uint64
- func (e *EVMAdapter) GenerateEVMAddress(publicKey curve.Point) [20]byte
- func (e *EVMAdapter) SetCustomChainID(chainID *big.Int)
- func (e *EVMAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (e *EVMAdapter) ValidateConfig(config *UnifiedConfig) error
- type EVMChain
- type EVMTransaction
- type EdDSAExtensions
- type EdDSAFullSig
- type EdDSAPartialSig
- type EthereumAdapter
- func (e *EthereumAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (e *EthereumAdapter) CreateMultisigWallet(owners []string, threshold int) ([]byte, error)
- func (e *EthereumAdapter) Digest(tx interface{}) ([]byte, error)
- func (e *EthereumAdapter) Encode(full FullSig) ([]byte, error)
- func (e *EthereumAdapter) EstimateGas(tx interface{}) (uint64, error)
- func (e *EthereumAdapter) GetContractCallData(method string, params ...interface{}) ([]byte, error)
- func (e *EthereumAdapter) SetChainID(chainID *big.Int)
- func (e *EthereumAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (e *EthereumAdapter) ValidateConfig(config *UnifiedConfig) error
- type ExecutionUnits
- type F
- type FullAccessPermission
- type FullSig
- type FunctionCallAction
- type FunctionCallPermissionData
- type GasPayment
- type Hints
- type Input
- type KeyType
- type LegacyBitcoinTx
- type LegacyTransaction
- type MLDSAParams
- type MLDSAThresholdAdapter
- func (m *MLDSAThresholdAdapter) OnlineSignT(A [][]Poly, mu []byte, pre Precomp, s1, s2 []SecretPoly, t, t0 []Poly, ...) (Sig, bool, error)
- func (m *MLDSAThresholdAdapter) PrecomputeT(A [][]Poly) (Precomp, error)
- func (m *MLDSAThresholdAdapter) RejectionCheck(zs, rL []SecretPoly, params *MLDSAParams) (bool, error)
- type MPCEngine
- type NEARAction
- type NEARAdapter
- func (n *NEARAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (n *NEARAdapter) Digest(tx interface{}) ([]byte, error)
- func (n *NEARAdapter) Encode(full FullSig) ([]byte, error)
- func (n *NEARAdapter) EstimateGas(tx *NEARTransaction) uint64
- func (n *NEARAdapter) GenerateNEARAddress(publicKey [32]byte, accountID string) string
- func (n *NEARAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (n *NEARAdapter) ValidateConfig(config *UnifiedConfig) error
- type NEARAmount
- type NEARTransaction
- type NativeScript
- type NativeScriptType
- type ObjectDigest
- type ObjectID
- type ObjectRef
- type OfflineRound1
- type OfflineRound2
- type Output
- type PartialSig
- type Permission
- type PermissionType
- type PolicyID
- type Poly
- type Precomp
- type ProtocolParameters
- type ProtocolUpdate
- type PubOps
- type PublicKey
- type Rational
- type Redeemer
- type RedeemerTag
- type RingtailAdapter
- func (r *RingtailAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (r *RingtailAdapter) Benchmark(parties int, threshold int) *RingtailBenchmark
- func (r *RingtailAdapter) Digest(tx interface{}) ([]byte, error)
- func (r *RingtailAdapter) Encode(full FullSig) ([]byte, error)
- func (r *RingtailAdapter) PreprocessOffline(numSessions int) error
- func (r *RingtailAdapter) RingtailDKG(parties []party.ID, threshold int) (*RingtailPublicKey, map[party.ID]*RingtailSecretShare, error)
- func (r *RingtailAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (r *RingtailAdapter) ValidateConfig(config *UnifiedConfig) error
- type RingtailBenchmark
- type RingtailExtensions
- type RingtailFullSig
- type RingtailOfflineData
- type RingtailParams
- type RingtailPartialSig
- type RingtailPreprocessing
- type RingtailPublicKey
- type RingtailSecretShare
- type RingtailState
- type SchnorrFullSig
- type SchnorrPartialSig
- type Script
- type SecretPoly
- type SegwitTx
- type Share
- type Sig
- type SigHashType
- type SignParams
- type Signature
- type SignatureType
- type SignerAdapter
- type SolanaAdapter
- func (s *SolanaAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (s *SolanaAdapter) ComputeProgramDerivedAddress(programID [32]byte, seeds [][]byte) ([32]byte, byte, error)
- func (s *SolanaAdapter) CreateMultisigAccount(signers [][32]byte, threshold byte) ([]byte, error)
- func (s *SolanaAdapter) CreateTokenTransferInstruction(amount uint64, decimals byte) *SolanaInstruction
- func (s *SolanaAdapter) CreateTransferInstruction(from, to [32]byte, lamports uint64) *SolanaInstruction
- func (s *SolanaAdapter) Digest(tx interface{}) ([]byte, error)
- func (s *SolanaAdapter) Encode(full FullSig) ([]byte, error)
- func (s *SolanaAdapter) EstimateComputeUnits(numSignatures int) uint32
- func (s *SolanaAdapter) GetRentExemptBalance(dataSize int) uint64
- func (s *SolanaAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (s *SolanaAdapter) ValidateConfig(config *UnifiedConfig) error
- func (s *SolanaAdapter) VerifyEd25519Signature(pubkey [32]byte, message []byte, signature [64]byte) bool
- type SolanaConfig
- type SolanaInstruction
- type SolanaMessage
- type SolanaTransaction
- type StakeAction
- type SuiAdapter
- func (s *SuiAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (s *SuiAdapter) CreateTransferTransaction(from, to SuiAddress, amount uint64) *SuiTransaction
- func (s *SuiAdapter) Digest(tx interface{}) ([]byte, error)
- func (s *SuiAdapter) Encode(full FullSig) ([]byte, error)
- func (s *SuiAdapter) EstimateGas(tx *SuiTransaction) uint64
- func (s *SuiAdapter) GenerateSuiAddress(publicKey [32]byte) SuiAddress
- func (s *SuiAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (s *SuiAdapter) ValidateConfig(config *UnifiedConfig) error
- type SuiAddress
- type SuiProgrammableTransaction
- type SuiTransaction
- type TONAdapter
- func (t *TONAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (t *TONAdapter) CreateWalletStateInit(publicKey [32]byte, walletID uint32) *TONStateInit
- func (t *TONAdapter) Digest(tx interface{}) ([]byte, error)
- func (t *TONAdapter) Encode(full FullSig) ([]byte, error)
- func (t *TONAdapter) EstimateGas(msg *TONMessage) uint64
- func (t *TONAdapter) GenerateTONAddress(publicKey [32]byte) TONAddress
- func (t *TONAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (t *TONAdapter) ValidateConfig(config *UnifiedConfig) error
- type TONAddress
- type TONCurrencyCollection
- type TONMessage
- type TONMessageInfo
- type TONStateInit
- type TONTransaction
- type TaprootTx
- type ThresholdConfig
- type TransactionBody
- type TransactionExpiration
- type TransactionInput
- type TransactionKind
- type TransactionOutput
- type TransactionType
- type TransactionWitnessSet
- type TransferAction
- type UnifiedConfig
- type VKeyWitness
- type ValidityInterval
- type Value
- type XRPLAdapter
- func (x *XRPLAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
- func (x *XRPLAdapter) Digest(tx interface{}) ([]byte, error)
- func (x *XRPLAdapter) Encode(full FullSig) ([]byte, error)
- func (x *XRPLAdapter) FormatPublicKey(pubKey curve.Point) string
- func (x *XRPLAdapter) GetSignerListEntry(config *UnifiedConfig, weight uint16) map[string]interface{}
- func (x *XRPLAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
- func (x *XRPLAdapter) ValidateConfig(config *UnifiedConfig) error
- type XRPLHashPrefix
- type XRPLTransaction
Constants ¶
const ( LegacyTxType = 0x00 AccessListTxType = 0x01 DynamicFeeTxType = 0x02 BlobTxType = 0x03 )
Transaction types
Variables ¶
var ( // STX is the single-signing prefix (0x53545800) STX = XRPLHashPrefix{0x53, 0x54, 0x58, 0x00} // SMT is the multi-signing prefix (0x534D5400) SMT = XRPLHashPrefix{0x53, 0x4D, 0x54, 0x00} // Ed25519Prefix is the XRPL Ed25519 public key prefix Ed25519Prefix = byte(0xED) )
Functions ¶
func GetChainRequirements ¶
GetChainRequirements returns specific requirements for a chain
func GetDefaultCardanoConfig ¶
func GetDefaultCardanoConfig(networkID byte, era CardanoEra) map[string]interface{}
GetCardanoConfig returns default Cardano configuration
func GetDefaultCeloConfig ¶
GetCeloConfig returns default Celo configuration
func GetDefaultNEARConfig ¶
GetNEARConfig returns default NEAR configuration
func GetDefaultSuiConfig ¶
func GetDefaultSuiConfig() map[string]interface{}
GetSuiConfig returns default Sui configuration
func GetDefaultTONConfig ¶
GetTONConfig returns default TON configuration
func GetSupportedChains ¶
func GetSupportedChains() []string
GetSupportedChains returns list of supported blockchain networks
func LagrangeAtZero ¶
func LagrangeAtZero(th *ThresholdConfig) (map[party.ID]F, error)
LagrangeAtZero computes Lagrange coefficients for reconstruction at x=0
func SerializeTxBlob ¶
func SerializeTxBlob(tx *XRPLTransaction) ([]byte, error)
SerializeTxBlob serializes an XRPL transaction to binary format
func TestMLDSAThreshold ¶
func TestMLDSAThreshold() error
TestMLDSAThreshold provides test vectors and conformance checks
func TranscriptBinding ¶
func TranscriptBinding( chainID string, keyID string, epochID uint64, participants []party.ID, alphaPoints map[party.ID]F, precompNonce []byte, wH []Poly, mu []byte, ) []byte
TranscriptBinding creates a domain-separated binding for threshold ML-DSA
func ValidateThresholdConfig ¶
func ValidateThresholdConfig(config *ThresholdConfig) error
ValidateThresholdConfig ensures threshold configuration is valid
Types ¶
type AccessKey ¶
type AccessKey struct {
Nonce uint64
Permission Permission
}
type AccessListEntry ¶
type AccountStatus ¶
type AccountStatus byte
const ( AccountUninit AccountStatus = iota AccountActive AccountFrozen )
type ActionType ¶
type ActionType byte
const ( CreateAccount ActionType = iota DeployContract FunctionCall Transfer Stake AddKey DeleteKey DeleteAccount )
type AdapterFactory ¶
type AdapterFactory struct{}
AdapterFactory creates appropriate adapter for a chain
func (*AdapterFactory) NewAdapter ¶
func (f *AdapterFactory) NewAdapter(chain string, sigType SignatureType) SignerAdapter
NewAdapter creates a chain-specific adapter
type AddKeyAction ¶
func (*AddKeyAction) Type ¶
func (a *AddKeyAction) Type() ActionType
type AddressType ¶
type AddressType byte
const ( BaseAddress AddressType = iota ScriptAddress EnterpriseAddress PointerAddress RewardAddress )
type BitcoinAdapter ¶
type BitcoinAdapter struct {
// contains filtered or unexported fields
}
BitcoinAdapter implements SignerAdapter for Bitcoin with Taproot/Schnorr support
func NewBitcoinAdapter ¶
func NewBitcoinAdapter(sigType SignatureType) *BitcoinAdapter
NewBitcoinAdapter creates a new Bitcoin adapter
func (*BitcoinAdapter) AggregateEC ¶
func (b *BitcoinAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines partial signatures
func (*BitcoinAdapter) CreateMultisigScript ¶
CreateMultisigScript creates a Bitcoin multisig script
func (*BitcoinAdapter) CreateP2TRAddress ¶
func (b *BitcoinAdapter) CreateP2TRAddress(internalKey curve.Point, scriptTree []byte) (string, error)
CreateP2TRAddress creates a Pay-to-Taproot address
func (*BitcoinAdapter) Digest ¶
func (b *BitcoinAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Bitcoin transaction digest based on type
func (*BitcoinAdapter) Encode ¶
func (b *BitcoinAdapter) Encode(full FullSig) ([]byte, error)
Encode formats signature for Bitcoin wire format
func (*BitcoinAdapter) SetNetwork ¶
func (b *BitcoinAdapter) SetNetwork(network BitcoinNetwork)
SetNetwork sets the Bitcoin network
func (*BitcoinAdapter) SetTaprootTweak ¶
func (b *BitcoinAdapter) SetTaprootTweak(tweak []byte)
SetTaprootTweak sets the Taproot tweak for key/script path spending
func (*BitcoinAdapter) SignEC ¶
func (b *BitcoinAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC performs threshold signing for Bitcoin
func (*BitcoinAdapter) ValidateConfig ¶
func (b *BitcoinAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Bitcoin-specific configuration
type BitcoinNetwork ¶
type BitcoinNetwork int
BitcoinNetwork represents Bitcoin network parameters
const ( BitcoinMainnet BitcoinNetwork = iota BitcoinTestnet BitcoinRegtest )
type CallArg ¶
type CallArg interface {
Type() CallArgType
}
type CardanoAdapter ¶
type CardanoAdapter struct {
// contains filtered or unexported fields
}
CardanoAdapter implements SignerAdapter for Cardano blockchain Cardano natively uses Ed25519 but also supports ECDSA/Schnorr for interoperability
func NewCardanoAdapter ¶
func NewCardanoAdapter(sigType SignatureType, networkID byte, era CardanoEra) *CardanoAdapter
NewCardanoAdapter creates a new Cardano adapter
func (*CardanoAdapter) AggregateEC ¶
func (c *CardanoAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines partial signatures
func (*CardanoAdapter) Digest ¶
func (c *CardanoAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Cardano transaction digest
func (*CardanoAdapter) Encode ¶
func (c *CardanoAdapter) Encode(full FullSig) ([]byte, error)
Encode formats signature for Cardano
func (*CardanoAdapter) EstimateFee ¶
func (c *CardanoAdapter) EstimateFee(tx *CardanoTransaction) uint64
EstimateFee estimates transaction fee in Lovelace
func (*CardanoAdapter) GenerateCardanoAddress ¶
func (c *CardanoAdapter) GenerateCardanoAddress(paymentPubKey, stakePubKey [32]byte) CardanoAddress
GenerateCardanoAddress generates a Cardano address from public key
func (*CardanoAdapter) SignEC ¶
func (c *CardanoAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates partial signature for Cardano
func (*CardanoAdapter) ValidateConfig ¶
func (c *CardanoAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Cardano-specific configuration
type CardanoAddress ¶
type CardanoAddress struct {
Type AddressType
Network byte
Payment [28]byte // Payment credential hash
Stake [28]byte // Stake credential hash (optional)
}
type CardanoEra ¶
type CardanoEra int
CardanoEra represents different Cardano protocol eras
const ( EraShelley CardanoEra = iota EraAllegra EraMary EraAlonzo EraBabbage // Current era with Plutus V2 EraConway // Upcoming with governance )
type CardanoMetadata ¶
type CardanoMetadata struct {
Labels map[uint64]interface{}
}
type CardanoTransaction ¶
type CardanoTransaction struct {
Body *TransactionBody
Witnesses *TransactionWitnessSet
IsValid bool
AuxData *CardanoMetadata // Optional metadata
}
type CeloAccessListEntry ¶
CeloAccessListEntry for Celo-specific access lists
type CeloAdapter ¶
type CeloAdapter struct {
// contains filtered or unexported fields
}
CeloAdapter implements SignerAdapter for Celo blockchain Celo is Ethereum-compatible but with different transaction formats and phone number mapping
func (*CeloAdapter) AggregateEC ¶
func (c *CeloAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines ECDSA partial signatures
func (*CeloAdapter) Digest ¶
func (c *CeloAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Celo transaction digest
func (*CeloAdapter) Encode ¶
func (c *CeloAdapter) Encode(full FullSig) ([]byte, error)
Encode formats ECDSA signature for Celo (same as Ethereum)
func (*CeloAdapter) EstimateFee ¶
func (c *CeloAdapter) EstimateFee(tx *CeloTransaction) uint64
EstimateFee estimates transaction fee in Celo
func (*CeloAdapter) GenerateCeloAddress ¶
func (c *CeloAdapter) GenerateCeloAddress(publicKey curve.Point) [20]byte
GenerateCeloAddress generates a Celo address from public key
func (*CeloAdapter) MapPhoneNumberToAddress ¶
func (c *CeloAdapter) MapPhoneNumberToAddress(phoneHash [32]byte) [20]byte
MapPhoneNumberToAddress maps phone number to Celo address (simplified)
func (*CeloAdapter) SetChainID ¶
func (c *CeloAdapter) SetChainID(chainID *big.Int)
SetChainID sets the Celo chain ID (42220 mainnet, 44787 alfajores testnet)
func (*CeloAdapter) SignEC ¶
func (c *CeloAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates ECDSA partial signature for Celo
func (*CeloAdapter) ValidateConfig ¶
func (c *CeloAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Celo-specific configuration
type CeloLegacyTransaction ¶
type CeloTransaction ¶
type CeloTransaction struct {
ChainID *big.Int
Nonce uint64
MaxPriorityFeePerGas *big.Int
MaxFeePerGas *big.Int
GatewayFeeRecipient *[20]byte // Celo-specific
GatewayFee *big.Int // Celo-specific
FeeCurrency *[20]byte // Celo-specific: address of token to pay fees in
GasLimit uint64
To *[20]byte
Value *big.Int
Data []byte
AccessList []CeloAccessListEntry
}
type Certificate ¶
type Certificate interface {
Type() CertificateType
}
type CertificateType ¶
type CertificateType byte
const ( StakeRegistration CertificateType = iota StakeDeregistration StakeDelegation PoolRegistration PoolRetirement GenesisKeyDelegation MoveInstantaneousRewards )
type ChainConfig ¶
type ChainConfig struct {
ChainID *big.Int
Name string
Symbol string
ExplorerURL string
RPCURL string
IsL2 bool
SupportsEIP1559 bool
SupportsBlobTx bool
}
ChainConfig contains chain-specific configuration
func GetChainConfig ¶
func GetChainConfig(chain EVMChain) *ChainConfig
GetChainConfig returns configuration for known chains
type Command ¶
type Command interface {
Type() CommandType
}
type CommandType ¶
type CommandType byte
const ( MoveCallCommand CommandType = iota TransferObjectsCommand SplitCoinsCommand MergeCoinsCommand PublishCommand MakeMoveVecCommand UpgradeCommand )
type DeployContractAction ¶
type DeployContractAction struct {
Code []byte
}
func (*DeployContractAction) Type ¶
func (d *DeployContractAction) Type() ActionType
type DilithiumAdapter ¶
type DilithiumAdapter struct {
// contains filtered or unexported fields
}
DilithiumAdapter implements post-quantum threshold signatures using Dilithium/ML-DSA ML-DSA (Module-Lattice-Based Digital Signature Algorithm) is NIST's standardized version
func NewDilithiumAdapter ¶
func NewDilithiumAdapter(securityLevel int) *DilithiumAdapter
NewDilithiumAdapter creates a new Dilithium adapter with specified parameters
func (*DilithiumAdapter) AggregateEC ¶
func (d *DilithiumAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Dilithium partial signatures
func (*DilithiumAdapter) Benchmark ¶
func (d *DilithiumAdapter) Benchmark(parties int, threshold int) *DilithiumBenchmark
Benchmark runs performance tests for Dilithium
func (*DilithiumAdapter) Digest ¶
func (d *DilithiumAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes message digest for Dilithium
func (*DilithiumAdapter) DilithiumDKG ¶
func (d *DilithiumAdapter) DilithiumDKG(parties []party.ID, threshold int) (*DilithiumPublicKey, map[party.ID]*DilithiumSecretShare, error)
DilithiumDKG performs distributed key generation for Dilithium
func (*DilithiumAdapter) Encode ¶
func (d *DilithiumAdapter) Encode(full FullSig) ([]byte, error)
Encode converts Dilithium signature to wire format
func (*DilithiumAdapter) SignEC ¶
func (d *DilithiumAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC performs threshold signing using Dilithium
func (*DilithiumAdapter) ValidateConfig ¶
func (d *DilithiumAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates configuration for Dilithium
type DilithiumBenchmark ¶
type DilithiumBenchmark struct {
DKGTime int64 // microseconds
SigningTime int64 // microseconds
VerificationTime int64 // microseconds
SignatureSize int // bytes
PublicKeySize int // bytes
}
DilithiumBenchmark provides performance metrics
type DilithiumExtensions ¶
type DilithiumExtensions struct {
// NIST security level (2, 3, or 5)
SecurityLevel int // Maps to ML-DSA-44, ML-DSA-65, ML-DSA-87
// Lattice parameters (auto-configured based on security level)
K int // Vector dimension
L int // Matrix dimension
// Public seed for deterministic key generation
PublicSeed []byte
}
DilithiumExtensions holds Dilithium/ML-DSA specific configuration
type DilithiumFullSig ¶
type DilithiumFullSig struct {
Z [][]int32 // Response vector
H []byte // Hint
C []int32 // Challenge
Size int // Total size in bytes
}
DilithiumFullSig represents a full Dilithium signature
func (*DilithiumFullSig) Serialize ¶
func (d *DilithiumFullSig) Serialize() []byte
Serialize returns the serialized full signature
type DilithiumParams ¶
type DilithiumParams struct {
SecurityLevel int // NIST security level (2, 3, or 5)
Name string // ML-DSA-44, ML-DSA-65, ML-DSA-87
// Lattice parameters
N int // Polynomial degree (256)
Q int64 // Modulus (8380417)
D int // Dropped bits from t
K int // Number of polynomials in vector
L int // Number of polynomials in matrix
Eta int // Secret key range
Beta int // Tau bound
Gamma1 int // y coefficient range
Gamma2 int // Low-order rounding range
Omega int // Number of ±1 in c
Tau int // Number of ±1 in c (threshold)
// Signature parameters
SignatureSize int // Signature size in bytes
PublicKeySize int // Public key size in bytes
SecretKeySize int // Secret key size in bytes
}
DilithiumParams defines lattice parameters for different security levels
func GetDilithiumParams ¶
func GetDilithiumParams(level int) *DilithiumParams
GetDilithiumParams returns recommended parameters for a security level
type DilithiumPartialSig ¶
type DilithiumPartialSig struct {
PartyID party.ID
Z [][]int32 // Masked response
H []byte // Hint for signature reconstruction
Challenge []int32 // Challenge polynomial c
}
DilithiumPartialSig represents a partial Dilithium signature
func (*DilithiumPartialSig) GetPartyID ¶
func (d *DilithiumPartialSig) GetPartyID() party.ID
GetPartyID returns the party ID
func (*DilithiumPartialSig) Serialize ¶
func (d *DilithiumPartialSig) Serialize() []byte
Serialize returns the serialized partial signature
type DilithiumPublicKey ¶
type DilithiumPublicKey struct {
Seed []byte // Public seed ρ
T1 [][]int32 // High-order bits of t = As + e
Params *DilithiumParams
}
DilithiumPublicKey represents a Dilithium public key
type DilithiumSecretShare ¶
type DilithiumSecretShare struct {
}
DilithiumSecretShare represents a party's share of the secret key
type DilithiumState ¶
type DilithiumState struct {
Generation uint64
Threshold int
Parties []party.ID
PublicKey *DilithiumPublicKey
}
DilithiumState maintains the current state
type ECDSAExtensions ¶
type ECDSAExtensions struct {
PaillierKey interface{} // Paillier secret key
PedersenParams interface{} // Pedersen parameters
ChainCode []byte // HD wallet chain code
}
ECDSAExtensions holds ECDSA-specific configuration
type ECDSAFullSig ¶
func (*ECDSAFullSig) Serialize ¶
func (e *ECDSAFullSig) Serialize() []byte
type ECDSAPartialSig ¶
ECDSA signature components
func (*ECDSAPartialSig) GetPartyID ¶
func (e *ECDSAPartialSig) GetPartyID() party.ID
func (*ECDSAPartialSig) Serialize ¶
func (e *ECDSAPartialSig) Serialize() []byte
type EIP1559Transaction ¶
type EIP4844Transaction ¶
type EVMAdapter ¶
type EVMAdapter struct {
// contains filtered or unexported fields
}
EVMAdapter implements SignerAdapter for all EVM-compatible chains
func NewEVMAdapter ¶
func NewEVMAdapter(chain EVMChain) *EVMAdapter
NewEVMAdapter creates a new adapter for any EVM chain
func (*EVMAdapter) AggregateEC ¶
func (e *EVMAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines ECDSA partial signatures
func (*EVMAdapter) Digest ¶
func (e *EVMAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes transaction digest for EVM chains
func (*EVMAdapter) Encode ¶
func (e *EVMAdapter) Encode(full FullSig) ([]byte, error)
Encode formats ECDSA signature for EVM
func (*EVMAdapter) EstimateGas ¶
func (e *EVMAdapter) EstimateGas(tx *EVMTransaction) uint64
EstimateGas estimates gas for transaction
func (*EVMAdapter) GenerateEVMAddress ¶
func (e *EVMAdapter) GenerateEVMAddress(publicKey curve.Point) [20]byte
GenerateEVMAddress generates an EVM address from public key
func (*EVMAdapter) SetCustomChainID ¶
func (e *EVMAdapter) SetCustomChainID(chainID *big.Int)
SetCustomChainID allows setting custom chain ID for private/test networks
func (*EVMAdapter) SignEC ¶
func (e *EVMAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates ECDSA partial signature
func (*EVMAdapter) ValidateConfig ¶
func (e *EVMAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates EVM configuration
type EVMChain ¶
type EVMChain string
EVMChain represents different EVM-compatible chains
const ( Ethereum EVMChain = "ethereum" BSC EVMChain = "bsc" Polygon EVMChain = "polygon" Lux EVMChain = "lux" Arbitrum EVMChain = "arbitrum" Optimism EVMChain = "optimism" Base EVMChain = "base" Fantom EVMChain = "fantom" Cronos EVMChain = "cronos" Harmony EVMChain = "harmony" Moonbeam EVMChain = "moonbeam" Aurora EVMChain = "aurora" Gnosis EVMChain = "gnosis" Scroll EVMChain = "scroll" Linea EVMChain = "linea" Mantle EVMChain = "mantle" Celo EVMChain = "celo" Kava EVMChain = "kava" Metis EVMChain = "metis" )
type EVMTransaction ¶
type EVMTransaction struct {
Type byte
ChainID *big.Int
Nonce uint64
GasPrice *big.Int // Legacy
MaxPriorityFeePerGas *big.Int // EIP-1559
MaxFeePerGas *big.Int // EIP-1559
GasLimit uint64
To *[20]byte
Value *big.Int
Data []byte
AccessList []AccessListEntry
BlobVersionedHashes [][32]byte // EIP-4844
MaxFeePerBlobGas *big.Int // EIP-4844
}
EVMTransaction represents a generic EVM transaction
type EdDSAExtensions ¶
type EdDSAExtensions struct {
AuxRand []byte // Auxiliary randomness for deterministic nonces
}
EdDSAExtensions holds EdDSA-specific configuration
type EdDSAFullSig ¶
func (*EdDSAFullSig) Serialize ¶
func (e *EdDSAFullSig) Serialize() []byte
type EdDSAPartialSig ¶
EdDSA signature components
func (*EdDSAPartialSig) GetPartyID ¶
func (e *EdDSAPartialSig) GetPartyID() party.ID
func (*EdDSAPartialSig) Serialize ¶
func (e *EdDSAPartialSig) Serialize() []byte
type EthereumAdapter ¶
type EthereumAdapter struct {
// contains filtered or unexported fields
}
EthereumAdapter implements SignerAdapter for Ethereum and EVM-compatible chains
func NewEthereumAdapter ¶
func NewEthereumAdapter() *EthereumAdapter
NewEthereumAdapter creates a new Ethereum adapter
func (*EthereumAdapter) AggregateEC ¶
func (e *EthereumAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines partial signatures with low-S enforcement
func (*EthereumAdapter) CreateMultisigWallet ¶
func (e *EthereumAdapter) CreateMultisigWallet(owners []string, threshold int) ([]byte, error)
CreateMultisigWallet creates a threshold wallet contract deployment transaction
func (*EthereumAdapter) Digest ¶
func (e *EthereumAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Ethereum transaction digest
func (*EthereumAdapter) Encode ¶
func (e *EthereumAdapter) Encode(full FullSig) ([]byte, error)
Encode formats signature with recovery ID for Ethereum
func (*EthereumAdapter) EstimateGas ¶
func (e *EthereumAdapter) EstimateGas(tx interface{}) (uint64, error)
EstimateGas estimates gas for a threshold signature transaction
func (*EthereumAdapter) GetContractCallData ¶
func (e *EthereumAdapter) GetContractCallData(method string, params ...interface{}) ([]byte, error)
GetContractCallData generates calldata for threshold signature verification
func (*EthereumAdapter) SetChainID ¶
func (e *EthereumAdapter) SetChainID(chainID *big.Int)
SetChainID sets the chain ID for EIP-155 replay protection
func (*EthereumAdapter) SignEC ¶
func (e *EthereumAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates ECDSA partial signature for Ethereum
func (*EthereumAdapter) ValidateConfig ¶
func (e *EthereumAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Ethereum-specific configuration
type ExecutionUnits ¶
type FullAccessPermission ¶
type FullAccessPermission struct{}
FullAccessPermission represents full access
func (*FullAccessPermission) Type ¶
func (f *FullAccessPermission) Type() PermissionType
type FunctionCallAction ¶
type FunctionCallAction struct {
MethodName string
Args []byte
Gas uint64
Deposit NEARAmount
}
func (*FunctionCallAction) Type ¶
func (f *FunctionCallAction) Type() ActionType
type FunctionCallPermissionData ¶
type FunctionCallPermissionData struct {
Allowance *NEARAmount
ReceiverID string
MethodNames []string
}
FunctionCallPermissionData represents function call permission
func (*FunctionCallPermissionData) Type ¶
func (f *FunctionCallPermissionData) Type() PermissionType
type GasPayment ¶
type GasPayment struct {
Objects []ObjectRef
Owner SuiAddress
Price uint64
Budget uint64
}
type Hints ¶
type Hints struct {
Idx [][]int // Per-row positions where HighBits differ
}
Hints represent hint positions for signature compression
type LegacyBitcoinTx ¶
type LegacyBitcoinTx struct {
Version uint32
Inputs []Input
Outputs []Output
LockTime uint32
SigHash SigHashType
}
type LegacyTransaction ¶
type MLDSAParams ¶
type MLDSAParams struct {
Name string // ML-DSA-44, ML-DSA-65, ML-DSA-87
SecurityLevel int // NIST level: 2, 3, or 5
// Core parameters
Q int64 // 8380417 (prime modulus)
N int // 256 (polynomial degree)
K int // Vector dimension
L int // Matrix dimension
D int // Dropped bits
Tau int // Challenge weight
Eta int // Secret key range
Beta int // Rejection bound
Gamma1 int // y coefficient range
Gamma2 int // Low-order rounding range
Alpha2G2 int // 2*Gamma2 for HighBits
Omega int // Max hints per row
// Sizes
SignatureSize int
PublicKeySize int
SecretKeySize int
}
MLDSAParams matches FIPS 204 parameter sets
func GetMLDSAParams ¶
func GetMLDSAParams(level int) *MLDSAParams
GetMLDSAParams returns parameters for a given security level
type MLDSAThresholdAdapter ¶
type MLDSAThresholdAdapter struct {
// contains filtered or unexported fields
}
MLDSAThresholdAdapter implements true t-of-n threshold ML-DSA using Shamir LSS
func NewMLDSAThresholdAdapter ¶
func NewMLDSAThresholdAdapter(securityLevel int, threshold *ThresholdConfig, mpc MPCEngine, pub PubOps) *MLDSAThresholdAdapter
NewMLDSAThresholdAdapter creates a new threshold ML-DSA adapter
func (*MLDSAThresholdAdapter) OnlineSignT ¶
func (m *MLDSAThresholdAdapter) OnlineSignT( A [][]Poly, mu []byte, pre Precomp, s1, s2 []SecretPoly, t, t0 []Poly, sp SignParams, ) (Sig, bool, error)
OnlineSignT performs threshold signing for ML-DSA using Shamir LSS
func (*MLDSAThresholdAdapter) PrecomputeT ¶
func (m *MLDSAThresholdAdapter) PrecomputeT(A [][]Poly) (Precomp, error)
PrecomputeT generates precomputation for threshold signing
func (*MLDSAThresholdAdapter) RejectionCheck ¶
func (m *MLDSAThresholdAdapter) RejectionCheck(zs, rL []SecretPoly, params *MLDSAParams) (bool, error)
RejectionCheck performs ML-DSA rejection sampling in MPC
type MPCEngine ¶
type MPCEngine interface {
Add(a, b []F) []F
Sub(a, b []F) []F
MulConst(a []F, c F) []F
HighBitsVec(v []SecretPoly, alpha int) ([]SecretPoly, error)
Open(s []SecretPoly) ([]Poly, error)
OpenAtZero(s []SecretPoly, subset []party.ID, lambda map[party.ID]F) ([]Poly, error)
EqZero(a []F) (bool, error)
LongOverflow(v []SecretPoly, bound int) (bool, error)
}
MPCEngine defines the MPC operations interface
type NEARAction ¶
type NEARAction interface {
Type() ActionType
}
type NEARAdapter ¶
type NEARAdapter struct {
// contains filtered or unexported fields
}
NEARAdapter implements SignerAdapter for NEAR Protocol NEAR uses Ed25519 for signatures and Borsh serialization
func NewNEARAdapter ¶
func NewNEARAdapter(networkID string) *NEARAdapter
NewNEARAdapter creates a new NEAR adapter
func (*NEARAdapter) AggregateEC ¶
func (n *NEARAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Ed25519 partial signatures
func (*NEARAdapter) Digest ¶
func (n *NEARAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes NEAR transaction digest
func (*NEARAdapter) Encode ¶
func (n *NEARAdapter) Encode(full FullSig) ([]byte, error)
Encode formats Ed25519 signature for NEAR
func (*NEARAdapter) EstimateGas ¶
func (n *NEARAdapter) EstimateGas(tx *NEARTransaction) uint64
EstimateGas estimates gas for NEAR transaction
func (*NEARAdapter) GenerateNEARAddress ¶
func (n *NEARAdapter) GenerateNEARAddress(publicKey [32]byte, accountID string) string
GenerateNEARAddress generates a NEAR account ID from public key
func (*NEARAdapter) SignEC ¶
func (n *NEARAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates Ed25519 partial signature for NEAR
func (*NEARAdapter) ValidateConfig ¶
func (n *NEARAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates NEAR-specific configuration
type NEARAmount ¶
type NEARAmount struct {
Amount [16]byte // 128-bit integer
}
type NEARTransaction ¶
type NativeScript ¶
type NativeScript interface {
Type() NativeScriptType
}
type NativeScriptType ¶
type NativeScriptType byte
const ( ScriptPubkey NativeScriptType = iota ScriptAll ScriptAny ScriptNofK InvalidBefore InvalidAfter )
type ObjectDigest ¶
type ObjectDigest [32]byte
type ObjectRef ¶
type ObjectRef struct {
ObjectID ObjectID
Version uint64
Digest ObjectDigest
}
type OfflineRound1 ¶
type OfflineRound1 struct {
Commitments [][]byte // Commitments to shares
Nonces []int64 // Random nonces
Timestamp int64
}
OfflineRound1 contains first round offline preprocessing data
type OfflineRound2 ¶
type OfflineRound2 struct {
Proofs [][]byte // Zero-knowledge proofs
}
OfflineRound2 contains second round offline preprocessing data
type PartialSig ¶
PartialSig represents a partial signature from one party
type Permission ¶
type Permission interface {
Type() PermissionType
}
type PermissionType ¶
type PermissionType byte
const ( FullAccess PermissionType = iota FunctionCallPermission )
type Poly ¶
type Poly [256]F
Poly is a degree-255 polynomial over GF(Q)
func HighBitsPublic ¶
HighBitsPublic computes HighBits on public polynomial
type Precomp ¶
type Precomp struct {
Y []SecretPoly // Secret-shared masking polynomials
W []SecretPoly // Secret W = A*Y
WH []Poly // Public HighBits(W)
}
Precomp holds precomputed values for online signing
type ProtocolParameters ¶
type ProtocolParameters struct {
MinFeeA uint32
MinFeeB uint32
MaxBlockBodySize uint32
MaxTxSize uint32
MaxBlockHeaderSize uint32
KeyDeposit uint64
PoolDeposit uint64
MinPoolCost uint64
PriceMemory Rational
PriceSteps Rational
MaxTxExecutionUnits ExecutionUnits
MaxBlockExecutionUnits ExecutionUnits
MaxValueSize uint32
CollateralPercentage uint32
MaxCollateralInputs uint32
}
type ProtocolUpdate ¶
type ProtocolUpdate struct {
Epoch uint32
ProtocolParams *ProtocolParameters
}
type PubOps ¶
type PubOps interface {
VecMulByPublicPoly(v []SecretPoly, p Poly) []SecretPoly
LiftPublicPoly(p Poly) SecretPoly
MatrixVectorMul(A [][]Poly, v []SecretPoly) []SecretPoly
}
PubOps defines public operations on polynomials
type Redeemer ¶
type Redeemer struct {
Tag RedeemerTag
Index uint32
Data []byte
ExUnits ExecutionUnits
}
type RedeemerTag ¶
type RedeemerTag byte
const ( SpendRedeemer RedeemerTag = iota MintRedeemer CertRedeemer RewardRedeemer )
type RingtailAdapter ¶
type RingtailAdapter struct {
// contains filtered or unexported fields
}
RingtailAdapter implements post-quantum threshold signatures using lattice-based cryptography Based on the Ringtail protocol: 2-round threshold signatures from LWE
func NewRingtailAdapter ¶
func NewRingtailAdapter(securityLevel int, maxParties int) *RingtailAdapter
NewRingtailAdapter creates a new Ringtail adapter with specified parameters
func (*RingtailAdapter) AggregateEC ¶
func (r *RingtailAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Ringtail partial signatures
func (*RingtailAdapter) Benchmark ¶
func (r *RingtailAdapter) Benchmark(parties int, threshold int) *RingtailBenchmark
Benchmark runs performance tests for Ringtail
func (*RingtailAdapter) Digest ¶
func (r *RingtailAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes message digest for Ringtail (identity function for PQ)
func (*RingtailAdapter) Encode ¶
func (r *RingtailAdapter) Encode(full FullSig) ([]byte, error)
Encode converts Ringtail signature to wire format
func (*RingtailAdapter) PreprocessOffline ¶
func (r *RingtailAdapter) PreprocessOffline(numSessions int) error
PreprocessOffline generates offline preprocessing data for faster online signing
func (*RingtailAdapter) RingtailDKG ¶
func (r *RingtailAdapter) RingtailDKG(parties []party.ID, threshold int) (*RingtailPublicKey, map[party.ID]*RingtailSecretShare, error)
RingtailDKG performs distributed key generation for Ringtail
func (*RingtailAdapter) SignEC ¶
func (r *RingtailAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC performs threshold signing using Ringtail protocol
func (*RingtailAdapter) ValidateConfig ¶
func (r *RingtailAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates configuration for Ringtail
type RingtailBenchmark ¶
type RingtailBenchmark struct {
DKGTime int64 // microseconds
PreprocessingTime int64 // microseconds per session
SigningTime int64 // microseconds (online only)
VerificationTime int64 // microseconds
SignatureSize int // bytes
CommunicationSize int // total bytes exchanged
}
RingtailBenchmark provides performance metrics
type RingtailExtensions ¶
type RingtailExtensions struct {
// Lattice parameters
N int // Lattice dimension
Q int // Modulus
Sigma float64 // Gaussian parameter
SecurityLevel int // 128, 192, or 256 bits
PreprocessingShares []RingtailPreprocessing
// Public parameters
PublicMatrix interface{} // A matrix for LWE
}
RingtailExtensions holds Ringtail PQ-specific configuration
type RingtailFullSig ¶
type RingtailFullSig struct {
Signature interface{} // Complete lattice signature
Size int // Signature size in bytes
}
func (*RingtailFullSig) Serialize ¶
func (r *RingtailFullSig) Serialize() []byte
type RingtailOfflineData ¶
type RingtailOfflineData struct {
ID string
Round1Data *OfflineRound1
Round2Data *OfflineRound2
Consumed bool
}
RingtailOfflineData stores precomputed data for the offline phase
type RingtailParams ¶
type RingtailParams struct {
N int // Lattice dimension
Q int64 // Modulus
D int // Module rank
M int // Number of samples
Sigma float64 // Gaussian parameter
SecurityLevel int // 128, 192, or 256 bits
MaxParties int // Maximum number of parties (up to 1024)
SignatureSize int // Expected signature size in bytes
}
RingtailParams defines lattice parameters for different security levels
func GetRecommendedParams ¶
func GetRecommendedParams(securityLevel int, maxParties int) *RingtailParams
GetRecommendedParams returns recommended parameters for a security level
type RingtailPartialSig ¶
Ringtail PQ signature components
func (*RingtailPartialSig) GetPartyID ¶
func (r *RingtailPartialSig) GetPartyID() party.ID
func (*RingtailPartialSig) Serialize ¶
func (r *RingtailPartialSig) Serialize() []byte
type RingtailPreprocessing ¶
type RingtailPreprocessing struct {
ID string
Round1 interface{} // Offline round 1 data
Round2 interface{} // Offline round 2 data
Consumed bool
}
RingtailPreprocessing represents offline preprocessing for Ringtail
type RingtailPublicKey ¶
type RingtailPublicKey struct {
A [][]int64 // Public matrix A ∈ Z_q^{n×m}
B []int64 // Public vector B = As + e
Params *RingtailParams
}
RingtailPublicKey represents a lattice-based public key
type RingtailSecretShare ¶
type RingtailSecretShare struct {
}
RingtailSecretShare represents a party's share of the secret key
type RingtailState ¶
type RingtailState struct {
Generation uint64
Threshold int
Parties []party.ID
PublicKey *RingtailPublicKey
PreprocessingStore map[string]*RingtailOfflineData
ConsumedPreproc map[string]bool
}
RingtailState maintains the current state of the Ringtail instance
type SchnorrFullSig ¶
func (*SchnorrFullSig) Serialize ¶
func (s *SchnorrFullSig) Serialize() []byte
type SchnorrPartialSig ¶
Schnorr signature components
func (*SchnorrPartialSig) GetPartyID ¶
func (s *SchnorrPartialSig) GetPartyID() party.ID
func (*SchnorrPartialSig) Serialize ¶
func (s *SchnorrPartialSig) Serialize() []byte
type SecretPoly ¶
type SecretPoly struct {
Coeffs []F // Secret-shared coefficients
}
SecretPoly is a Shamir-shared polynomial
type Sig ¶
type Sig struct {
C Poly // Challenge polynomial
Z []Poly // Response vector
H Hints // Hint positions
}
Sig is an ML-DSA signature
type SigHashType ¶
type SigHashType uint32
SigHashType represents Bitcoin signature hash types
const ( SigHashDefault SigHashType = 0x00 SigHashAll SigHashType = 0x01 SigHashNone SigHashType = 0x02 SigHashSingle SigHashType = 0x03 SigHashAnyOneCanPay SigHashType = 0x80 )
type SignParams ¶
type SignParams struct {
Params MLDSAParams
Omega int
DeriveC func(mu []byte, wH []Poly) (Poly, error)
PubMul func(a, b Poly) Poly
}
SignParams holds signing parameters
type SignatureType ¶
type SignatureType int
SignatureType defines the signature algorithm
const ( SignatureECDSA SignatureType = iota SignatureEdDSA SignatureSchnorr SignatureBLS SignatureRingtail // Post-quantum lattice-based SignatureDilithium // Post-quantum ML-DSA (NIST standard) )
type SignerAdapter ¶
type SignerAdapter interface {
// Digest computes chain-specific message digest
Digest(tx interface{}) ([]byte, error)
// SignEC creates a partial signature with a party's share
SignEC(digest []byte, share Share) (PartialSig, error)
// AggregateEC combines partial signatures into a full signature
AggregateEC(parts []PartialSig) (FullSig, error)
// Encode converts signature to chain-specific wire format
Encode(full FullSig) ([]byte, error)
// ValidateConfig checks if configuration is valid for this chain
ValidateConfig(config *UnifiedConfig) error
}
SignerAdapter is the common interface for all chain-specific adapters
type SolanaAdapter ¶
type SolanaAdapter struct {
// contains filtered or unexported fields
}
SolanaAdapter implements SignerAdapter for Solana
func NewSolanaAdapter ¶
func NewSolanaAdapter() *SolanaAdapter
NewSolanaAdapter creates a new Solana adapter
func (*SolanaAdapter) AggregateEC ¶
func (s *SolanaAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Ed25519 partial signatures
func (*SolanaAdapter) ComputeProgramDerivedAddress ¶
func (s *SolanaAdapter) ComputeProgramDerivedAddress(programID [32]byte, seeds [][]byte) ([32]byte, byte, error)
ComputeProgramDerivedAddress computes a PDA for threshold wallets
func (*SolanaAdapter) CreateMultisigAccount ¶
func (s *SolanaAdapter) CreateMultisigAccount(signers [][32]byte, threshold byte) ([]byte, error)
CreateMultisigAccount creates a Solana multisig account
func (*SolanaAdapter) CreateTokenTransferInstruction ¶
func (s *SolanaAdapter) CreateTokenTransferInstruction(amount uint64, decimals byte) *SolanaInstruction
CreateTokenTransferInstruction creates SPL token transfer instruction
func (*SolanaAdapter) CreateTransferInstruction ¶
func (s *SolanaAdapter) CreateTransferInstruction(from, to [32]byte, lamports uint64) *SolanaInstruction
CreateTransferInstruction creates a SOL transfer instruction
func (*SolanaAdapter) Digest ¶
func (s *SolanaAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Solana transaction digest
func (*SolanaAdapter) Encode ¶
func (s *SolanaAdapter) Encode(full FullSig) ([]byte, error)
Encode formats Ed25519 signature for Solana
func (*SolanaAdapter) EstimateComputeUnits ¶
func (s *SolanaAdapter) EstimateComputeUnits(numSignatures int) uint32
EstimateComputeUnits estimates compute units for threshold operations
func (*SolanaAdapter) GetRentExemptBalance ¶
func (s *SolanaAdapter) GetRentExemptBalance(dataSize int) uint64
GetRentExemptBalance calculates rent-exempt balance for account
func (*SolanaAdapter) SignEC ¶
func (s *SolanaAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates Ed25519 partial signature for Solana
func (*SolanaAdapter) ValidateConfig ¶
func (s *SolanaAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Solana-specific configuration
func (*SolanaAdapter) VerifyEd25519Signature ¶
func (s *SolanaAdapter) VerifyEd25519Signature(pubkey [32]byte, message []byte, signature [64]byte) bool
VerifyEd25519Signature verifies an Ed25519 signature on-chain
type SolanaConfig ¶
type SolanaConfig struct {
Cluster string // mainnet-beta, testnet, devnet
CommitmentLevel string // processed, confirmed, finalized
SkipPreflight bool
PreflightCommit string
MaxRetries int
MinContextSlot uint64
}
SolanaConfig represents Solana-specific configuration
func GetDefaultSolanaConfig ¶
func GetDefaultSolanaConfig(cluster string) *SolanaConfig
GetDefaultConfig returns default Solana configuration
type SolanaInstruction ¶
type SolanaMessage ¶
type SolanaTransaction ¶
type SolanaTransaction struct {
Signatures []Signature
Message *SolanaMessage
}
type StakeAction ¶
type StakeAction struct {
Stake NEARAmount
PublicKey PublicKey
}
func (*StakeAction) Type ¶
func (s *StakeAction) Type() ActionType
type SuiAdapter ¶
type SuiAdapter struct {
// contains filtered or unexported fields
}
SuiAdapter implements SignerAdapter for Sui blockchain Sui uses Ed25519 for signatures and BCS (Binary Canonical Serialization)
func (*SuiAdapter) AggregateEC ¶
func (s *SuiAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Ed25519 partial signatures
func (*SuiAdapter) CreateTransferTransaction ¶
func (s *SuiAdapter) CreateTransferTransaction(from, to SuiAddress, amount uint64) *SuiTransaction
CreateTransferTransaction creates a simple transfer transaction
func (*SuiAdapter) Digest ¶
func (s *SuiAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes Sui transaction digest using Blake2b
func (*SuiAdapter) Encode ¶
func (s *SuiAdapter) Encode(full FullSig) ([]byte, error)
Encode formats Ed25519 signature for Sui with flag byte
func (*SuiAdapter) EstimateGas ¶
func (s *SuiAdapter) EstimateGas(tx *SuiTransaction) uint64
EstimateGas estimates gas for Sui transaction
func (*SuiAdapter) GenerateSuiAddress ¶
func (s *SuiAdapter) GenerateSuiAddress(publicKey [32]byte) SuiAddress
GenerateSuiAddress generates a Sui address from public key
func (*SuiAdapter) SignEC ¶
func (s *SuiAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates Ed25519 partial signature for Sui
func (*SuiAdapter) ValidateConfig ¶
func (s *SuiAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates Sui-specific configuration
type SuiAddress ¶
type SuiAddress [32]byte
type SuiTransaction ¶
type SuiTransaction struct {
Kind TransactionKind
Sender SuiAddress
GasPayment *GasPayment
GasPrice uint64
GasBudget uint64
Expiration *TransactionExpiration
}
type TONAdapter ¶
type TONAdapter struct {
// contains filtered or unexported fields
}
TONAdapter implements SignerAdapter for TON blockchain TON uses Ed25519 for signatures and supports Curve25519 conversion
func NewTONAdapter ¶
func NewTONAdapter(workchain int32) *TONAdapter
NewTONAdapter creates a new TON adapter
func (*TONAdapter) AggregateEC ¶
func (t *TONAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines Ed25519 partial signatures
func (*TONAdapter) CreateWalletStateInit ¶
func (t *TONAdapter) CreateWalletStateInit(publicKey [32]byte, walletID uint32) *TONStateInit
CreateWalletStateInit creates initial state for TON wallet
func (*TONAdapter) Digest ¶
func (t *TONAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes TON message digest using BOC (Bag of Cells) hash
func (*TONAdapter) Encode ¶
func (t *TONAdapter) Encode(full FullSig) ([]byte, error)
Encode formats Ed25519 signature for TON
func (*TONAdapter) EstimateGas ¶
func (t *TONAdapter) EstimateGas(msg *TONMessage) uint64
EstimateGas estimates gas for TON transaction
func (*TONAdapter) GenerateTONAddress ¶
func (t *TONAdapter) GenerateTONAddress(publicKey [32]byte) TONAddress
GenerateTONAddress generates a TON address from public key
func (*TONAdapter) SignEC ¶
func (t *TONAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC creates Ed25519 partial signature for TON
func (*TONAdapter) ValidateConfig ¶
func (t *TONAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig validates TON-specific configuration
type TONAddress ¶
type TONCurrencyCollection ¶
type TONMessage ¶
type TONMessage struct {
Info TONMessageInfo
Init *TONStateInit // Optional
Body []byte
}
type TONMessageInfo ¶
type TONMessageInfo struct {
IHRDisabled bool
Bounce bool
Bounced bool
Source TONAddress
Destination TONAddress
Value TONCurrencyCollection
IHRFee uint64
FwdFee uint64
CreatedLt uint64
CreatedAt uint32
}
type TONStateInit ¶
type TONTransaction ¶
type TONTransaction struct {
Account TONAddress
Lt uint64
PrevTransHash [32]byte
PrevTransLt uint64
Now uint32
OutMsgCount uint16
OrigStatus AccountStatus
EndStatus AccountStatus
InMsg *TONMessage
OutMsgs []*TONMessage
}
type ThresholdConfig ¶
type ThresholdConfig struct {
Subset []party.ID // Active signers (m >= t)
Alpha map[party.ID]F // Shamir x-coordinates (non-zero)
T int // Threshold
N int // Total parties
Q F // Field modulus
}
ThresholdConfig describes the active subset and Shamir parameters
type TransactionBody ¶
type TransactionBody struct {
Inputs []TransactionInput
Outputs []TransactionOutput
Fee uint64
TTL uint32 // Time to live (slot)
Certificates []Certificate
Withdrawals map[string]uint64 // Stake address -> amount
Update *ProtocolUpdate
AuxDataHash [32]byte
ValidityInterval *ValidityInterval
Mint map[PolicyID]map[AssetName]int64
ScriptDataHash [32]byte
Collateral []TransactionInput
RequiredSigners [][28]byte // Key hashes
NetworkID byte
CollateralReturn *TransactionOutput
TotalCollateral uint64
ReferenceInputs []TransactionInput
}
type TransactionExpiration ¶
type TransactionExpiration struct {
Epoch uint64
}
type TransactionInput ¶
type TransactionKind ¶
type TransactionKind interface {
Type() TransactionType
}
type TransactionOutput ¶
type TransactionOutput struct {
Address CardanoAddress
Value Value
DatumHash *[32]byte // Optional for smart contracts
Data []byte // Inline datum (Babbage era)
Script []byte // Reference script (Babbage era)
}
type TransactionType ¶
type TransactionType byte
const ( TransferObject TransactionType = iota Publish MoveCall TransferSui ChangeEpoch Pay PaySui PayAllSui ProgrammableTransaction )
type TransactionWitnessSet ¶
type TransactionWitnessSet struct {
VKeyWitnesses []VKeyWitness
Scripts []Script
PlutusData [][]byte
Redeemers []Redeemer
NativeScripts []NativeScript
}
type TransferAction ¶
type TransferAction struct {
Deposit NEARAmount
}
func (*TransferAction) Type ¶
func (t *TransferAction) Type() ActionType
type UnifiedConfig ¶
type UnifiedConfig struct {
// Common fields
ID party.ID
Threshold int
Generation uint64
PartyIDs []party.ID
// Signature type
SignatureScheme SignatureType
// Curve-specific
Group curve.Curve
// Shared secrets (works for both EC and PQ)
PublicKey interface{} // curve.Point for EC, lattice public key for PQ
// Additional scheme-specific data
ECDSAConfig *ECDSAExtensions
EdDSAConfig *EdDSAExtensions
RingtailConfig *RingtailExtensions
DilithiumConfig *DilithiumExtensions
VerificationShares map[party.ID]interface{}
}
UnifiedConfig represents configuration for unified LSS
type VKeyWitness ¶
type ValidityInterval ¶
type XRPLAdapter ¶
type XRPLAdapter struct {
// contains filtered or unexported fields
}
XRPLAdapter implements SignerAdapter for XRPL
func NewXRPLAdapter ¶
func NewXRPLAdapter(sigType SignatureType, multiSign bool) *XRPLAdapter
NewXRPLAdapter creates a new XRPL adapter
func (*XRPLAdapter) AggregateEC ¶
func (x *XRPLAdapter) AggregateEC(parts []PartialSig) (FullSig, error)
AggregateEC combines partial signatures
func (*XRPLAdapter) Digest ¶
func (x *XRPLAdapter) Digest(tx interface{}) ([]byte, error)
Digest computes XRPL transaction digest with appropriate prefix
func (*XRPLAdapter) Encode ¶
func (x *XRPLAdapter) Encode(full FullSig) ([]byte, error)
Encode formats signature for XRPL wire format
func (*XRPLAdapter) FormatPublicKey ¶
func (x *XRPLAdapter) FormatPublicKey(pubKey curve.Point) string
FormatPublicKey formats public key for XRPL with appropriate prefix
func (*XRPLAdapter) GetSignerListEntry ¶
func (x *XRPLAdapter) GetSignerListEntry(config *UnifiedConfig, weight uint16) map[string]interface{}
GetSignerListEntry creates XRPL SignerListSet entry for this configuration
func (*XRPLAdapter) SignEC ¶
func (x *XRPLAdapter) SignEC(digest []byte, share Share) (PartialSig, error)
SignEC performs threshold signing for XRPL
func (*XRPLAdapter) ValidateConfig ¶
func (x *XRPLAdapter) ValidateConfig(config *UnifiedConfig) error
ValidateConfig checks if the configuration is valid for XRPL
type XRPLHashPrefix ¶
type XRPLHashPrefix [4]byte
XRPLHashPrefix defines XRPL transaction hash prefixes
type XRPLTransaction ¶
type XRPLTransaction struct {
Account string
TransactionType string
Destination string
Amount string
Fee string
Sequence uint32
SigningPubKey string
TxnSignature string
}
XRPLTransaction represents a simplified XRPL transaction
func ParseSignedTransaction ¶
func ParseSignedTransaction(blob []byte, signature []byte) (*XRPLTransaction, error)
ParseSignedTransaction parses a signed XRPL transaction