On Sun, May 05, 2024 at 09:39:51PM -1000, David A. Harding wrote: > > Hi Andrew, > > I don't understand the above. I think of a covenant as a script that is > able to restrict the scriptPubKey of the transaction that spends it. As I > understand Heilman's description, a lamport signature commits to the size of > an ECDSA signature (which can naturally vary) and the ECDSA signature > commits to the spending transaction. Performing the lamport verification on > the stack is practically equivalent to OP_CHECKSIGFROMSTACK, which is half > of what you need for a covenant. As you've previously described[1], the > other half is some method for introspection. How do lamport signatures > offer introspection when they're restricted to committing to ECDSA > signatures that can't be known at the time a script is created due to > circular dependency in hashing (i.e., the ECDSA signature commits to the > spending transaction, which commits to the previous transaction's txid, > which commits to the script)? > Aside from limits on transaction size, post-Taproot script can verify a trace of any program execution, as long as the individual elements it is operating on fit into 4-byte CScriptNums. You can therefore implement SHA2, ECDSA, etc., and reconstruct the pattern of SIZE elements by feeding in transaction data. Which of course can then be arbitrarily constrained. Probably actually doing this would take more than 4 megs of script and you would need to use some sort of BitVM tricks and the whole thing might not work. But this was my point in saying that "only the script limits are stopping us from having covenants". And pre-Taproot we have only 201 opcodes so of course this is all totally out of the question :) but plausibly we could make a copy of the Lamport signature in a Taproot output and then use non-equivocation slashing conditions to somehow make things work. -- Andrew Poelstra Director, Blockstream Research Email: apoelstra at wpsoftware.net Web: https://www.wpsoftware.net/andrew The sun is always shining in space -Justin Lewis-Webster -- You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group. To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/bitcoindev/ZjkJ0fPyzuAPTLWS%40camus.