- Stumble across Bitcoin, heard about it's P2P aspect
- Initially thought fees are calculated in proportion to the payment amount
- Quickly learned about UTXOs, TX input + output etc
- Confused as to why some TXs have cheaper or more expensive TX fee even though they looked similar from quick glance
- Learned script types, tryna find out how each script type are weighted and found these 1, 2 tools
- Interested to know more & want to verify the information by myself
- Conduct my own investigation
- Results found, decided to share it on SN
- Am i cooking ?
| Script Type | Other | |
| P2PK | Coinbase | Input-only (can't spend to Coinbase) |
| P2PKH | OP_Return | Output-only (can't spend from OP_Return) |
| P2MS | P2QRH | Still in the proposal-phase, add it anyway |
| P2SH | P2A | Haven't learned much of it, add it anyway |
| P2WPKH | Non-standard | |
| P2WSH | | |
| P2TR | | |
| Pre-SegWit | Post-SegWit |
| Overhead | nVersion | nVersion |
| Input Count | Input Count |
| Output Count | Output Count |
| nLocktime | nLocktime |
| | Mark & Flag |
| Input Field | Outpoint | Outpoint |
| scriptSig Length | scriptSig Length |
| scriptSig | nSequence |
| nSequence | Witness Items |
| Output Field | nValue | nValue |
| scriptPubkey length | scriptPubkey Length |
| scriptPubkey | scriptPubkey |
| Block Size/Weight | 1 Megabyte | 4 Million Weight Units |
| | 4 Mega Virtual Bytes |
| Overhead | Input VSize | Output VSize |
| Coinbase | | ≥ 48 ? | |
| OP_Returm | | | ≥ 34 ? | |
| P2PK | 10 | 113 ~ 115 | 76 |
| P2PK (Raw) | 10 | 114 | 44 |
| P2PKH | 10 | 147 ~ 149 | 34 |
| P2PKH | 10 | 179 ~ 181 | 34 |
| P2MS 1-of-1 | 10 | 113 ~ 115 | 46 or 78 |
| P2MS 1-of-1 | 10 | 148 ~ 154 | 46 |
| P2MS 1-of-2 | 10 | 114 ~ 116 | 80 or 112 or 144 |
| P2MS 2-of-2 | 10 | 187 ~ 189 | 80 or 144 |
| P2MS 1-of-3 | 10 | 114 ~ 115 | 114 or 146 |
| P2MS 2-of-3 | 10 | 186 ~ 189 | 114 or 210 |
| P2MS 3-of-3 | 10 | 258 | 114 or 210 |
| P2SH 1-of-1 | 10 | 79 or 153 | 32 |
| P2SH 1-of-1 | 10 | 184 ~ 186 | 32 |
| P2SH 1-of-2 | 10 | 186 ~ 188 | 32 |
| P2SH 1-of-2 | 10 | 252 | 32 |
| P2SH 2-of-2 | 10 | 260 ~ 261 | 32 |
| P2SH 2-of-2 | 10 | 326 ~ 328 | 32 |
| P2SH 2-of-3 | 10 | 293 ~ 298 | 32 |
| P2SH 2-of-3 | 10 | 329 | 32 |
| P2SH 2-of-4 | 10 | 331 | 32 |
| P2SH 3-of-4 | 10 | 530 ~ 534 | 32 |
| P2SH 2-of-5 | 10 | 364 | 32 |
| P2SH 3-of-5 | 10 | 436 ~ 438 | 32 |
| P2SH 8-of-9 | 10 | 936 ~ 939 | 32 |
| P2SH-P2WPKH | 10.5 | 90.75 ~ 91 | 32 |
| P2SH-P2WSH 1-of-1 | 10.5 | 104 | 32 |
| P2SH-P2WSH 2-of-2 | 10.5 | 130.75 ~ 131 | 32 |
| P2SH-P2WSH 2-of-3 | 10.5 | 139 ~ 139.25 | 32 |
| P2WPKH | 10.5 | 67.5 ~ 68 | 31 |
| P2WSH 1-of-1 | 10.5 | 69.25 | 43 |
| P2WSH 2-of-2 | 10.5 | 95.75 ~ 96 | 43 |
| P2WSH 2-of-3 | 10.5 | 104 ~ 104.5 | 43 |
| P2WSH 3-of-5 | 10.5 | 139.25 ~ 139.75 | 43 |
| P2WSH 11-of-15 | 10.5 | 397.25 ~ 398.75 | 43 |
| P2TR | 10.5 | 57.5 ~ 57.75 | 43 |
| Part | Size | Transactions Example |
| P2PK input | 113 | 1, 2, 3, 4 |
| 114 | 1, 2, 3 |
| 115 | 1, 2 |
| Raw P2PK input | 114 | 1, 2 |
| Raw P2PK output | 44 | 1, 2 |
| P2PKH input | 147 | 1, 2, 3, 4 |
| 148 | 1 (2nd), 2 (except 1st), 3 (1st), 4 (all) |
| 149 | 1, 2, 3, 4 (1st) |
| 179 | 1, 2, 3 (2nd), 4 (2nd) |
| 180 | 1, 2, 3, 4 |
| 181 | 1, 2, 3 (all), 4 (1st) |
| P2MS 1-of-1 input | 113 | 1 |
| 115 | 1 |
| 148 | 1 |
| 154 | 1 |
| P2MS 1-of-1 output | 46 | 1, 2, 3, 4 |
| 78 | 1 |
| P2MS 1-of-2 input | 114 | 1, 2, 3, 4 |
| 115 | 1, 2, 3, 4 |
| 116 | 1 |
| P2MS 1-of-2 output | 80 | 1, 2, 3, 4 |
| 112 | 1, 2, 3 |
| 144 | 1 |
| P2MS 2-of-2 input | 187 | 1, 2 (2nd) |
| 188 | 1, 2 (1st), 3 (2nd), 4 (2nd) |
| 189 | 1, 2, 3 (1st), 4 |
| P2MS 2-of-2 output | 80 | 1, 2, 3 |
| 144 | 1, 2, 3, 4 |
| P2MS 1-of-3 input | 114 | 1 (1st), 2 (2nd), 3 (2nd) |
| 115 | 1 (3rd), 2 (2nd) |
| P2MS 1-of-3 output | 114 | 1, 2, 3 (3rd), 4 |
| 146 | 1, 2, 3, 4 |
| P2MS 2-of-3 input | 186 | 1, 2 |
| 187 | 1, 2, 3, 4 |
| 188 | 1, 2, 3, 4 |
| 189 | 1 |
| P2MS 2-of-3 output | 114 | 1, 2, 3 |
| 210 | 1, 2, 3, 4 |
| P2MS 3-of-3 input | 258 | 1 |
| P2MS 3-of-3 output | 114 | 1 |
| 210 | 1 |
| P2SH 1-of-1 input | 79 | 1 |
| 153 | 1 |
| 184 | 1 |
| 185 | 1, 2 (all) |
| 186 | 1, 2 |
| P2SH 1-of-2 input | 186 | 1, 2 |
| 187 | 1, 2 (3rd), 3, 4 |
| 188 | 1, 2 |
| 252 | 1 |
| P2SH 2-of-2 input | 260 | 1, 2 |
| 261 | 1 |
| 326 | 1, 2 |
| 327 | 1, 2 |
| 328 | 1 |
| P2SH 2-of-3 input | 293 | 1 (1st), 2 |
| 296 | 1, 2 (4th), 3 |
| 297 | 1 (all), 2 |
| 298 | 1 (5th), 2 |
| 329 | 1 |
| P2SH 2-of-4 input | 331 | 1 |
| P2SH 3-of-4 input | 530 | 1 (1st) |
| 531 | 1 (2nd), 2, 3 (1st) |
| 533 | 1 (2nd) |
| 534 | 1 (3rd) |
| P2SH 2-of-5 input | 364 | 1 |
| P2SH 3-of-5 inout | 436 | 1, 2 |
| 437 | 1, 2 |
| 438 | 1 |
| P2SH 8-of-9 input | 936 | 1 (3rd) |
| 938 | 1, 2 (2nd) |
| 939 | 1 (1nd) |
| P2SH-P2WPKH input | 90.75 | 1 (2nd), 2 |
| 91 | 1 (1st), 2, 3, 4 |
| P2SH-P2WSH 1-of-1 input | 104 | 1 |
| P2SH-P2WSH 2-of-2 input | 130.75 | 1, 2 |
| 131 | 1 (1st) |
| P2SH-P2WSH 2-of-3 input | 139 | 1 |
| 139.25 | 1, 2, 3, 4 |
| P2WPKH input | 67.75 | 1 (1st & 4th), 2, 3, 4 |
| 68 | 1, 2 (2nd & 3rd), 3, 4 |
| P2WSH 1-of-1 input | 69.25 | 1 |
| P2WSH 2-of-2 input | 95.75 | 1, 2, 3 (1st), 4 (1st) |
| 96 | 1 (2nd) |
| P2WSH 2-of-3 input | 104 | 1, 2, 3, 4 |
| 104.25 | 1, 2 |
| 104.5 | 1 |
| P2WSH 3-of-5 input | 139.25 | 1, 2 |
| 139.5 | 1 (all), 2 |
| 139.75 | 1 |
| P2WSH 11-of-15 input | 397.25 | 1 (3rd) |
| 397.5 | 1, 2 |
| 397.75 | 1, 2 (2nd), 3, 4 |
| 398 | 1, 2, 3 (all), 4 |
| 398.25 | 1, 2, 3, 4 |
| 398.5 | 1 (1st), 2, 3, 4 |
| 398.75 | 1 |
| P2TR input | 57.5 | 1, 2, 3, 4 |
| 57.75 | 1 (all), 2, 3, 4 |
Tools used :
Aight, i can't get any example of Pay-to-Anchor TX on mainnet yet. But who's gonna stop me from mentioning it ? Here are several examples of P2A TX on Testnet4 :
| As output (receiver side) | As input (spender side) |
| 1 | 1 |
| 2 | 2 |
Now, if the law of TX size calculation on Testnet4 is the same as Mainnet, then a P2A script would have 13 vb output size or 41 vb input size. CMIIW tho, i only sampled one address i found here.
Historically, we've gotten a new address type every 4 years (P2SH 2012, SegWit 2017, Taproot 2021), but given the slow adaptation of P2TR and long process of development, we are not gonna get P2QRH next year. Read the documentation here.
It's kind of rude to ask questions about a feature that doesn't exist yet, but I'm curious what the sub-board design will look like, the assumptions underlying it, and the features it will include to support the design goals.
For instance: you can imagine that sub-boards could be administered by a moderator; and then the mod gets to say "these are the rules to be here" a la Reddit. But what if the sub is about a contentious topic (e.g., religion, politics, the block subsidy) and douchebags show up to the sub trying to DDOS everything with asshole comments from multiple accounts, etc?
Then I thought: what if a sub could have an "ante" where you have to ante up some number of sats if you want to post, and the ante is timelocked so once you ante, you can't withdraw for a while. The sats are held in reserve in a sub-sub-wallet (ha!). If the user is an asshole, the mod can sweep the funds into the SN rewards pool.
Obviously you can imagine ways the mod can abuse this; but you can also see how market incentives provide strong abuse counter-incentives: a smart mod would be judicious about funds-sweeping, and would make a case for why she was proposing to sweep. If the sub got a bad rep, people would stop anteing up and the sub would quickly die. But there would be a public record of the action, and the user's actions pre-sweep, so people could decide for themselves.
Like the SN version of free-banking. Market in action. Only possible using btc / LN.
There is a seven step procedure to run the backend and connect it to the frontend, so I will go over them here
First step
The first step is something I have to say after the second step
Second step
The second step is to install LNDK according to the instructions on this page: https://github.com/lndk-org/lndk
But notice that the page tells you that first you "need a LND node running at least LND v0.18.0...with the peersrpc, signerrpc, and walletrpc sub-servers enabled"
First step again
So that's the real first step: compile LND with those sub-servers enabled by following the guide they link to
Note on the first two steps
Don't run LND and LNDK as two different linux users like a "good" programmer would do. To control LNDK I opted not to use its api, because I was running out of time, so instead I use the
execcommand to spin up a terminal inside nodejs and interact with it via stdin and stdout. And for one specific LND command ("trackpayment") the LND API wouldn't work for me (I was probably using it wrong) so I useexecfor that too. Which means you must run the server, LND, and LNDK all on the same linux user -- if you separate them, the terminal won't have thelndk-cliandlnclicommands available, so the program will fail.Third step
To run the server, first clone the github and run
npm init -y.Fourth step
Then install the dependencies:
npm i crypto noble-secp256k1 ws browserify-cipher requestAlso, modify the first few lines of the server.js file so that they contain your LND node's invoice macaroon, admin macaroon (both in hexadecimal format), your LND Rest api endpoint (this is usually https://127.0.0.1:8080), and you can ignore the other four fields -- I intended to use them to let users modify their fee settings and a few other things, but I don't actually use them anywhere in the code, the fees are just hard coded to 10 sats.
Fifth step
Then run
node server.jsIt should spit out a nostr public key and then wait for incoming messages
We opted to use nostr for communication between the frontend and the backend so that anyone can run this without needing to expose ports
We intended to make it so that people running the backend would announce themselves on nostr, as well as a fee structure (e.g. do they charge a flat fee for forwarding bolt11 payments to a bolt12? A percentage fee? How much?) and the frontend would listen for those announcements and display them to the user. But we ran out of time so we hard coded the nostr pubkey of my backend into the frontend, which is why it stopped working when I turned off my laptop.
Sixth step
To make sure your service is working, edit the index.html file in my github repo and find the line `welder = "<nostr_pubkey>" and change it to yours. Then open up the index.html file, open up its browser console, enter a bolt12 invoice into the form, and hit enter. You should see a message pop up in your nodejs terminal and you should see the frontend and backend interact. Watch the browser console -- eventually you should see a bolt11 invoice in there. (I don't "pop it up" on the page, it only appears in the console.)
Note about the sixth step
As @justin_shocknet has always warned, I have found that the onion messaging aspect of bolt12 is very unreliable. About 2/3 of the time, the server will use the lightning network's onion messaging transport layer to reach out to whatever node issued the bolt12 and something goes wrong: the message does not reach the destination or the reply does not reach my node.
Consequently, most of the time, the service does not work. I find that if, after hitting the "Submit" button on the form, you don't see a bolt11 in your browser console after about 10 seconds, try hitting submit again; and occasionally try restarting all four services: LND, LNDK, and the nodejs file, and the web browser (after entering in your "new" nostr pubkey -- the nodejs service doesn't save it so a new pubkey is created every time you restart the nodejs service).
Eventually it should work and you should see a bolt11 invoice in your browser console.
Seventh step
Pay the bolt11 invoice and you should see a corresponding payment show up in your bolt12-supporting wallet.
Note about the seventh step
I've only tested this with phoenix wallet so it might not work with other wallets. Also, my frontend hard-codes an invoice of 15 sats, and since the server charges a 10 sat flat fee, the bolt11 will be for 25 sats. So don't be surprised when your phoenixd only receives 15 sats even though you paid 25.
Interesting! I've never thought about a full node in that way but my initial reaction is that it still counts as full because i can send/receive any bitcoin with a wallet that uses that node.
ACINQ uses a nitro enclave: https://acinq.co/blog/securing-a-100M-lightning-node
how will splicing impact LN node operators?
Love this kind of thinking. Culture is one of those things that can be nudged and affected but it seems nearly impossible to control. I've worked at companies where culture was important but it can't be created by a road map. Being a parent has taught me you can guide and influence but kids are born with their own natures and make their own choices. The best I can hope to do is lead by example, coach, guide, and protect. Most of all love. I think this applies to the broader culture as well.
☑️ morning strength training
☑️Breakfast - 6 eggs and 2 chicken thighs
☑️Doom scrolling stacker.news
A ton for sure.
Will add more as it comes to mind.
Happy New Year everyone! My New Year's resolutions are to stay focused, determined and to give my best in everything i do.
We fund the earnings rewards through these sources:
Bots / exploits are definitely something we're spending a lot of time on - but the more you contribute to the platform by creating clips, liking clips and comments, and supporting podcasts - the more you earn. Supporting podcasts specifically is something that's hard to fake because you have to send money to do it.
A growing number of people don't WANT to use a bank (who arbitrarily cut service and make you jump hoops to get it back), or payment processors that can go broke and reveal your name, transactions, and balances to the ENTIRE world (mtGox, Celsius).
In the UK, we have this thing called a TV license. It's as ridiculous as it sounds. People who watch state TV (BBC) must by law pay £159 / year.
As you can imagine, not many people cough up the money. The BBC is shit and the law is next to impossible to enforce. So if you're not on the TV license register, the government instead harasses you with angry little letters to try and scare you into paying. I hate these things so much that I ritualistically set fire to them whenever they land in my letter box, which is about every other month.
The longer you ignore the letters, the angrier they get. The first letter is just kind of stern. By the third letter they're screaming at you in big red capital letters about how you're under surveillance and breaking the law. By the fifth letter they threaten to send a "television inspector" to your address if you still haven't gotten back to them.
The inspector almost never comes. It's all hot air. But the fact that there is such a thing as a TV inspector in the first place blows my fuckin' mind. This is surely peak BS, right up there with the poor bastards who print the stupid letters out in the first place.
Jameson's thoughts bring to mind this great quote of Dijkstra that, in my humble opinion, is not as popular as it should be.
https://www.azquotes.com/picture-quotes/quote-simplicity-is-a-great-virtue-but-it-requires-hard-work-to-achieve-it-and-education-to-edsger-dijkstra-75-49-78.jpg
When I was a kid, my dad got fired from his job as a road worker for theft. I refused to believe he could do such a thing, but when I got home, the signs were all there.