This idea came out of a discussion with Thorkil.
Under normal circumstances, the Guesser only gets access to the Guesser UTXOs. It turns out that the Composer can produce a block proposal whose coinbase UTXOs are spendable by whoever guesses that block. Here is how to do it.
The coinbase UTXO’s lock script validates the following logic.
- Read the transaction kernel MAST hash.
- Divine in and authenticate the transaction’s
inputs.- Assert that the length of
inputsis 1. (Use Merge to combine this transaction with others.) - Note that
inputs[0]is the hash of, among other things, theUtxo. ThatUtxohas a lock script hash. Assert that that lock script hash matches own program hash.
- Assert that the length of
- Divine in and authenticate the mutator set accumulator.
- Divine in the index into the AOCL of the UTXO currently being spent, and authenticate it.
- Divine in the index into the AOCL of the first Guesser UTXO of the block that created this UTXO. Divine in and authenticate that Guesser UTXO as well as its lock script hash and sender randomness. Note that the sender randomness corresponds to the block’s hash.
- Divine in and authenticate the block’s transaction and its outputs and counts its number of outputs.
- Assert that the UTXO currently being spent and the Guesser UTXO come from the same block, by checking that the difference of indices is smaller than the output count.
- Verify that the Guesser UTXO’s lock script can be satisfied with the current transaction kernel mast hash. (Obvious optimization available if you know it’s a simple hash lock – no recursion.)