Documentation
¶
Overview ¶
* This package contains intermediary events that are used only by the covenantless version * they let to sign the vtxo tree using musig2 algorithm * they are not included in domain because they don't mutate the Round state and should not be persisted
Index ¶
- Constants
- Variables
- type AcceptedOffchainTx
- type AdminService
- type Asset
- type AssetInput
- type Batch
- type BatchStarted
- type ChainTx
- type ChainTxType
- type CommitmentTxInfo
- type DeprecatedSignerKey
- type FeeInfo
- type ForfeitTxsResp
- type GetVtxosResp
- type IndexerService
- type Intent
- type IntentInfo
- type NextScheduledSession
- type OpMetric
- type Outpoint
- type Page
- type PageResp
- type Receiver
- type RoundDetails
- type RoundFailed
- type RoundFinalized
- type RoundMetrics
- type RoundReport
- type RoundReportService
- type RoundSigningStarted
- type RoundStats
- type ScheduledSweep
- type Service
- type ServiceInfo
- type StageMetric
- type SweepableOutput
- type TeleportAsset
- type TokenEntry
- type TransactionEvent
- type TransactionEventType
- type TreeNoncesAggregated
- type TreeSignatureMessage
- type TreeTx
- type TreeTxMessage
- type TreeTxNoncesEvent
- type TreeTxResp
- type TxData
- type TxType
- type VOut
- type VirtualTxsResp
- type VtxoChainResp
- type VtxoTreeLeavesResp
- type WalletStatus
Constants ¶
View Source
const ( SelectIntentsStage = "select_intents_stage" ConfirmationStage = "confirmation_stage" BuildCommitmentTxStage = "build_commitment_tx_stage" TreeSigningStage = "tree_signing_stage" ForfeitTxsCollectionStage = "forfeit_txs_collection_stage" SignAndPublishCommitmentTxStage = "sign_and_publish_commitment_tx_stage" SendConfirmationEventOp = "send_confiration_event_op" WaitForConfirmationOp = "wait_for_confiration_op" BuildCommitmentTxOp = "build_commitment_tx_op" CreateTreeNoncesOp = "create_tree_nonces_op" SendUnsignedTreeEventOp = "send_unsigned_tree_event_op" WaitForTreeNoncesOp = "wait_for_tree_nonces_op" AggregateNoncesOp = "aggregate_nonces_op" SendAggregatedTreeNoncesEventOp = "send_aggregated_tree_nonces_event_op" SignTreeOp = "sign_tree_op" WaitForTreeSignaturesOp = "wait_for_tree_signatures_op" AggregateTreeSignaturesOp = "aggregate_tree_signatures_op" SendSignedTreeEventOp = "send_signed_tree_event_op" VerifyForfeitsSignaturesOp = "verify_forfeits_signatures_op" WaitForForfeitTxsOp = "wait_for_forfeit_txs_op" VerifyBoardingInputsSignaturesOp = "verify_boarding_inputs_signatures_op" SignCommitmentTxOp = "sign_commitment_tx_op" PublishCommitmentTxOp = "publish_commitment_tx_op" )
Variables ¶
View Source
var ErrInvalidInput = errors.New("invalid input")
Functions ¶
This section is empty.
Types ¶
type AcceptedOffchainTx ¶ added in v0.8.9
type AdminService ¶
type AdminService interface {
Wallet() ports.WalletService
GetScheduledSweeps(ctx context.Context) ([]ScheduledSweep, error)
GetRoundDetails(ctx context.Context, roundId string) (*RoundDetails, error)
GetRounds(
ctx context.Context, after, before int64, withFailed, withCompleted bool,
) ([]string, error)
GetExpiredRounds(ctx context.Context) ([]domain.ExpiredRound, error)
GetWalletAddress(ctx context.Context) (string, error)
GetWalletStatus(ctx context.Context) (*WalletStatus, error)
GetMainAccountUtxos(ctx context.Context) ([]ports.WalletUtxo, error)
CreateNotes(ctx context.Context, amount uint32, quantity int) ([]string, error)
GetScheduledSession(ctx context.Context) (*domain.ScheduledSession, error)
UpdateScheduledSession(ctx context.Context, updates domain.ScheduledSessionUpdate) error
ClearScheduledSession(ctx context.Context) error
ListIntents(ctx context.Context, intentIds ...string) ([]IntentInfo, error)
DeleteIntents(ctx context.Context, intentIds ...string) error
GetBatchFees(ctx context.Context) (*domain.BatchFees, error)
UpdateBatchFees(ctx context.Context, updates domain.BatchFeesUpdate) error
ClearBatchFees(ctx context.Context) error
GetConvictionsByIds(ctx context.Context, ids []string) ([]domain.Conviction, error)
GetConvictions(ctx context.Context, from, to time.Time) ([]domain.Conviction, error)
GetConvictionsByRound(ctx context.Context, roundID string) ([]domain.Conviction, error)
GetActiveScriptConvictions(
ctx context.Context, script string,
) ([]domain.ScriptConviction, error)
PardonConviction(ctx context.Context, id string) error
BanScript(ctx context.Context, script, reason string, banDuration *time.Duration) error
Sweep(
ctx context.Context, withConnectors bool, commitmentTxids []string,
) (string, string, error)
GetExpiringLiquidity(ctx context.Context, after, before int64) (uint64, error)
GetRecoverableLiquidity(ctx context.Context) (uint64, error)
GetSettings(ctx context.Context) (*domain.Settings, error)
UpdateSettings(ctx context.Context, settings domain.SettingsUpdate) ([]string, error)
GetCollectedFees(ctx context.Context, after, before int64) (uint64, error)
}
func NewAdminService ¶
func NewAdminService( walletSvc ports.WalletService, repoManager ports.RepoManager, txBuilder ports.TxBuilder, liveStoreSvc ports.LiveStore, timeUnit ports.TimeUnit, feeManager ports.FeeManager, ) AdminService
type AssetInput ¶ added in v0.9.0
type AssetInput struct {
asset.AssetInput
AssetId string
}
type BatchStarted ¶
type BatchStarted struct {
domain.RoundEvent
IntentIdsHashes [][32]byte
BatchExpiry uint32
}
the user should react to this event by confirming the registration using intent_id
type ChainTxType ¶
type ChainTxType string
const ( IndexerChainedTxTypeUnspecified ChainTxType = "unspecified" IndexerChainedTxTypeCommitment ChainTxType = "commitment" IndexerChainedTxTypeArk ChainTxType = "ark" IndexerChainedTxTypeTree ChainTxType = "tree" IndexerChainedTxTypeCheckpoint ChainTxType = "checkpoint" )
type CommitmentTxInfo ¶
type DeprecatedSignerKey ¶ added in v0.9.9
type ForfeitTxsResp ¶
type GetVtxosResp ¶
type IndexerService ¶
type IndexerService interface {
GetCommitmentTxInfo(ctx context.Context, txid string) (*CommitmentTxInfo, error)
GetVtxoTree(ctx context.Context, batchOutpoint Outpoint, page *Page) (*TreeTxResp, error)
GetVtxoTreeLeaves(
ctx context.Context, batchOutpoint Outpoint, page *Page,
) (*VtxoTreeLeavesResp, error)
GetForfeitTxs(ctx context.Context, txid string, page *Page) (*ForfeitTxsResp, error)
GetConnectors(ctx context.Context, txid string, page *Page) (*TreeTxResp, error)
GetVtxos(
ctx context.Context,
pubkeys []string, spendableOnly, spendOnly, recoverableOnly, pendingOnly bool,
after, before int64, page *Page,
) (*GetVtxosResp, error)
GetVtxosByOutpoint(
ctx context.Context, outpoints []Outpoint, page *Page,
) (*GetVtxosResp, error)
GetVtxoChain(
ctx context.Context, authToken string, vtxoKey Outpoint, page *Page,
) (*VtxoChainResp, error)
GetVtxoChainByIntent(ctx context.Context, intent Intent, page *Page) (*VtxoChainResp, error)
GetVirtualTxs(
ctx context.Context, authToken string, txids []string, page *Page,
) (*VirtualTxsResp, error)
GetVirtualTxsByIntent(ctx context.Context, intent Intent, page *Page) (*VirtualTxsResp, error)
GetBatchSweepTxs(ctx context.Context, batchOutpoint Outpoint) ([]string, error)
GetAsset(ctx context.Context, assetID string) ([]Asset, error)
ListTokens(ctx context.Context, token, hash, outpoint, txid string) ([]TokenEntry, error)
RevokeTokens(ctx context.Context, token, hash, outpoint, txid string) (int, error)
}
func NewIndexerService ¶
func NewIndexerService( repoManager ports.RepoManager, wallet ports.WalletService, privkey *btcec.PrivateKey, signerPubkey *btcec.PublicKey, deprecatedSignerPubkeys []ports.DeprecatedSignerPubkey, txExposure string, authTokenExpirySec int64, ) (IndexerService, error)
type IntentInfo ¶
type NextScheduledSession ¶ added in v0.8.0
type RoundDetails ¶
type RoundFailed ¶ added in v0.8.0
type RoundFailed struct {
domain.RoundFailed
Topic []string
}
type RoundFinalized ¶
type RoundFinalized struct {
domain.RoundFinalized
Txid string
}
type RoundMetrics ¶ added in v0.8.0
type RoundMetrics struct {
Latency float64 // seconds
CPU float64 // seconds
CoreEq float64 // equivalent CPU cores used (CPU time / wall-clock time)
UtilizedPct float64 // CPU utilization percentage across all logical cores
MemAllocDelta float64 // MB
MemSysDelta float64 // MB
MemTotalAllocDelta float64 // MB
GCDelta uint32
}
type RoundReport ¶ added in v0.8.0
type RoundReport struct {
RoundID string `json:"round_id"`
Stats RoundStats `json:"round_stats"`
Metrics RoundMetrics `json:"round_metrics"`
Stages map[string]StageMetric `json:"stages"`
Ops map[string]OpMetric `json:"ops"`
}
type RoundReportService ¶ added in v0.8.0
type RoundReportService interface {
RoundStarted(roundID string)
SetIntentsNum(numIntents int)
RoundEnded(commitmentTxID string, totalInputs int, totalOutputs int, numTreeNodes int)
StageStarted(stage string)
StageEnded(stage string)
OpStarted(op string)
OpEnded(op string)
Report() <-chan *RoundReport
Close()
}
func NewRoundReportService ¶ added in v0.8.0
func NewRoundReportService() RoundReportService
type RoundSigningStarted ¶
type RoundSigningStarted struct {
domain.RoundEvent
UnsignedCommitmentTx string
CosignersPubkeys []string
}
signer should react to this event by generating a musig2 nonce for each transaction in the tree
func (RoundSigningStarted) GetTopic ¶
func (r RoundSigningStarted) GetTopic() string
implement domain.RoundEvent interface
type RoundStats ¶ added in v0.8.0
type ScheduledSweep ¶
type ScheduledSweep struct {
RoundId string
Confirmed bool
SweepableOutputs []SweepableOutput
}
type Service ¶
type Service interface {
Start() error
Stop()
RegisterIntent(
ctx context.Context, proof intent.Proof, message intent.RegisterMessage,
) (string, errors.Error)
EstimateIntentFee(
ctx context.Context, proof intent.Proof, message intent.EstimateIntentFeeMessage,
) (int64, errors.Error)
ConfirmRegistration(ctx context.Context, intentId string) errors.Error
SubmitForfeitTxs(ctx context.Context, forfeitTxs []string) errors.Error
SignCommitmentTx(ctx context.Context, commitmentTx string) errors.Error
GetEventsChannel(ctx context.Context) <-chan []domain.Event
GetInfo(ctx context.Context) (*ServiceInfo, errors.Error)
SubmitOffchainTx(
ctx context.Context, checkpointTxs []string, signedArkTx string,
) (tx *AcceptedOffchainTx, err errors.Error)
FinalizeOffchainTx(ctx context.Context, txid string, finalCheckpoints []string) errors.Error
GetPendingOffchainTxs(
ctx context.Context, proof intent.Proof, message intent.GetPendingTxMessage,
) ([]AcceptedOffchainTx, errors.Error)
// Tree signing methods
RegisterCosignerNonces(
ctx context.Context, roundId, pubkey string, nonces tree.TreeNonces,
) errors.Error
RegisterCosignerSignatures(
ctx context.Context, roundId, pubkey string, signatures tree.TreePartialSigs,
) errors.Error
GetTxEventsChannel(ctx context.Context) <-chan TransactionEvent
DeleteIntentsByProof(
ctx context.Context, proof intent.Proof, message intent.DeleteMessage,
) errors.Error
// TODO: remove when detaching the indexer svc.
GetIndexerTxChannel(ctx context.Context) <-chan TransactionEvent
GetIntentByTxid(ctx context.Context, txid string) (*domain.Intent, errors.Error)
GetIntentByProofs(
ctx context.Context, proof intent.Proof, message intent.GetIntentMessage,
) ([]*domain.Intent, errors.Error)
}
func NewService ¶
func NewService( wallet ports.WalletService, signer ports.SignerService, repoManager ports.RepoManager, builder ports.TxBuilder, scanner ports.BlockchainScanner, scheduler ports.SchedulerService, cache ports.LiveStore, reportSvc RoundReportService, alerts ports.Alerts, feeManager ports.FeeManager, ) (Service, error)
type ServiceInfo ¶
type ServiceInfo struct {
SignerPubKey string
DeprecatedSignerKeys []DeprecatedSignerKey
ForfeitPubKey string
UnilateralExitDelay int64
BoardingExitDelay int64
SessionDuration int64
Network string
Dust uint64
ForfeitAddress string
NextScheduledSession *NextScheduledSession
UtxoMinAmount int64
UtxoMaxAmount int64
VtxoMinAmount int64
VtxoMaxAmount int64
CheckpointTapscript string
Fees FeeInfo
MaxTxWeight int64
MaxOpReturnOutputs int64
Digest string
}
type StageMetric ¶ added in v0.8.0
type StageMetric struct{ Latency float64 } // seconds
type SweepableOutput ¶
type TeleportAsset ¶ added in v0.9.0
type TokenEntry ¶ added in v0.9.3
type TransactionEvent ¶
type TransactionEventType ¶
type TransactionEventType string
const ( CommitmentTxType TransactionEventType = "commitment_tx" ArkTxType TransactionEventType = "ark_tx" SweepTxType TransactionEventType = "sweep_tx" )
type TreeNoncesAggregated ¶
type TreeNoncesAggregated struct {
domain.RoundEvent
Nonces tree.TreeNonces // aggregated nonces
}
signer should react to this event by partially signing the vtxo tree transactions then, delete its ephemeral key
func (TreeNoncesAggregated) GetTopic ¶
func (r TreeNoncesAggregated) GetTopic() string
type TreeSignatureMessage ¶
type TreeSignatureMessage struct {
domain.RoundEvent
Topic []string
BatchIndex int32
Txid string
Signature string
}
func (TreeSignatureMessage) GetTopic ¶
func (r TreeSignatureMessage) GetTopic() string
type TreeTx ¶
type TreeTx = tree.TxTreeNode
type TreeTxMessage ¶
type TreeTxMessage struct {
domain.RoundEvent
Topic []string
BatchIndex int32
Node tree.TxTreeNode
}
func (TreeTxMessage) GetTopic ¶
func (r TreeTxMessage) GetTopic() string
type TreeTxNoncesEvent ¶ added in v0.8.0
type TreeTxNoncesEvent struct {
domain.RoundEvent
Txid string
Topic []string
Nonces map[string]*tree.Musig2Nonce // pubkey -> nonces
}
func (TreeTxNoncesEvent) GetTopic ¶ added in v0.8.0
func (r TreeTxNoncesEvent) GetTopic() string
type TreeTxResp ¶
type VirtualTxsResp ¶
type VtxoChainResp ¶
type VtxoTreeLeavesResp ¶
type WalletStatus ¶
Click to show internal directories.
Click to hide internal directories.