Joseph Poon [ARCHIVE] on Nostr: 📅 Original date posted:2015-07-24 📝 Original message: Oh, I forgot it's ...
📅 Original date posted:2015-07-24
📝 Original message:
Oh, I forgot it's necessary to store the hash of the R value. That'll
make it much bigger. 26-bytes or so.
Also, if OP_RETURN is viewed as acceptable, then you should be able to
fit 3 outputs per OP_RETURN metadata output.
Thinking through further, using OP_RETURN metadata is objectively better
than just having the nonstandard non-P2SH output when considering
transaction size.
So for OP_RETURN, you could have a blob up to 80 bytes (or 40 if you
want to maximize relay), which results in ~3 transactions if you assume
26-bytes per transaction. If you have a lot, you should probably just
fill it all up and compact it, I guess.
16-bits is fine for timeouts since that's 65535 block heights, which is
a little over a year's worth. Nothing's stopping you from supporting
more than a year's worth if you can find the route, but that's a fine
upper-bound for now.
32-bits is used for the Commitment Transaction. For even the most
high-volume node, 10 commitments per second results in 300 million
Commitment Transactions. This identifies in which Commitment Transaction
the HTLC was created. By knowing the Commitment Transaction, you'll know
the revocation preimage, so after the revocation information has been
exchanged, you only need to know which Commitment Transaction the HTLC
was originally formed, since the revocation information was originally
*generated* using a merkle tree derived from the Commitment Transaction
as an index.
In total that's 48-bits (6bytes) per HTLC output per Commitment. Plus
20-bytes for the hash(R), 26bytes.
If someone broadcasts an old Commitment and you don't have the HTLC data
because it's expired and too old, check the OP_RETURN data for the
6-bytes, then compute the revocation data and compute a couple hundred
revocations and see which one fits.
I think the tradeoff might be worth it. If you stored this data locally,
the cost shouldn't be too high for end-users. However, for those that
wish to do a lot of routing, this can add up. A node that does 10
commits/s with 100 HTLCs on average that results in a little over 800GB
of local storage per channel if OP_RETURN wasn't used, which may very
well be feasible for large hubs. Of course, whether OP_RETURN or local
storage were used, it's better than having the entire script as part of
the output.
--
Joseph Poon
Published at
2023-06-09 12:43:44Event JSON
{
"id": "2addbe284fe0b8a78720e7da2929990bbc8666671ec490bcf25a571934e51fbf",
"pubkey": "ccb4cc87c455b74febaee5929cfd0726421b2eea64ad2b16440b68e8c7433211",
"created_at": 1686314624,
"kind": 1,
"tags": [
[
"e",
"70bc73032209813d1efbd8c41b490ea29a02fc5941bbed8bed53cf49c33f8564",
"",
"root"
],
[
"e",
"2d8ec8ebe9462c48b01da6c5bd96c8346063bfb5a36e2f6dbb332e3f24790af2",
"",
"reply"
],
[
"p",
"ccb4cc87c455b74febaee5929cfd0726421b2eea64ad2b16440b68e8c7433211"
]
],
"content": "📅 Original date posted:2015-07-24\n📝 Original message:\nOh, I forgot it's necessary to store the hash of the R value. That'll\nmake it much bigger. 26-bytes or so.\n\nAlso, if OP_RETURN is viewed as acceptable, then you should be able to\nfit 3 outputs per OP_RETURN metadata output.\n\nThinking through further, using OP_RETURN metadata is objectively better\nthan just having the nonstandard non-P2SH output when considering\ntransaction size.\n\nSo for OP_RETURN, you could have a blob up to 80 bytes (or 40 if you\nwant to maximize relay), which results in ~3 transactions if you assume\n26-bytes per transaction. If you have a lot, you should probably just\nfill it all up and compact it, I guess.\n\n16-bits is fine for timeouts since that's 65535 block heights, which is\na little over a year's worth. Nothing's stopping you from supporting\nmore than a year's worth if you can find the route, but that's a fine\nupper-bound for now.\n\n32-bits is used for the Commitment Transaction. For even the most\nhigh-volume node, 10 commitments per second results in 300 million\nCommitment Transactions. This identifies in which Commitment Transaction\nthe HTLC was created. By knowing the Commitment Transaction, you'll know\nthe revocation preimage, so after the revocation information has been\nexchanged, you only need to know which Commitment Transaction the HTLC\nwas originally formed, since the revocation information was originally\n*generated* using a merkle tree derived from the Commitment Transaction\nas an index.\n\nIn total that's 48-bits (6bytes) per HTLC output per Commitment. Plus\n20-bytes for the hash(R), 26bytes.\n\nIf someone broadcasts an old Commitment and you don't have the HTLC data\nbecause it's expired and too old, check the OP_RETURN data for the\n6-bytes, then compute the revocation data and compute a couple hundred\nrevocations and see which one fits.\n\nI think the tradeoff might be worth it. If you stored this data locally,\nthe cost shouldn't be too high for end-users. However, for those that\nwish to do a lot of routing, this can add up. A node that does 10\ncommits/s with 100 HTLCs on average that results in a little over 800GB\nof local storage per channel if OP_RETURN wasn't used, which may very\nwell be feasible for large hubs. Of course, whether OP_RETURN or local\nstorage were used, it's better than having the entire script as part of\nthe output.\n\n-- \nJoseph Poon",
"sig": "23d1a324048d55a9bdb273316c85cfecd39a86ee13115e3fce09728d08f5945c137c944363fb80e017055bef576d73b3fb32eb31a4d973362a58e423a978ab76"
}