2023 Jan 10
Apparently a good book on computer networking suggested by the LDK discord
Finally learned about macros in Rust. They are honestly fairly straight forward, at least conceptually. This is my first real introduction to meta-programming, which I had heard a lot about but never really learned myself.
Also realized there are a lot of books for Rust stuff. There’s a reference book for more in-depth documentation of the language structure. Seems like a good section on macros.
Review: OP_CLTV (check lock time verify) is absolute, OP_CSV (check sequence verify) is relative to the confirmed block the transaction appears in.
Trying to dig into a PR: https://github.com/lightningdevkit/rust-lightning/pull/1878
In the issue it mentions this is important for people doing (submarine) swaps: why?
- Review: Submarine swaps. Can be used for…
Alice wants to pay Bob on-chain, Bob wants to receive payment off-chain on lightning, so they use a third person (or some intermediary route) Claire that has the necessary liquidity to pay Bob on lightning. Here, Bob generates a secret, and sends the hash to Alice—essentially just Bob creating a Lightning invoice for Alice. Alice creates an HTLC to send money to Claire (Claire can take funds within time frame with preimage/secret, after cltv_expiry Alice can reclaim funds). Claire creates an HTLC to send money to Bob on their payment channel (only after Alice’s HTLC has been broadcasted on-chain to ensure she can’t double spend it). If Bob claims the payment, he shares the preimage/secret, and Claire is able to claim the funds from Alice.
Alice is paying Bob on-chain to receive off-chain assets. Happens similarly to above but now both Alice and Bob are senders and receivers.
- Review: Submarine swaps. Can be used for…
What is all this about packing the custom_cltv_expiry_time into the payment secret metadata?
What is this PR doing: changelog at the bottom was probably the most helpful for this.