2023 Jan 23
Plan for today
- Attend LDK sync - prob don’t need to be apart of this since I’m not participating and there are meeting notes. Cool to sit in once though.
- Review a PR - maybe Dual funding, maybe the other documentation one, conveniently this has a lot to do with channel opening which was I diving into on Saturday!
Dual funding: mainly a new generic channel establishment protocol, helpful to those wanting to open a channel to receive payments (previously can’t open a channel just to receive, in case attackers spam making people pay on-chain fees and running away), helpful for dual funding a channel to send and receive, can be combined with liquidity ads to help liquidity buyers and sellers find each other.
- This is mainly just a change to how the funding transaction is created. Instead of the channel funder creating the tx on their own and immediately jumping to sending commitment tx signatures, they build the funding tx together through a sequence of back and forth messages called interactive-tx.
Funky: nSequence. Originally intended to be used for RBF—miners would prioritize transactions with higher sequence numbers—but did not end up being used like this because you can’t really enforce profit-seeking miners’ behavior. In BIP 68 using this for transaction-level delay was implemented (spec has a great diagram). It allowed for reinterpreting the nSequence number for relative time locks, importantly enabling HTLCs. OP_CSV accompanied this in BIP 112.
Funky part is how nSequence is an input level parameter, but it is really only meant to be used on a transaction level, i.e. OP_CSV checks the nSequence of the input. ISTM if multiple inputs have a sequence number, then the max is taken.
nLocktime is a transaction level parameter, and seems to work slightly differently. nLocktime on its own seems like it can just be used to pre-sign transactions that can’t be mined before some block height, but it can also be used similar to nSequence where it’s used on a script level by OP_CLTV where the output can’t be spent until that time.
My question: why don’t you just specify the number in the script for OP_CSV or OP_CLTV instead of using the transaction/input fields?
Wow, this resource helped a lot. nSequence is really for relative to when a previous transaction was mined, then OP_CSV is script-level relative to when this transaction/input is mined.
A basepoint is a point on an elliptic curve (G) that gets multiplied by a private key (n) to form a public key (nG). A little confused on how the cryptography works for there being many basepoints on a curve and how you’re able to generate multiple public keys from the same private key. (all the basepoints involved in commitment txs, also HD wallets).
Secp256k1 and ed25519 are both elliptic curves. Bitcoin uses Secp256k1. It’s better tested (libsecp256k1) and smth smth prime number of points, no low order points.
ChaCha20 is a symmetric encryption scheme, faster than AES.
If you want to combine two
if let
statements, you can just put a comma in between:if let Some(x) = x_wrap, let Some(y) = y_wrap {}
More helix: removed overwrite of
space w
because on it’s own it switches to window mode which is way better thanC-w
.space y
yanks to system clipboard! Setidle-timeout
to 0 so autocomplete is faster!More notes from saylor stuff for summer of bitcoin assignment:
Saylor on Stephen livera podcast
- Inflation is a vector. Propoganda: we can’t change what people think, but we can change what people think about. CPI inflation is misleading, can be chosen and changed by few to support what they want people to think.
Bitcoin obsoletes all other money
We naturally converge on a single (the best) money because it’s in our best interest. Finite scarcity is powerful.
Converging on a single currency is important because it drastically improves the currency’s function as money - price system is less distorted → incentives are communicated more effectively, economic resources are utilized to their best potential.
“I don’t believe we shall ever have a good money again before we take the thing out of the hands of government, that is, we can’t take it violently out of the hands of government, all we can do is by some sly roundabout way introduce something that they can’t stop”. – F.A. Hayek.
- Haha, no way