github.com/mit-dci/lit@v0.0.0-20221102210550-8c3d3b49f2ce/qln/magicnums.go (about)

     1  package qln
     2  
     3  import "github.com/mit-dci/lit/btcutil/hdkeychain"
     4  
     5  const (
     6  	UseWallet             = 0 | hdkeychain.HardenedKeyStart
     7  	UseChannelFund        = 20 | hdkeychain.HardenedKeyStart
     8  	UseChannelRefund      = 30 | hdkeychain.HardenedKeyStart
     9  	UseChannelWatchRefund = 31 | hdkeychain.HardenedKeyStart
    10  	UseChannelHAKDBase    = 40 | hdkeychain.HardenedKeyStart
    11  	UseChannelElkrem      = 8888 | hdkeychain.HardenedKeyStart
    12  
    13  	// key derivation path for contract payout keys (the keys the contract pays
    14  	// TO combined with the oracle's signature)
    15  	UseContractPayoutBase = 50 | hdkeychain.HardenedKeyStart
    16  
    17  	// key derivation path for contract spending keys (the keys the contract
    18  	// pays FROM, and the funding TX pays TO)
    19  	UseContractFundMultisig = 51 | hdkeychain.HardenedKeyStart
    20  
    21  	// key derivation path for contract payout PKH (the hash the contract
    22  	// pays TO)
    23  	UseContractPayoutPKH = 52 | hdkeychain.HardenedKeyStart
    24  
    25  	// key derivation path for HTLC pubkeys
    26  	UseHTLCBase = 60 | hdkeychain.HardenedKeyStart
    27  
    28  	// links Id and channel. replaces UseChannelFund
    29  	UseIdKey = 111 | hdkeychain.HardenedKeyStart
    30  
    31  	// high 3 bytes are in sequence, low 3 bytes are in time
    32  	seqMask  = 0xff000000 // assert high byte
    33  	timeMask = 0x21000000 // 1987 to 1988
    34  )
    35  
    36  var (
    37  	BKTChannelData = []byte("channels")
    38  
    39  	//BKTChannel  = []byte("chn") // all channel data is in this bucket.
    40  	BKTPeers    = []byte("pir") // all peer data is in this bucket.
    41  	BKTPeerMap  = []byte("pmp") // map of peer index to pubkey
    42  	BKTChanMap  = []byte("cmp") // map of channel index to outpoint
    43  	BKTWatch    = []byte("wch") // txids & signatures for export to watchtowers
    44  	BKTHTLCOPs  = []byte("hlo") // htlc outpoints to watch
    45  	BKTPayments = []byte("pym") // array of multihop payments
    46  	BKTRCAuth   = []byte("rca") // Remote control authorization
    47  
    48  	KEYIdx      = []byte("idx")  // index for key derivation
    49  	KEYhost     = []byte("hst")  // hostname where peer lives
    50  	KEYnickname = []byte("nick") // nickname where peer lives
    51  
    52  	KEYutxo    = []byte("utx") // serialized utxo for the channel
    53  	KEYState   = []byte("now") // channel state
    54  	KEYElkRecv = []byte("elk") // elkrem receiver
    55  	KEYqclose  = []byte("cls") // channel close outpoint & height
    56  )