{"type":"rich","version":"1.0","author_name":"npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2","author_url":"https://nostr.ae/npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2","provider_name":"njump","provider_url":"https://nostr.ae","html":"📅 Original date posted:2019-10-05\n📝 Original message:On Fri, Oct 04, 2019 at 11:40:53AM -0700, Jeremy wrote:\n\u003e Interesting point.\n\u003e \n\u003e The script is under your control, so you should be able to ensure that you\n\u003e are always using a correctly constructed midstate, e.g., something like:\n\u003e \n\u003e scriptPubKey: \u003c-1\u003e OP_SHA256STREAM DEPTH OP_SHA256STREAM \u003c-2\u003e\n\u003e OP_SHA256STREAM\n\u003e \u003chash\u003e OP_EQUALVERIFY\n\u003e \n\u003e would hash all the elements on the stack and compare to a known hash.\n\u003e How is that sort of thing weak to midstateattacks?\n\nObviously with care you can get the computation right. But at that point what's\nthe actual advantage over OP_CAT?\n\nWe're limited by the size of the script anyway; if the OP_CAT output size limit\nis comparable to that for almost anything you could use SHA256STREAM on you\ncould just as easily use OP_CAT, followed by a single OP_SHA256.\n\n-- \nhttps://petertodd.org 'peter'[:-1]@petertodd.org\n-------------- next part --------------\nA non-text attachment was scrubbed...\nName: signature.asc\nType: application/pgp-signature\nSize: 833 bytes\nDesc: not available\nURL: \u003chttp://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20191005/213e4e81/attachment.sig\u003e"}
