Gavin Andresen [ARCHIVE] on Nostr: š
Original date posted:2012-01-02 š Original message:Here are my latest ...
š
Original date posted:2012-01-02
š Original message: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>".
--
--
Gavin Andresen
Published at
2023-06-07 02:54:44Event JSON
{
"id": "1e127c9f52aa4a351b9035ce49458c577c1ceddf26d48d33b5854079f21e6601",
"pubkey": "857f2f78dc1639e711f5ea703a9fc978e22ebd279abdea1861b7daa833512ee4",
"created_at": 1686106484,
"kind": 1,
"tags": [
[
"e",
"35f29e32562f8d591ac4304d17ba7c9f069c49290c94dc1bc574c2a6d35a149e",
"",
"root"
],
[
"e",
"7adf4b17ce8fe4e2a10e215fc7d602dbad3a8a1b91cbbd58f83da72c88bcf4d6",
"",
"reply"
],
[
"p",
"49f07bd32c0108a2903a0fa59f904ed312e0ea427d3269eb5fa910eb4a9e22c4"
]
],
"content": "š
Original date posted:2012-01-02\nš Original message:Here are my latest thoughts on a safer OP_EVAL alternative, inspired\nby all the ideas and agitated IRC and email\ndiscussions of the last week or so:\n\nGoal: Let users publish a short \"funding address\" that is the hash of\nan arbitrary redemption Script revealed when they spend the funds,\nimplemented in a backwards-compatible-in-the-blockchain way.\n\nProposal:\n\nA new 'standard' transaction type, \"pay to Script hash\":\n\nscriptPubKey: HASH160 \u003cpush-20-byte-hash\u003e EQUAL\n\nRedeemed with the same scriptSig as the OP_EVAL proposal:\n\u003csignatures\u003e \u003cserialized Script\u003e\n\nOld clients/miners will ignore \u003csignatures\u003e and just validate that the\nhash of \u003cserialized Script\u003e matches.\n\nNew clients/miners will recognize the new type of transaction and will\ndo the following additional validation:\n\n1. Fail validation if there were any operations other than \"push data\"\nin the original scriptSig.\n2. Deserialize the top (last) item on the scriptSig stack (fail\nvalidation if it fails to deserialize properly).\n3. Run an additional validation on the deserialized script, using the\nremaining items on the scriptSig stack and the deserialized script as\nthe scriptPubKey.\n\n\n---------------\n\nAs Amir said in IRC chat today, \"the idea is a hack.... but I like it.\"\n\nI like it, too-- it is cleaner than OP_EVAL, more straightforward to\nimplement, and pretty much exactly matches the feature I care about\n(moving code from the scriptPubKey to the scriptSig). There are no\nspecial cases like \"CODESEPARATORS not allowed in \u003cserialized\nscript\u003e\".\n\n-- \n--\nGavin Andresen",
"sig": "1aaaa7a531e59652f16f116ef491974e0aa6618d9a479f2c8945da6fcca74d6728f00dfc5add1d48e380f3332154b30c76497ec1649ee7a5737b3fdf44703a7f"
}