mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 12:14:21 +01:00
* [btc-embedded] add chainfee.Estimator and extraAPI interfaces * dynamic fee amount * dynamic dust amount * [client] fix linter errors * [domain] fix unit tests * [server] return dust amount in GetInfo RPC * [sdk] fix lnd dependencie * go work sync * fix witness stack size forfeit tx size estimator * remove hardcoded fee values in covenant txbuilder * lower liquid feerate * fix after reviews * go work sync
45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
/*
|
|
* This package contains intermediary events that are used only by the covenantless version
|
|
* they let to sign the congestion tree using musig2 algorithm
|
|
* they are not included in domain because they don't mutate the Round state and should not be persisted
|
|
*/
|
|
package application
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/hex"
|
|
|
|
"github.com/ark-network/ark/common/bitcointree"
|
|
"github.com/ark-network/ark/common/tree"
|
|
"github.com/decred/dcrd/dcrec/secp256k1/v4"
|
|
)
|
|
|
|
// signer should react to this event by generating a musig2 nonce for each transaction in the tree
|
|
type RoundSigningStarted struct {
|
|
Id string
|
|
UnsignedVtxoTree tree.CongestionTree
|
|
Cosigners []*secp256k1.PublicKey
|
|
UnsignedRoundTx string
|
|
}
|
|
|
|
// signer should react to this event by partially signing the vtxo tree transactions
|
|
// then, delete its ephemeral key
|
|
type RoundSigningNoncesGenerated struct {
|
|
Id string
|
|
Nonces bitcointree.TreeNonces // aggregated nonces
|
|
}
|
|
|
|
func (e RoundSigningNoncesGenerated) SerializeNonces() (string, error) {
|
|
var serialized bytes.Buffer
|
|
|
|
if err := e.Nonces.Encode(&serialized); err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return hex.EncodeToString(serialized.Bytes()), nil
|
|
}
|
|
|
|
// implement domain.RoundEvent interface
|
|
func (r RoundSigningStarted) IsEvent() {}
|
|
func (r RoundSigningNoncesGenerated) IsEvent() {}
|