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 ¶
- Variables
- type AdminService
- type ArkProviderBalance
- type Balance
- type NextMarketHour
- type OwnershipProof
- type RedeemTransactionEvent
- type RoundDetails
- type RoundSigningNoncesGenerated
- type RoundSigningStarted
- type RoundTransactionEvent
- type ScheduledSweep
- type Service
- type ServiceInfo
- type SignedVtxoOutpoint
- type SweepableOutput
- type TransactionEvent
- type TransactionEventType
- type TxRequestInfo
- type WalletStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTreeSigningNotRequired = fmt.Errorf("tree signing is not required on this ark (covenant)")
)
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) }
func NewAdminService ¶
func NewAdminService(walletSvc ports.WalletService, repoManager ports.RepoManager, txBuilder ports.TxBuilder, timeUnit ports.TimeUnit) AdminService
type ArkProviderBalance ¶
type NextMarketHour ¶
type OwnershipProof ¶
type OwnershipProof struct { ControlBlock *txscript.ControlBlock Script []byte Signature *schnorr.Signature }
OwnershipProof is a proof that the owner of a vtxo has the secret key able to sign the forfeit leaf.
type RedeemTransactionEvent ¶
type RedeemTransactionEvent struct { RedeemTxid string SpentVtxos []domain.VtxoKey SpendableVtxos []domain.Vtxo }
func (RedeemTransactionEvent) Type ¶
func (a RedeemTransactionEvent) Type() TransactionEventType
type RoundDetails ¶
type RoundSigningNoncesGenerated ¶
type RoundSigningNoncesGenerated struct { Id string Nonces bitcointree.TreeNonces // aggregated nonces }
signer should react to this event by partially signing the vtxo tree transactions then, delete its ephemeral key
func (RoundSigningNoncesGenerated) IsEvent ¶
func (r RoundSigningNoncesGenerated) IsEvent()
func (RoundSigningNoncesGenerated) SerializeNonces ¶
func (e RoundSigningNoncesGenerated) SerializeNonces() (string, error)
type RoundSigningStarted ¶
type RoundSigningStarted struct { Id string UnsignedVtxoTree tree.VtxoTree UnsignedRoundTx string CosignersPubkeys []string }
signer should react to this event by generating a musig2 nonce for each transaction in the tree
func (RoundSigningStarted) IsEvent ¶
func (r RoundSigningStarted) IsEvent()
implement domain.RoundEvent interface
type RoundTransactionEvent ¶
type RoundTransactionEvent struct { RoundTxid string SpentVtxos []domain.VtxoKey SpendableVtxos []domain.Vtxo ClaimedBoardingInputs []domain.VtxoKey }
func (RoundTransactionEvent) Type ¶
func (r RoundTransactionEvent) Type() TransactionEventType
type ScheduledSweep ¶
type ScheduledSweep struct { RoundId string SweepableOutputs []SweepableOutput }
type Service ¶
type Service interface { Start() error Stop() SpendNotes(ctx context.Context, notes []note.Note) (string, error) SpendVtxos(ctx context.Context, inputs []ports.Input) (string, error) ClaimVtxos(ctx context.Context, creds string, receivers []domain.Receiver, musig2Data *tree.Musig2) error SignVtxos(ctx context.Context, forfeitTxs []string) error SignRoundTx(ctx context.Context, roundTx string) error GetRoundByTxid(ctx context.Context, roundTxid string) (*domain.Round, error) GetRoundById(ctx context.Context, id string) (*domain.Round, error) GetCurrentRound(ctx context.Context) (*domain.Round, error) GetEventsChannel(ctx context.Context) <-chan domain.RoundEvent UpdateTxRequestStatus(ctx context.Context, requestID string) error ListVtxos( ctx context.Context, address string, ) (spendableVtxos, spentVtxos []domain.Vtxo, err error) GetInfo(ctx context.Context) (*ServiceInfo, error) SubmitRedeemTx(ctx context.Context, redeemTx string) (signedRedeemTx, redeemTxid string, err error) GetBoardingAddress( ctx context.Context, userPubkey *secp256k1.PublicKey, ) (address string, scripts []string, err error) // Tree signing methods RegisterCosignerNonces( ctx context.Context, roundID string, pubkey *secp256k1.PublicKey, nonces string, ) error RegisterCosignerSignatures( ctx context.Context, roundID string, pubkey *secp256k1.PublicKey, signatures string, ) error GetTransactionEventsChannel(ctx context.Context) <-chan TransactionEvent SetNostrRecipient(ctx context.Context, nostrRecipient string, signedVtxoOutpoints []SignedVtxoOutpoint) error DeleteNostrRecipient(ctx context.Context, signedVtxoOutpoints []SignedVtxoOutpoint) error GetMarketHourConfig(ctx context.Context) (*domain.MarketHour, error) UpdateMarketHourConfig(ctx context.Context, marketHourStartTime, marketHourEndTime time.Time, period, roundInterval time.Duration) error GetTxRequestQueue(ctx context.Context, requestIds ...string) ([]TxRequestInfo, error) DeleteTxRequests(ctx context.Context, requestIds ...string) error }
func NewCovenantService ¶
func NewCovenantService( network common.Network, roundInterval int64, vtxoTreeExpiry, unilateralExitDelay, boardingExitDelay common.RelativeLocktime, nostrDefaultRelays []string, walletSvc ports.WalletService, repoManager ports.RepoManager, builder ports.TxBuilder, scanner ports.BlockchainScanner, scheduler ports.SchedulerService, notificationPrefix string, marketHourStartTime, marketHourEndTime time.Time, marketHourPeriod, marketHourRoundInterval time.Duration, ) (Service, error)
func NewCovenantlessService ¶
func NewCovenantlessService( network common.Network, roundInterval int64, vtxoTreeExpiry, unilateralExitDelay, boardingExitDelay common.RelativeLocktime, nostrDefaultRelays []string, walletSvc ports.WalletService, repoManager ports.RepoManager, builder ports.TxBuilder, scanner ports.BlockchainScanner, scheduler ports.SchedulerService, noteUriPrefix string, marketHourStartTime, marketHourEndTime time.Time, marketHourPeriod, marketHourRoundInterval time.Duration, allowZeroFees bool, ) (Service, error)
type ServiceInfo ¶
type SignedVtxoOutpoint ¶
type SignedVtxoOutpoint struct { Outpoint domain.VtxoKey Proof OwnershipProof }
type SweepableOutput ¶
type TransactionEvent ¶
type TransactionEvent interface {
Type() TransactionEventType
}
type TransactionEventType ¶
type TransactionEventType string
const ( RoundTransaction TransactionEventType = "round_tx" RedeemTransaction TransactionEventType = "redeem_tx" )
type TxRequestInfo ¶
type WalletStatus ¶
Click to show internal directories.
Click to hide internal directories.