Stefan Thomas [ARCHIVE] on Nostr: 📅 Original date posted:2012-01-02 📝 Original message:+1. I love this proposal. ...
📅 Original date posted:2012-01-02
📝 Original message:+1. I love this proposal.
It's two less bytes than OP_EVAL even.
It allows static analysis.
It doesn't require any change to the script interpreter. (You can do a
static replacement step between parsing and execution.)
It allows all urgent use cases.
It doesn't consume a NOP. If we ever want recursion or something else,
we can still add OP_EVAL,... then.
@roconnor:
> 1. make the script: OP_NOP1 HASH160 <push-20-byte-hash> EQUAL to make
> it extremely easy to see from the first byte that this is verly likely
> to be a special transaction (or more accurately if the first byte
> isn't OP_NOP1 then you immediately know it isn't a special script and
> can even disregard the token).
I disagree. If people actually do mean HASH160 <hash> EQUAL, let *them*
add a NOP. Or better to avoid NOP let them use HASH160 <hash>
EQUALVERIFY 1. Point is, if you don't want code replacement you can
easily break the pattern. But code replacement will be overwhelmingly
more common, so it should be as small as possible. Every byte matters.
On 1/2/2012 4:59 PM, Gavin Andresen wrote:
> Here are my latest thoughts on a safer OP_EVAL alternative, inspired
> by all the ideas and agitated IRC and email
> discussions of the last week or so:
>
> Goal: Let users publish a short "funding address" that is the hash of
> an arbitrary redemption Script revealed when they spend the funds,
> implemented in a backwards-compatible-in-the-blockchain way.
>
> Proposal:
>
> A new 'standard' transaction type, "pay to Script hash":
>
> scriptPubKey: HASH160<push-20-byte-hash> EQUAL
>
> Redeemed with the same scriptSig as the OP_EVAL proposal:
> <signatures> <serialized Script>
>
> Old clients/miners will ignore<signatures> and just validate that the
> hash of<serialized Script> matches.
>
> New clients/miners will recognize the new type of transaction and will
> do the following additional validation:
>
> 1. Fail validation if there were any operations other than "push data"
> in the original scriptSig.
> 2. Deserialize the top (last) item on the scriptSig stack (fail
> validation if it fails to deserialize properly).
> 3. Run an additional validation on the deserialized script, using the
> remaining items on the scriptSig stack and the deserialized script as
> the scriptPubKey.
>
>
> ---------------
>
> As Amir said in IRC chat today, "the idea is a hack.... but I like it."
>
> I like it, too-- it is cleaner than OP_EVAL, more straightforward to
> implement, and pretty much exactly matches the feature I care about
> (moving code from the scriptPubKey to the scriptSig). There are no
> special cases like "CODESEPARATORS not allowed in<serialized
> script>".
>
Published at
2023-06-07 02:54:51Event JSON
{
"id": "0149688b6deaaed8be7094c3d57f225bdc5a2112de85e43341e76fcd6be31204",
"pubkey": "49f07bd32c0108a2903a0fa59f904ed312e0ea427d3269eb5fa910eb4a9e22c4",
"created_at": 1686106491,
"kind": 1,
"tags": [
[
"e",
"35f29e32562f8d591ac4304d17ba7c9f069c49290c94dc1bc574c2a6d35a149e",
"",
"root"
],
[
"e",
"8e6eae27fb67ee664380e70e08c8313af2e73f96037e6820b7df5cd1b827d082",
"",
"reply"
],
[
"p",
"ec4a4dbf50f892d8061c301520612ae1f0d68350dff4e3e14707d47419d55206"
]
],
"content": "📅 Original date posted:2012-01-02\n📝 Original message:+1. I love this proposal.\n\nIt's two less bytes than OP_EVAL even.\nIt allows static analysis.\nIt doesn't require any change to the script interpreter. (You can do a \nstatic replacement step between parsing and execution.)\nIt allows all urgent use cases.\nIt doesn't consume a NOP. If we ever want recursion or something else, \nwe can still add OP_EVAL,... then.\n\n@roconnor:\n\u003e 1. make the script: OP_NOP1 HASH160 \u003cpush-20-byte-hash\u003e EQUAL to make \n\u003e it extremely easy to see from the first byte that this is verly likely \n\u003e to be a special transaction (or more accurately if the first byte \n\u003e isn't OP_NOP1 then you immediately know it isn't a special script and \n\u003e can even disregard the token). \n\nI disagree. If people actually do mean HASH160 \u003chash\u003e EQUAL, let *them* \nadd a NOP. Or better to avoid NOP let them use HASH160 \u003chash\u003e \nEQUALVERIFY 1. Point is, if you don't want code replacement you can \neasily break the pattern. But code replacement will be overwhelmingly \nmore common, so it should be as small as possible. Every byte matters.\n\n\nOn 1/2/2012 4:59 PM, Gavin Andresen wrote:\n\u003e Here are my latest thoughts on a safer OP_EVAL alternative, inspired\n\u003e by all the ideas and agitated IRC and email\n\u003e discussions of the last week or so:\n\u003e\n\u003e Goal: Let users publish a short \"funding address\" that is the hash of\n\u003e an arbitrary redemption Script revealed when they spend the funds,\n\u003e implemented in a backwards-compatible-in-the-blockchain way.\n\u003e\n\u003e Proposal:\n\u003e\n\u003e A new 'standard' transaction type, \"pay to Script hash\":\n\u003e\n\u003e scriptPubKey: HASH160\u003cpush-20-byte-hash\u003e EQUAL\n\u003e\n\u003e Redeemed with the same scriptSig as the OP_EVAL proposal:\n\u003e \u003csignatures\u003e \u003cserialized Script\u003e\n\u003e\n\u003e Old clients/miners will ignore\u003csignatures\u003e and just validate that the\n\u003e hash of\u003cserialized Script\u003e matches.\n\u003e\n\u003e New clients/miners will recognize the new type of transaction and will\n\u003e do the following additional validation:\n\u003e\n\u003e 1. Fail validation if there were any operations other than \"push data\"\n\u003e in the original scriptSig.\n\u003e 2. Deserialize the top (last) item on the scriptSig stack (fail\n\u003e validation if it fails to deserialize properly).\n\u003e 3. Run an additional validation on the deserialized script, using the\n\u003e remaining items on the scriptSig stack and the deserialized script as\n\u003e the scriptPubKey.\n\u003e\n\u003e\n\u003e ---------------\n\u003e\n\u003e As Amir said in IRC chat today, \"the idea is a hack.... but I like it.\"\n\u003e\n\u003e I like it, too-- it is cleaner than OP_EVAL, more straightforward to\n\u003e implement, and pretty much exactly matches the feature I care about\n\u003e (moving code from the scriptPubKey to the scriptSig). There are no\n\u003e special cases like \"CODESEPARATORS not allowed in\u003cserialized\n\u003e script\u003e\".\n\u003e",
"sig": "5dbf9c8c6d05323c1498510c5dae0b8ff3733421c5d2f74ee9381683f4751a06d7e0c152f985ba676d5940282cf2d8964ba372e03b46ae257f2a598a875f4331"
}