Hundreds of lines of complex Bitcoin hacks reduced to a simple Solidity contract. Wow.
A couple of years back I was working on a smart contract in Bitcoin that implemented pay for private key contracts. The idea was that you can setup a contract to pay someone for releasing the details that allow a particular ECDSA Bitcoin private key to be extracted and payment is obviously conditional on the solution being correct.
In Bitcoin this is really damn complicated for a number of reasons. The first reason is that transaction IDs in Bitcoin can be randomly mutated so that chains of unconfirmed transactions can be invalided . And the second reason is that all of the OP_CODES you need to create complex contracts in Bitcoin are either disabled or too limited to use.
That meant that the only way I could figure out how to get this contract to work on Bitcoin was to:
- Rely on a theoretical segwit existing (it’s not deployed yet) and
- Build a chain of transactions in such a way
Continue reading →