2023 Jan 04
My first PR was merged!!!
Did a couple of programming problems. I figure I should probably practice a bit so I don’t bomb the technical screening for Summer of Bitcoin.
Learned what a transaction Output is:
pub struct OutPoint { /// The referenced transaction's txid. pub txid: Txid, /// The index of the referenced output in its transaction's vout. pub index: u16, }
Looking into persisting payment info for ldk-sample-node
- There’s a
Persist
andPersister
trait.Persist
handles persistingChannelMonitor
which actually handles channel data.Persister
handles persisting theChannelManager
,NetworkGraph
, andScorer
. KVStorePersister
allows you to implement one function and have auto-implementations forPersist
andPersister
. But this doesn’t get me anywhere for payment data.- This is implemented for
FilesystemPersister
which is a basic persister provided as a mini crate inrust-lightning
. - Interesting to note the other things have default implementations for persisting but payment info doesn’t. Making note that this is likely state that is not needed to function as a protocol, i.e. past payments.
- This is implemented for
- The other thing, is to be able to persist anything, it needs to implement
Writeable
trait, which is an extension of theWriter
trait, which is a simplified version of the standardstd::io::Write
trait!
- There’s a
Why do this issue at all?
- Saw it was an intended functionality from a TODO comment
- Seems like a relatively important part to demonstrate to a user. For sake of consistency and completion in the project, persisting this to disk seems logical.
- Could see how this is not super essential for this project because persisting this to disk is not vital to the nodes core functionality, and any added feature can increase complexity. But personally I think this would be good, and doesn’t add any more complexity than there already is.
It turns out we are actually on the third testnet. And this is reflected in the datadir being in
testnet3
.Damus updates have been speedy lately.
Learned about LNURL and lightning addresses. Both are ways to have static text addresses (to acommodate BOLT 11) to make paying people easier, with LNURL being the underlying protocol. LNURL uses an address format:
lightning:...
, while lightning address uses the format:<name>@<domain.com>
. The two address formats are just ways to receive metadata, LNURL sends the LNURL to the lightning service (or some sort of decoded data?) while lightning address sends tohttp://domain.com/.well-known/lnurl/username
. They get back metadata, the user inputs and amount to pay, then it requests the wallet’s LN service or node to ask the payee’s node to generate a new invoice and tries to pay it. Pretty neat. I have mine from alby:alec@getalby.com
and put it on my damus/nostr profile info.