Versions in this module Expand all Collapse all v1 v1.21.0 Feb 1, 2024 Changes in this version + const DKGResultHashCachePeriod + const DKGSeedCachePeriod + const DefaultPreParamsGenerationConcurrency + const DefaultPreParamsGenerationDelay + const DefaultPreParamsGenerationTimeout + const DefaultPreParamsPoolSize + const DepositSweepRequiredFundingTxConfirmations + const ProtocolName + var DefaultKeyGenerationConcurrency = runtime.GOMAXPROCS(0) + func DetermineWalletMainUtxo(walletPublicKeyHash [20]byte, bridgeChain BridgeChain, btcChain bitcoin.Chain) (*bitcoin.UnspentTransactionOutput, error) + func EnsureWalletSyncedBetweenChains(walletPublicKeyHash [20]byte, walletMainUtxo *bitcoin.UnspentTransactionOutput, ...) error + func Initialize(ctx context.Context, chain Chain, btcChain bitcoin.Chain, ...) error + type BridgeChain interface + ComputeMainUtxoHash func(mainUtxo *bitcoin.UnspentTransactionOutput) [32]byte + GetDepositRequest func(fundingTxHash bitcoin.Hash, fundingOutputIndex uint32) (*DepositChainRequest, bool, error) + GetPendingRedemptionRequest func(walletPublicKeyHash [20]byte, redeemerOutputScript bitcoin.Script) (*RedemptionRequest, bool, error) + GetWallet func(walletPublicKeyHash [20]byte) (*WalletChainData, error) + PastDepositRevealedEvents func(filter *DepositRevealedEventFilter) ([]*DepositRevealedEvent, error) + type Chain interface + BlockCounter func() (chain.BlockCounter, error) + GetBlockHashByNumber func(blockNumber uint64) ([32]byte, error) + GetBlockNumberByTimestamp func(timestamp uint64) (uint64, error) + OperatorKeyPair func() (*operator.PrivateKey, *operator.PublicKey, error) + Signing func() chain.Signing + type Config struct + KeyGenerationConcurrency int + PreParamsGenerationConcurrency int + PreParamsGenerationDelay time.Duration + PreParamsGenerationTimeout time.Duration + PreParamsPoolSize int + type CoordinationFaultType uint8 + const FaultLeaderIdleness + const FaultLeaderImpersonation + const FaultLeaderMistake + const FaultUnknown + func (cft CoordinationFaultType) String() string + type CoordinationProposal interface + ActionType func() WalletActionType + ValidityBlocks func() uint64 + type CoordinationProposalGenerator interface + Generate func(request *CoordinationProposalRequest) (CoordinationProposal, error) + type CoordinationProposalRequest struct + ActionsChecklist []WalletActionType + WalletOperators []chain.Address + WalletPublicKeyHash [20]byte + type DKGChainResult struct + GroupPublicKey []byte + Members chain.OperatorIDs + MembersHash [32]byte + MisbehavedMembersIndexes []group.MemberIndex + Signatures []byte + SigningMembersIndexes []group.MemberIndex + SubmitterMemberIndex group.MemberIndex + type DKGChainResultHash [32]byte + type DKGParameters struct + ApprovePrecedencePeriodBlocks uint64 + ChallengePeriodBlocks uint64 + SubmissionTimeoutBlocks uint64 + type DKGResultApprovedEvent struct + Approver chain.Address + BlockNumber uint64 + ResultHash DKGChainResultHash + type DKGResultChallengedEvent struct + BlockNumber uint64 + Challenger chain.Address + Reason string + ResultHash DKGChainResultHash + type DKGResultSubmittedEvent struct + BlockNumber uint64 + Result *DKGChainResult + ResultHash DKGChainResultHash + Seed *big.Int + type DKGStartedEvent struct + BlockNumber uint64 + Seed *big.Int + type DKGStartedEventFilter struct + EndBlock *uint64 + Seed []*big.Int + StartBlock uint64 + type DKGState int + const AwaitingResult + const AwaitingSeed + const Challenge + const Idle + type Deposit struct + BlindingFactor [8]byte + Depositor chain.Address + ExtraData *[32]byte + RefundLocktime [4]byte + RefundPublicKeyHash [20]byte + Utxo *bitcoin.UnspentTransactionOutput + Vault *chain.Address + WalletPublicKeyHash [20]byte + func ValidateDepositSweepProposal(validateProposalLogger log.StandardLogger, walletPublicKeyHash [20]byte, ...) ([]*Deposit, error) + func (d *Deposit) Script() ([]byte, error) + type DepositChainRequest struct + Amount uint64 + Depositor chain.Address + ExtraData *[32]byte + RevealedAt time.Time + SweptAt time.Time + TreasuryFee uint64 + Vault *chain.Address + type DepositRevealedEvent struct + Amount uint64 + BlindingFactor [8]byte + BlockNumber uint64 + Depositor chain.Address + FundingOutputIndex uint32 + FundingTxHash bitcoin.Hash + RefundLocktime [4]byte + RefundPublicKeyHash [20]byte + Vault *chain.Address + WalletPublicKeyHash [20]byte + func (dre *DepositRevealedEvent) GetWalletPublicKeyHash() [20]byte + type DepositRevealedEventFilter struct + Depositor []chain.Address + EndBlock *uint64 + StartBlock uint64 + WalletPublicKeyHash [][20]byte + type DepositSweepProposal struct + DepositsKeys []struct{ ... } + DepositsRevealBlocks []*big.Int + SweepTxFee *big.Int + func (dsp *DepositSweepProposal) ActionType() WalletActionType + func (dsp *DepositSweepProposal) Marshal() ([]byte, error) + func (dsp *DepositSweepProposal) Unmarshal(bytes []byte) error + func (dsp *DepositSweepProposal) ValidityBlocks() uint64 + type DistributedKeyGenerationChain interface + ApproveDKGResult func(dkgResult *DKGChainResult) error + AssembleDKGResult func(submitterMemberIndex group.MemberIndex, groupPublicKey *ecdsa.PublicKey, ...) (*DKGChainResult, error) + CalculateDKGResultSignatureHash func(groupPublicKey *ecdsa.PublicKey, misbehavedMembersIndexes []group.MemberIndex, ...) (dkg.ResultSignatureHash, error) + ChallengeDKGResult func(dkgResult *DKGChainResult) error + DKGParameters func() (*DKGParameters, error) + GetDKGState func() (DKGState, error) + IsDKGResultValid func(dkgResult *DKGChainResult) (bool, error) + OnDKGResultApproved func(func(event *DKGResultApprovedEvent)) subscription.EventSubscription + OnDKGResultChallenged func(func(event *DKGResultChallengedEvent)) subscription.EventSubscription + OnDKGResultSubmitted func(func(event *DKGResultSubmittedEvent)) subscription.EventSubscription + OnDKGStarted func(func(event *DKGStartedEvent)) subscription.EventSubscription + PastDKGStartedEvents func(filter *DKGStartedEventFilter) ([]*DKGStartedEvent, error) + SubmitDKGResult func(dkgResult *DKGChainResult) error + type GroupParameters struct + GroupQuorum int + GroupSize int + HonestThreshold int + func (gp *GroupParameters) DishonestThreshold() int + type GroupSelectionChain interface + SelectGroup func() (*GroupSelectionResult, error) + type GroupSelectionResult struct + OperatorsAddresses chain.Addresses + OperatorsIDs chain.OperatorIDs + type HeartbeatProposal struct + Message [16]byte + func (hp *HeartbeatProposal) ActionType() WalletActionType + func (hp *HeartbeatProposal) Marshal() ([]byte, error) + func (hp *HeartbeatProposal) Unmarshal(bytes []byte) error + func (hp *HeartbeatProposal) ValidityBlocks() uint64 + type HeartbeatRequestedEvent struct + BlockNumber uint64 + Messages []*big.Int + WalletPublicKey []byte + type NewWalletRegisteredEvent struct + BlockNumber uint64 + EcdsaWalletID [32]byte + WalletPublicKeyHash [20]byte + type NewWalletRegisteredEventFilter struct + EcdsaWalletID [][32]byte + EndBlock *uint64 + StartBlock uint64 + WalletPublicKeyHash [][20]byte + type NoopProposal struct + func (np *NoopProposal) ActionType() WalletActionType + func (np *NoopProposal) Marshal() ([]byte, error) + func (np *NoopProposal) Unmarshal([]byte) error + func (np *NoopProposal) ValidityBlocks() uint64 + type RedemptionProposal struct + RedeemersOutputScripts []bitcoin.Script + RedemptionTxFee *big.Int + func (rp *RedemptionProposal) ActionType() WalletActionType + func (rp *RedemptionProposal) Marshal() ([]byte, error) + func (rp *RedemptionProposal) Unmarshal(bytes []byte) error + func (rp *RedemptionProposal) ValidityBlocks() uint64 + type RedemptionRequest struct + Redeemer chain.Address + RedeemerOutputScript bitcoin.Script + RequestedAmount uint64 + RequestedAt time.Time + TreasuryFee uint64 + TxMaxFee uint64 + func ValidateRedemptionProposal(validateProposalLogger log.StandardLogger, walletPublicKeyHash [20]byte, ...) ([]*RedemptionRequest, error) + type RedemptionRequestedEvent struct + BlockNumber uint64 + Redeemer chain.Address + RedeemerOutputScript bitcoin.Script + RequestedAmount uint64 + TreasuryFee uint64 + TxMaxFee uint64 + WalletPublicKeyHash [20]byte + func (rre *RedemptionRequestedEvent) GetWalletPublicKeyHash() [20]byte + type RedemptionRequestedEventFilter struct + EndBlock *uint64 + Redeemer []chain.Address + StartBlock uint64 + WalletPublicKeyHash [][20]byte + type RedemptionTransactionShape uint8 + const RedemptionChangeFirst + const RedemptionChangeLast + type WalletActionType uint8 + const ActionDepositSweep + const ActionHeartbeat + const ActionMovedFundsSweep + const ActionMovingFunds + const ActionNoop + const ActionRedemption + func ParseWalletActionType(value uint8) (WalletActionType, error) + func (wat WalletActionType) String() string + type WalletChainData struct + ClosingStartedAt time.Time + CreatedAt time.Time + EcdsaWalletID [32]byte + MainUtxoHash [32]byte + MovingFundsRequestedAt time.Time + MovingFundsTargetWalletsCommitmentHash [32]byte + PendingMovedFundsSweepRequestsCount uint32 + PendingRedemptionsValue uint64 + State WalletState + type WalletProposalValidatorChain interface + ValidateDepositSweepProposal func(walletPublicKeyHash [20]byte, proposal *DepositSweepProposal, ...) error + ValidateHeartbeatProposal func(walletPublicKeyHash [20]byte, proposal *HeartbeatProposal) error + ValidateRedemptionProposal func(walletPublicKeyHash [20]byte, proposal *RedemptionProposal) error + type WalletState uint8 + const StateClosed + const StateClosing + const StateLive + const StateMovingFunds + const StateTerminated + const StateUnknown + func (ws WalletState) String() string