Detecting OP_EVAL scriptPubKeys that are to you



Summary:

Mike Hearn, a Bitcoin developer, asked about detecting a transaction in a block that is relevant to one's wallet that uses OP_EVAL. He asked if the detection requires pre-calculating every possible hash that may appear. Gavin Andresen, another developer, suggested giving the hash to whoever pays and stores the hash-script mapping upon payment. The only use case for checking every possible hash is when one loses their wallet and has no hash-script mappings. However, for other people's use cases, they can ask which public keys are involved, add them back into the wallet, and use the "addmultisigaddress" RPC interface. For cases where all keys belong to the user, an automatic backup or "-rescan" equivalent is necessary should the mappings get lost.


Updated on: 2023-06-04T20:55:59.596658+00:00