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
- type AdminService
- type ArkProviderBalance
- type Balance
- type Batch
- type BatchStarted
- type ChainTx
- type ChainTxType
- type CommitmentTxInfo
- type ForfeitTxsResp
- type GetVtxosResp
- type IndexerService
- type IntentInfo
- type NextMarketHour
- type OpMetric
- type Outpoint
- type Page
- type PageResp
- type Receiver
- type RoundDetails
- type RoundFinalized
- type RoundMetrics
- type RoundReport
- type RoundReportService
- type RoundSigningStarted
- type RoundStats
- type ScheduledSweep
- type Service
- type ServiceInfo
- type StageMetric
- type SweepableOutput
- type TransactionEvent
- type TransactionEventType
- type TreeNoncesAggregated
- type TreeSignatureMessage
- type TreeTx
- type TreeTxMessage
- 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 ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 int64, before int64) ([]string, error)
GetWalletAddress(ctx context.Context) (string, error)
GetWalletStatus(ctx context.Context) (*WalletStatus, error)
CreateNotes(ctx context.Context, amount uint32, quantity int) ([]string, error)
GetMarketHourConfig(ctx context.Context) (*domain.MarketHour, error)
UpdateMarketHourConfig(
ctx context.Context,
marketHourStartTime, marketHourEndTime time.Time, period, roundInterval time.Duration,
) error
ListIntents(ctx context.Context, intentIds ...string) ([]IntentInfo, error)
DeleteIntents(ctx context.Context, intentIds ...string) error
}
func NewAdminService ¶
func NewAdminService( walletSvc ports.WalletService, repoManager ports.RepoManager, txBuilder ports.TxBuilder, liveStoreSvc ports.LiveStore, timeUnit ports.TimeUnit, ) AdminService
type ArkProviderBalance ¶
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 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 bool, page *Page,
) (*GetVtxosResp, error)
GetVtxosByOutpoint(
ctx context.Context, outpoints []Outpoint, page *Page,
) (*GetVtxosResp, error)
GetVtxoChain(ctx context.Context, vtxoKey Outpoint, page *Page) (*VtxoChainResp, error)
GetVirtualTxs(ctx context.Context, txids []string, page *Page) (*VirtualTxsResp, error)
GetBatchSweepTxs(ctx context.Context, batchOutpoint Outpoint) ([]string, error)
}
func NewIndexerService ¶
func NewIndexerService(repoManager ports.RepoManager) IndexerService
type IntentInfo ¶
type NextMarketHour ¶
type RoundDetails ¶
type RoundFinalized ¶
type RoundFinalized struct {
domain.RoundFinalized
Txid string
}
type RoundMetrics ¶
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 ¶
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 ¶
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 ¶
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 ¶
type ScheduledSweep ¶
type ScheduledSweep struct {
RoundId string
SweepableOutputs []SweepableOutput
}
type Service ¶
type Service interface {
Start() error
Stop()
RegisterIntent(
ctx context.Context, proof bip322.Signature, message bip322.IntentMessage,
) (string, error)
ConfirmRegistration(ctx context.Context, intentId string) error
SubmitForfeitTxs(ctx context.Context, forfeitTxs []string) error
SignCommitmentTx(ctx context.Context, commitmentTx string) error
GetEventsChannel(ctx context.Context) <-chan []domain.Event
GetInfo(ctx context.Context) (*ServiceInfo, error)
SubmitOffchainTx(
ctx context.Context, checkpointTxs []string, signedArkTx string,
) (signedCheckpoints []string, finalArkTx string, arkTxid string, err error)
FinalizeOffchainTx(ctx context.Context, txid string, finalCheckpoints []string) error
// Tree signing methods
RegisterCosignerNonces(
ctx context.Context, roundId, pubkey string, nonces tree.TreeNonces,
) error
RegisterCosignerSignatures(
ctx context.Context, roundId, pubkey string, signatures tree.TreePartialSigs,
) error
GetTxEventsChannel(ctx context.Context) <-chan TransactionEvent
DeleteIntentsByProof(
ctx context.Context, bip322signature bip322.Signature, message bip322.DeleteIntentMessage,
) error
// TODO: remove when detaching the indexer svc.
GetIndexerTxChannel(ctx context.Context) <-chan TransactionEvent
}
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, vtxoTreeExpiry, unilateralExitDelay, boardingExitDelay arklib.RelativeLocktime, roundInterval, roundMinParticipantsCount, roundMaxParticipantsCount, utxoMaxAmount, utxoMinAmount, vtxoMaxAmount, vtxoMinAmount int64, network arklib.Network, allowCSVBlockType bool, noteUriPrefix string, marketHourStartTime, marketHourEndTime time.Time, marketHourPeriod, marketHourRoundInterval time.Duration, reportSvc RoundReportService, ) (Service, error)
type ServiceInfo ¶
type StageMetric ¶
type StageMetric struct{ Latency float64 } // seconds
type SweepableOutput ¶
type TransactionEvent ¶
type TransactionEventType ¶
type TransactionEventType string
const ( CommitmentTxType TransactionEventType = "commitment_tx" ArkTxType TransactionEventType = "ark_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 TreeTxResp ¶
type VirtualTxsResp ¶
type VtxoChainResp ¶
type VtxoTreeLeavesResp ¶
type WalletStatus ¶
Click to show internal directories.
Click to hide internal directories.