Rusty Russell [ARCHIVE] on Nostr: 📅 Original date posted:2018-01-09 📝 Original message:I've just re-read BIP 117, ...
📅 Original date posted:2018-01-09
📝 Original message:I've just re-read BIP 117, and I'm concerned about its flexibility. It
seems to be doing too much.
The use of altstack is awkward, and makes me query this entire approach.
I understand that CLEANSTACK painted us into a corner here :(
The simplest implementation of tail recursion would be a single blob: if
a single element is left on the altstack, pop and execute it. That
seems trivial to specify. The treatment of concatenation seems like
trying to run before we can walk.
Note that if we restrict this for a specific tx version, we can gain
experience first and get fancier later.
BIP 117 also drops SIGOP and opcode limits. This requires more
justification, in particular, measurements and bounds on execution
times. If this analysis has been done, I'm not aware of it.
We could restore statically analyzability by rules like so:
1. Only applied for tx version 3 segwit txs.
2. For version 3, top element of stack is counted for limits (perhaps
with discount).
3. The blob popped off for tail recursion must be identical to that top
element of the stack (ie. the one counted above).
Again, future tx versions could drop such restrictions.
Cheers,
Rusty.
Published at
2023-06-07 18:09:38Event JSON
{
"id": "9f3178365705d403246429a153039bc643490d86f9aad98a3a4c13a861f3bdf3",
"pubkey": "13bd8c1c5e3b3508a07c92598647160b11ab0deef4c452098e223e443c1ca425",
"created_at": 1686161378,
"kind": 1,
"tags": [
[
"e",
"da21dfc12dad201077b712a466fd7c6d92ad2242c5c649a8737f1423ddae6784",
"",
"reply"
],
[
"p",
"a23dbf6c6cc83e14cc3df4e56cc71845f611908084cfe620e83e40c06ccdd3d0"
]
],
"content": "📅 Original date posted:2018-01-09\n📝 Original message:I've just re-read BIP 117, and I'm concerned about its flexibility. It\nseems to be doing too much.\n\nThe use of altstack is awkward, and makes me query this entire approach.\nI understand that CLEANSTACK painted us into a corner here :(\n\nThe simplest implementation of tail recursion would be a single blob: if\na single element is left on the altstack, pop and execute it. That\nseems trivial to specify. The treatment of concatenation seems like\ntrying to run before we can walk.\n\nNote that if we restrict this for a specific tx version, we can gain\nexperience first and get fancier later.\n\nBIP 117 also drops SIGOP and opcode limits. This requires more\njustification, in particular, measurements and bounds on execution\ntimes. If this analysis has been done, I'm not aware of it.\n\nWe could restore statically analyzability by rules like so:\n1. Only applied for tx version 3 segwit txs.\n2. For version 3, top element of stack is counted for limits (perhaps\n with discount).\n3. The blob popped off for tail recursion must be identical to that top\n element of the stack (ie. the one counted above).\n\nAgain, future tx versions could drop such restrictions.\n\nCheers,\nRusty.",
"sig": "74d24801805affaf78128ddaaeff8d35d0caad81618c9b15e72a579b718901469a833f84a67691d3670240d49db0103038a2b657d91e52a84992a90866faa592"
}