Documentation ¶
Index ¶
- Constants
- Variables
- func Announce(priv *btcec.PrivateKey, litport string, litadr string, trackerURL string) error
- func GetStateIdxFromTx(tx *wire.MsgTx, x uint64) uint64
- func Lookup(litadr string, trackerURL string) (string, error)
- func SetStateIdxBits(tx *wire.MsgTx, idx, x uint64) error
- func SpendMultiSigWitStack(pre, sigA, sigB []byte) [][]byte
- type InFlightFund
- type LitNode
- func (nd *LitNode) BreakChannel(q *Qchan) error
- func (nd *LitNode) BuildJusticeSig(q *Qchan) error
- func (nd *LitNode) ChannelHandler(msg lnutil.LitMsg, peer *RemotePeer) error
- func (nd *LitNode) CloseHandler(msg lnutil.LitMsg) error
- func (nd *LitNode) CloseReqHandler(msg lnutil.CloseReqMsg)
- func (nd *LitNode) ConnectedToPeer(peer uint32) bool
- func (nd *LitNode) CoopClose(q *Qchan) error
- func (nd *LitNode) DeltaSigHandler(msg lnutil.DeltaSigMsg, qc *Qchan) error
- func (nd *LitNode) DialPeer(connectAdr string) error
- func (nd *LitNode) FWDHandler(msg lnutil.LitMsg) error
- func (nd *LitNode) FundChannel(peerIdx, cointype uint32, ccap, initSend int64) (uint32, error)
- func (nd *LitNode) GapSigRevHandler(msg lnutil.GapSigRevMsg, q *Qchan) error
- func (nd *LitNode) GetAllQchans() ([]*Qchan, error)
- func (nd *LitNode) GetConnectedPeerList() []PeerInfo
- func (nd *LitNode) GetDHSecret(q *Qchan) ([]byte, error)
- func (nd *LitNode) GetElkremRoot(k portxo.KeyGen) (chainhash.Hash, error)
- func (nd *LitNode) GetLisAddressAndPorts() (string, []string)
- func (nd *LitNode) GetNicknameFromPeerIdx(idx uint32) string
- func (nd *LitNode) GetPeerIdx(pub *btcec.PublicKey, host string) (uint32, error)
- func (nd *LitNode) GetPubHostFromPeerIdx(idx uint32) ([33]byte, string)
- func (nd *LitNode) GetQchan(opArr [36]byte) (*Qchan, error)
- func (nd *LitNode) GetQchanByIdx(cIdx uint32) (*Qchan, error)
- func (nd *LitNode) GetQchanOPfromIdx(cIdx uint32) ([36]byte, error)
- func (nd *LitNode) GetUsePub(k portxo.KeyGen, use uint32) (pubArr [33]byte, err error)
- func (nd *LitNode) IdKey() *btcec.PrivateKey
- func (nd *LitNode) LNDCReader(peer *RemotePeer) error
- func (nd *LitNode) LinkBaseWallet(privKey *[32]byte, birthHeight int32, resync bool, tower bool, host string, ...) error
- func (nd *LitNode) LoadJusticeSig(comnum uint64, pkh [20]byte) ([80]byte, error)
- func (nd *LitNode) NextChannelIdx() (uint32, error)
- func (nd *LitNode) OPEventHandler(OPEventChan chan lnutil.OutPointEvent)
- func (nd *LitNode) OpenDB(filename string) error
- func (nd *LitNode) OutMessager()
- func (nd *LitNode) PeerHandler(msg lnutil.LitMsg, q *Qchan, peer *RemotePeer) error
- func (nd *LitNode) PointReqHandler(msg lnutil.PointReqMsg)
- func (nd LitNode) PointRespHandler(msg lnutil.PointRespMsg) error
- func (nd *LitNode) PopulateQchanMap(peer *RemotePeer) error
- func (nd LitNode) PushChannel(qc *Qchan, amt uint32) error
- func (nd *LitNode) PushPullHandler(routedMsg lnutil.LitMsg, q *Qchan) error
- func (nd *LitNode) QChanAckHandler(msg lnutil.ChanAckMsg, peer *RemotePeer)
- func (nd *LitNode) QChanDescHandler(msg lnutil.ChanDescMsg)
- func (nd *LitNode) QchanInfo(q *Qchan) error
- func (nd *LitNode) ReSendMsg(qc *Qchan) error
- func (nd *LitNode) ReloadQchanState(q *Qchan) error
- func (nd *LitNode) RestoreQchanFromBucket(bkt *bolt.Bucket) (*Qchan, error)
- func (nd *LitNode) RevHandler(msg lnutil.RevMsg, qc *Qchan) error
- func (nd *LitNode) SaveJusticeSig(comnum uint64, pkh [20]byte, txidsig [80]byte) error
- func (nd *LitNode) SaveNicknameForPeerIdx(nickname string, idx uint32) error
- func (nd *LitNode) SaveQChan(q *Qchan) error
- func (nd *LitNode) SaveQchanState(q *Qchan) error
- func (nd *LitNode) SaveQchanUtxoData(q *Qchan) error
- func (nd *LitNode) SelfPushHandler(msg lnutil.LitMsg) error
- func (nd *LitNode) SendChat(peer uint32, chat string) error
- func (nd *LitNode) SendDeltaSig(q *Qchan) error
- func (nd *LitNode) SendGapSigRev(q *Qchan) error
- func (nd *LitNode) SendREV(q *Qchan) error
- func (nd *LitNode) SendSigRev(q *Qchan) error
- func (nd *LitNode) SendWatchComMsg(qc *Qchan, idx uint64) error
- func (nd *LitNode) SetQchanRefund(q *Qchan, refund, hakdBase [33]byte) error
- func (nd *LitNode) ShowJusticeDB() (string, error)
- func (nd *LitNode) SigProofHandler(msg lnutil.SigProofMsg, peer *RemotePeer)
- func (nd *LitNode) SigRevHandler(msg lnutil.SigRevMsg, qc *Qchan) error
- func (nd *LitNode) SignBreakTx(q *Qchan) (*wire.MsgTx, error)
- func (nd *LitNode) SignSimpleClose(q *Qchan, tx *wire.MsgTx) ([64]byte, error)
- func (nd *LitNode) SignState(q *Qchan) ([64]byte, error)
- func (nd *LitNode) SyncWatch(qc *Qchan) error
- func (nd *LitNode) TCPListener(lisIpPort string) (string, error)
- type PeerInfo
- type QCloseData
- type Qchan
- func (q *Qchan) AdvanceElkrem(elk *chainhash.Hash, n2Elk [33]byte) error
- func (q *Qchan) BuildStateTx(mine bool) (*wire.MsgTx, error)
- func (q *Qchan) Coin() uint32
- func (q *Qchan) ElkPoint(mine bool, idx uint64) (p [33]byte, err error)
- func (q *Qchan) GetChanHint(mine bool) uint64
- func (q *Qchan) GetCloseTxos(tx *wire.MsgTx) ([]portxo.PorTxo, error)
- func (q *Qchan) Idx() uint32
- func (q *Qchan) ImFirst() bool
- func (q *Qchan) IngestElkrem(elk *chainhash.Hash) error
- func (q *Qchan) N2ElkPointForThem() (p [33]byte, err error)
- func (q *Qchan) Peer() uint32
- func (q *Qchan) SimpleCloseTx() (*wire.MsgTx, error)
- func (q *Qchan) ToBytes() ([]byte, error)
- func (q *Qchan) VerifySig(sig [64]byte) error
- type RemotePeer
- type SigRevMsg
- type StatCom
- type UWallet
Constants ¶
const ( UseWallet = 0 | hdkeychain.HardenedKeyStart UseChannelFund = 20 | hdkeychain.HardenedKeyStart UseChannelRefund = 30 | hdkeychain.HardenedKeyStart UseChannelWatchRefund = 31 | hdkeychain.HardenedKeyStart UseChannelHAKDBase = 40 | hdkeychain.HardenedKeyStart UseChannelElkrem = 8888 | hdkeychain.HardenedKeyStart UseIdKey = 111 | hdkeychain.HardenedKeyStart )
Variables ¶
var ( BKTChannel = []byte("chn") // all channel data is in this bucket. BKTPeers = []byte("pir") // all peer data is in this bucket. BKTPeerMap = []byte("pmp") // map of peer index to pubkey BKTChanMap = []byte("cmp") // map of channel index to outpoint BKTWatch = []byte("wch") // txids & signatures for export to watchtowers KEYIdx = []byte("idx") // index for key derivation KEYhost = []byte("hst") // hostname where peer lives KEYnickname = []byte("nick") // nickname where peer lives KEYutxo = []byte("utx") // serialized utxo for the channel KEYState = []byte("now") // channel state KEYElkRecv = []byte("elk") // elkrem receiver KEYqclose = []byte("cls") // channel close outpoint & height )
Functions ¶
func GetStateIdxFromTx ¶
GetStateIdxFromTx returns the state index from a commitment transaction. No errors; returns 0 if there is no retrievable index. Takes the xor input X which is derived from the 0th elkrems.
func SetStateIdxBits ¶
SetStateIdxBits modifies the tx in place, setting the sequence and locktime fields to indicate the given state index.
func SpendMultiSigWitStack ¶
the scriptsig to put on a P2SH input. Sigs need to be in order!
Types ¶
type InFlightFund ¶
type InFlightFund struct {
PeerIdx, ChanIdx, Coin uint32
Amt, InitSend int64
// contains filtered or unexported fields
}
InFlightFund is a funding transaction that has not yet been broadcast
func (*InFlightFund) Clear ¶
func (inff *InFlightFund) Clear()
type LitNode ¶
type LitNode struct { LitDB *bolt.DB // place to write all this down LitFolder string // path to save stuff IdentityKey *btcec.PrivateKey // all nodes have a watchtower. but could have a tower without a node Tower watchtower.Watcher // BaseWallet is the underlying wallet which keeps track of utxos, secrets, // and network i/o // map of cointypes to wallets SubWallet map[uint32]UWallet // indicates if multiple wallets are connected MultiWallet bool // cointype of the first (possibly only) wallet connected DefaultCoin uint32 RemoteCons map[uint32]*RemotePeer RemoteMtx sync.Mutex // WatchCon is currently just for the watchtower WatchCon *lndc.LNDConn // merge these later // OmniChan is the channel for the OmniHandler OmniIn chan lnutil.LitMsg OmniOut chan lnutil.LitMsg // the current channel that in the process of being created // (1 at a time for now) InProg *InFlightFund // queue for async messages to RPC user UserMessageBox chan string // The port(s) in which it listens for incoming connections LisIpPorts []string // The URL from which lit attempts to resolve the LN address TrackerURL string }
LnNode is the main struct for the node, keeping track of all channel state and communicating with the underlying UWallet
func NewLitNode ¶
Init starts up a lit node. Needs priv key, and a path. Does not activate a subwallet; do that after init.
func (*LitNode) BreakChannel ¶
------------------------- break
func (*LitNode) BuildJusticeSig ¶
BuildWatchTxidSig builds the partial txid and signature pair which can be exported to the watchtower. This get a channel that is 1 state old. So we can produce a signature.
func (*LitNode) ChannelHandler ¶
func (nd *LitNode) ChannelHandler(msg lnutil.LitMsg, peer *RemotePeer) error
func (*LitNode) CloseReqHandler ¶
func (nd *LitNode) CloseReqHandler(msg lnutil.CloseReqMsg)
func (*LitNode) ConnectedToPeer ¶
ConnectedToPeer checks whether you're connected to a specific peer
func (*LitNode) DeltaSigHandler ¶
func (nd *LitNode) DeltaSigHandler(msg lnutil.DeltaSigMsg, qc *Qchan) error
DeltaSigHandler takes in a DeltaSig and responds with an SigRev (normally) or a GapSigRev (if there's a collision) Leaves the channel either expecting a Rev (normally) or a GapSigRev (collision)
func (*LitNode) FundChannel ¶
FundChannel opens a channel with a peer. Doesn't return until the channel has been created. Maybe timeout if it takes too long?
func (*LitNode) GapSigRevHandler ¶
func (nd *LitNode) GapSigRevHandler(msg lnutil.GapSigRevMsg, q *Qchan) error
GapSigRevHandler takes in a GapSigRev, responds with a Rev, and leaves the channel in a state expecting a Rev.
func (*LitNode) GetAllQchans ¶
GetAllQchans returns a slice of all channels. empty slice is OK.
func (*LitNode) GetConnectedPeerList ¶
func (*LitNode) GetDHSecret ¶
GetDHSecret gets a per-channel shared secret from the Diffie-Helman of the two pubkeys in the fund tx.
func (*LitNode) GetElkremRoot ¶
GetElkremRoot returns the Elkrem root for a given key path gets the use-pub for elkrems and hashes it. A little weird because it's a "pub" key you shouldn't reveal. either do this or export privkeys... or signing empty txs or something.
func (*LitNode) GetLisAddressAndPorts ¶
Gets the list of ports where LitNode is listening for incoming connections, & the connection key
func (*LitNode) GetNicknameFromPeerIdx ¶
GetNicknameFromPeerIdx gets the nickname for a peer
func (*LitNode) GetPeerIdx ¶
GetPeerIdx returns the peer index given a pubkey. Creates it if it's not there yet! Also return a bool for new..? not needed?
func (*LitNode) GetPubHostFromPeerIdx ¶
GetPubHostFromPeerIdx gets the pubkey and internet host name for a peer
func (*LitNode) GetQchanByIdx ¶
GetQchanByIdx is a gets the channel when you don't know the peer bytes and outpoint. Probably shouldn't have to use this if the UI is done right though.
func (*LitNode) GetQchanOPfromIdx ¶
func (*LitNode) GetUsePub ¶
GetUsePub gets a pubkey from the base wallet, but first modifies the "use" step
func (*LitNode) IdKey ¶
func (nd *LitNode) IdKey() *btcec.PrivateKey
IdKey returns the identity private key
func (*LitNode) LNDCReader ¶
func (nd *LitNode) LNDCReader(peer *RemotePeer) error
Every lndc has one of these running it listens for incoming messages on the lndc and hands it over to the OmniHandler via omnichan
func (*LitNode) LinkBaseWallet ¶
func (nd *LitNode) LinkBaseWallet( privKey *[32]byte, birthHeight int32, resync bool, tower bool, host string, param *coinparam.Params) error
LinkBaseWallet activates a wallet and hooks it into the litnode.
func (*LitNode) LoadJusticeSig ¶
func (*LitNode) NextChannelIdx ¶
NextIdx returns the next channel index to use.
func (*LitNode) OPEventHandler ¶
func (nd *LitNode) OPEventHandler(OPEventChan chan lnutil.OutPointEvent)
OPEventHandler gets outpoint events from the base wallet, and modifies the ln node db to reflect confirmations. Can also respond with exporting txos to the base wallet, or penalty txs.
func (*LitNode) OutMessager ¶
func (nd *LitNode) OutMessager()
OutMessager takes messages from the outbox and sends them to the ether. net.
func (*LitNode) PeerHandler ¶
handles stuff that comes in over the wire. Not user-initiated.
func (*LitNode) PointReqHandler ¶
func (nd *LitNode) PointReqHandler(msg lnutil.PointReqMsg)
RECIPIENT PubReqHandler gets a (content-less) pubkey request. Respond with a pubkey and a refund pubkey hash. (currently makes pubkey hash, need to only make 1) so if someone sends 10 pubkeyreqs, they'll get the same pubkey back 10 times. they have to provide an actual tx before the next pubkey will come out.
func (LitNode) PointRespHandler ¶
func (nd LitNode) PointRespHandler(msg lnutil.PointRespMsg) error
FUNDER PointRespHandler takes in a point response, and returns a channel description
func (*LitNode) PopulateQchanMap ¶
func (nd *LitNode) PopulateQchanMap(peer *RemotePeer) error
func (LitNode) PushChannel ¶
PushChannel initiates a state update by sending an DeltaSig
func (*LitNode) PushPullHandler ¶
func (*LitNode) QChanAckHandler ¶
func (nd *LitNode) QChanAckHandler(msg lnutil.ChanAckMsg, peer *RemotePeer)
FUNDER QChanAckHandler takes in an acknowledgement multisig description. when a multisig outpoint is ackd, that causes the funder to sign and broadcast.
func (*LitNode) QChanDescHandler ¶
func (nd *LitNode) QChanDescHandler(msg lnutil.ChanDescMsg)
RECIPIENT QChanDescHandler takes in a description of a channel output. It then saves it to the local db, and returns a channel acknowledgement
func (*LitNode) ReSendMsg ¶
SendNextMsg determines what message needs to be sent next based on the channel state. It then calls the appropriate function.
func (*LitNode) ReloadQchanState ¶
ReloadQchan loads updated data from the db into the qchan. Loads elkrem and state, but does not change qchan info itself. Faster than GetQchan() also reload the channel close state
func (*LitNode) RestoreQchanFromBucket ¶
RestoreQchanFromBucket loads the full qchan into memory from the bucket where it's stored. Loads the channel info, the elkrems, and the current state. restore happens all at once, but saving to the db can happen incrementally (updating states) This should populate everything int he Qchan struct: the elkrems and the states. Elkrem sender always works; is derived from local key data. Elkrem receiver can be "empty" with nothing in it (no data in db)
func (*LitNode) RevHandler ¶
REVHandler takes in an REV and clears the state's prev HAKD. This is the final message in the state update process and there is no response. Leaves the channel in a clear / rest state.
func (*LitNode) SaveJusticeSig ¶
SaveJusticeSig save the txid/sig of a justice transaction to the db. Pretty straightforward
func (*LitNode) SaveNicknameForPeerIdx ¶
SaveNicknameForPeerIdx saves/overwrites a nickname for a given peer idx
func (*LitNode) SaveQchanState ¶
Save / overwrite state of qChan in db the descent into the qchan bucket is boilerplate and it'd be nice if we can make that it's own function. Get channel bucket maybe? But then you have to close it...
func (*LitNode) SaveQchanUtxoData ¶
SaveQchanUtxoData saves utxo data such as outpoint and close tx / status
func (*LitNode) SendDeltaSig ¶
SendDeltaSig initiates a push, sending the amount to be pushed and the new sig.
func (*LitNode) SendGapSigRev ¶
SendGapSigRev is different; it signs for state+1 and revokes state-1
func (*LitNode) SendSigRev ¶
SendSigRev sends an SigRev message based on channel info
func (*LitNode) SendWatchComMsg ¶
send WatchComMsg generates and sends the ComMsg to a watchtower
func (*LitNode) SetQchanRefund ¶
SetQchanRefund overwrites "theirrefund" and "theirHAKDbase" in a qchan.
This is needed after getting a chanACK.
func (*LitNode) ShowJusticeDB ¶
func (*LitNode) SigProofHandler ¶
func (nd *LitNode) SigProofHandler(msg lnutil.SigProofMsg, peer *RemotePeer)
RECIPIENT SigProofHandler saves the signature the recipent stores. In some cases you don't need this message.
func (*LitNode) SigRevHandler ¶
SIGREVHandler takes in an SIGREV and responds with a REV (if everything goes OK) Leaves the channel in a clear / rest state.
func (*LitNode) SignBreakTx ¶
SignBreak signs YOUR tx, which you already have a sig for
func (*LitNode) SignSimpleClose ¶
SignSimpleClose signs the given simpleClose tx, given the other signature Tx is modified in place.
type QCloseData ¶
type QCloseData struct { // 3 txid / height pairs are stored. All 3 only are used in the // case where you grab their invalid close. CloseTxid chainhash.Hash CloseHeight int32 Closed bool // if channel is closed; if CloseTxid != -1 }
func QCloseFromBytes ¶
func QCloseFromBytes(b []byte) (QCloseData, error)
QCloseFromBytes deserializes a Qclose. Note that a nil slice gives an empty / non closed qclose.
func (*QCloseData) ToBytes ¶
func (c *QCloseData) ToBytes() ([]byte, error)
type Qchan ¶
type Qchan struct { portxo.PorTxo // S underlying utxo data CloseData QCloseData // S closing outpoint MyPub [33]byte // D my channel specific pubkey TheirPub [33]byte // S their channel specific pubkey // Refunds are also elkremified MyRefundPub [33]byte // D my refund pubkey for channel break TheirRefundPub [33]byte // S their pubkey for channel break MyHAKDBase [33]byte // D my base point for HAKD and timeout keys TheirHAKDBase [33]byte // S their base point for HAKD and timeout keys // PKH for penalty tx. Derived WatchRefundAdr [20]byte // Elkrem is used for revoking state commitments ElkSnd *elkrem.ElkremSender // D derived from channel specific key ElkRcv *elkrem.ElkremReceiver // S stored in db Delay uint16 // blocks for timeout (default 5 for testing) State *StatCom // S current state of channel ClearToSend chan bool // send a true here when you get a rev }
Uhh, quick channel. For now. Once you get greater spire it upgrades to a full channel that can do everything.
func QchanFromBytes ¶
QchanFromBytes turns bytes into a Qchan. the first 99 bytes are the 3 pubkeys: channel, refund, HAKD base then 8 bytes for the DH mask the rest is the utxo
func (*Qchan) AdvanceElkrem ¶
func (*Qchan) BuildStateTx ¶
BuildStateTx constructs and returns a state tx. As simple as I can make it. This func just makes the tx with data from State in ram, and HAKD key arg
func (*Qchan) ElkPoint ¶
ElkPoint generates an elkrem Point. "My" elkrem point is the point I receive from the counter party, and can create after the state has been revoked. "Their" elkrem point (mine=false) is generated from my elkrem sender at any index. Elkrem points pubkeys where the scalar is a hash coming from the elkrem tree. With delinearized aggregation, only one point is needed. I'm pretty sure.
func (*Qchan) GetChanHint ¶
GetChanHint gives the 6 byte hint mask of the channel. It's derived from the hash of the PKH output pubkeys. "Mine" means the hint is in the tx I store. So it's actually a hint for them to decode... which is confusing, but consistent with the "mine" bool for transactions, so "my" tx has "my" hint. (1<<48 - 1 is the max valid value)
func (*Qchan) GetCloseTxos ¶
GetCloseTxos takes in a tx and sets the QcloseTXO feilds based on the tx. It also returns the spendable (u)txos generated by the close. TODO way too long. Need to split up. TODO problem with collisions, and insufficiently high elk receiver...?
func (*Qchan) ImFirst ¶
ImFirst decides who goes first when it's unclear. Smaller pubkey goes first.
func (*Qchan) IngestElkrem ¶
IngestElkrem takes in an elkrem hash, performing 2 checks: that it produces the proper elk point, and that it fits into the elkrem tree. If either of these checks fail, and definitely the second one fails, I'm pretty sure the channel is not recoverable and needs to be closed.
func (*Qchan) N2ElkPointForThem ¶
CurElkPointForThem makes the current state elkrem point to send out
func (*Qchan) SimpleCloseTx ¶
SimpleCloseTx produces a close tx based on the current state. The PKH addresses are my refund base with their r-elkrem point, and their refund base with my r-elkrem point. "Their" point means they have the point but not the scalar.
type RemotePeer ¶
type StatCom ¶
type StatCom struct { StateIdx uint64 // this is the n'th state commitment WatchUpTo uint64 // have sent out to watchtowers up to this state ( < stateidx) MyAmt int64 // my channel allocation Fee int64 // symmetric fee in absolute satoshis // their Amt is the utxo.Value minus this Delta int32 // fund amount in-transit; is negative for the pusher // Delta for when the channel is in a collision state which needs to be resolved Collision int32 // Elkrem point from counterparty, used to make // Homomorphic Adversarial Key Derivation public keys (HAKD) ElkPoint [33]byte // saved to disk, current revealable point NextElkPoint [33]byte // Point stored for next state N2ElkPoint [33]byte // Point for state after next (in case of collision) // contains filtered or unexported fields }
StatComs are State Commitments. all elements are saved to the db.
func StatComFromBytes ¶
StatComFromBytes turns 192 bytes into a StatCom
type UWallet ¶
type UWallet interface { // Ask for a pubkey based on a bip32 path GetPub(k portxo.KeyGen) *btcec.PublicKey // Have GetPriv for now. Maybe later get rid of this and have // the underlying wallet sign? GetPriv(k portxo.KeyGen) *btcec.PrivateKey // export the chainhook that the UWallet uses, for pushTx and fullblock ExportHook() uspv.ChainHook PushTx(tx *wire.MsgTx) error // ExportUtxo gives a utxo to the underlying wallet; that wallet saves it // and can spend it later. Doesn't return errors; error will exist only in // base wallet. ExportUtxo(txo *portxo.PorTxo) // MaybeSend makes an unsigned tx, populated with inputs and outputs. // The specified txouts are in there somewhere. // Only segwit txins are in the generated tx. (txid won't change) // There's probably an extra change txout in there which is OK. // The inputs are "frozen" until ReallySend / NahDontSend / program restart. // Retruns the txid, and then the txout indexes of the specified txos. // The outpoints returned will all have the same hash (txid) // So if you (as usual) just give one txo, you basically get back an outpoint. MaybeSend(txos []*wire.TxOut, onlyWit bool) ([]*wire.OutPoint, error) // ReallySend really sends the transaction specified previously in MaybeSend. // Underlying wallet does all needed signing. // Once you call ReallySend, the outpoint is tracked and responses are // sent through LetMeKnow ReallySend(txid *chainhash.Hash) error // NahDontSend cancels the MaybeSend transaction. NahDontSend(txid *chainhash.Hash) error // Return a new address NewAdr() ([20]byte, error) // Dump all the utxos in the sub wallet UtxoDump() ([]*portxo.PorTxo, error) // Dump all the addresses the sub wallet is watching AdrDump() ([][20]byte, error) // Return current height the wallet is synced to CurrentHeight() int32 // WatchThis tells the basewallet to watch an outpoint WatchThis(wire.OutPoint) error // LetMeKnow opens the chan where OutPointEvent flows from the underlying // wallet up to the LN module. LetMeKnow() chan lnutil.OutPointEvent // Ask for network parameters Params() *coinparam.Params // Get current fee rate. Fee() int64 // Set fee rate SetFee(int64) int64 // ===== TESTING / SPAMMING ONLY, these funcs will not be in the real interface // Sweep sends lots of txs (uint32 of them) to the specified address. Sweep([]byte, uint32) ([]*chainhash.Hash, error) }
The UWallet interface are the functions needed to work with the LnNode Verbs are from the perspective of the LnNode, not the underlying wallet