Documentation
¶
Overview ¶
Package adapters - Bitcoin adapter with Taproot support
Package adapters - Cardano adapter for Ed25519 threshold signatures ¶
Package adapters - Ethereum/EVM chain adapter implementation
Package adapters provides chain-specific implementations for threshold signatures ¶
Package adapters - Ringtail post-quantum threshold signature implementation ¶
Package adapters - Solana adapter for Ed25519 threshold signatures ¶
Package adapters - TON blockchain adapter for Ed25519 threshold signatures ¶
Package adapters provides chain-specific implementations for threshold signatures
Index ¶
- Variables
- func GetChainRequirements(chain string) map[string]interface{}
- func GetDefaultCardanoConfig(networkID byte, era CardanoEra) map[string]interface{}
- func GetDefaultTONConfig(workchain int32) map[string]interface{}
- func GetSupportedChains() []string
- func SerializeTxBlob(tx *XRPLTransaction) ([]byte, error)
- type AccessListEntry
- type AccountStatus
- type AdapterFactory
- 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 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 Certificate
- type CertificateType
- type ECDSAExtensions
- type ECDSAFullSig
- type ECDSAPartialSig
- type EIP1559Transaction
- type EIP4844Transaction
- 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 FullSig
- type Input
- type LegacyBitcoinTx
- type LegacyTransaction
- type NativeScript
- type NativeScriptType
- type OfflineRound1
- type OfflineRound2
- type Output
- type PartialSig
- type PolicyID
- type ProtocolParameters
- type ProtocolUpdate
- 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 SegwitTx
- type Share
- type SigHashType
- 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 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 TransactionBody
- type TransactionInput
- type TransactionOutput
- type TransactionWitnessSet
- 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 ¶
This section is empty.
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 GetDefaultTONConfig ¶
GetTONConfig returns default TON configuration
func GetSupportedChains ¶
func GetSupportedChains() []string
GetSupportedChains returns list of supported blockchain networks
func SerializeTxBlob ¶
func SerializeTxBlob(tx *XRPLTransaction) ([]byte, error)
SerializeTxBlob serializes an XRPL transaction to binary format
Types ¶
type AccessListEntry ¶
type AccountStatus ¶
type AccountStatus byte
const ( AccountUninit AccountStatus = iota AccountActive AccountFrozen )
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 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 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 Certificate ¶
type Certificate interface {
Type() CertificateType
}
type CertificateType ¶
type CertificateType byte
const ( StakeRegistration CertificateType = iota StakeDeregistration StakeDelegation PoolRegistration PoolRetirement GenesisKeyDelegation MoveInstantaneousRewards )
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 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 LegacyBitcoinTx ¶
type LegacyBitcoinTx struct {
Version uint32
Inputs []Input
Outputs []Output
LockTime uint32
SigHash SigHashType
}
type LegacyTransaction ¶
type NativeScript ¶
type NativeScript interface {
Type() NativeScriptType
}
type NativeScriptType ¶
type NativeScriptType byte
const ( ScriptPubkey NativeScriptType = iota ScriptAll ScriptAny ScriptNofK InvalidBefore InvalidAfter )
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 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 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 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 SignatureType ¶
type SignatureType int
SignatureType defines the signature algorithm
const ( SignatureECDSA SignatureType = iota SignatureEdDSA SignatureSchnorr SignatureBLS SignatureRingtail // Post-quantum lattice-based )
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 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 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 TransactionInput ¶
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 TransactionWitnessSet ¶
type TransactionWitnessSet struct {
VKeyWitnesses []VKeyWitness
Scripts []Script
PlutusData [][]byte
Redeemers []Redeemer
NativeScripts []NativeScript
}
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
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