4 ms·
I’ve been thinking, shouldn’t it be possible to exchange Bitcoin for Ethereum trustlessly? It requires that Ethereum smart contracts recognize Bitcoin (secp256k
by runeks 9y ago
I’ve been thinking, shouldn’t it be possible to exchange Bitcoin for Ethereum trustlessly? It requires that Ethereum smart contracts recognize Bitcoin (secp256k1) signatures over arbitrary hashes, though. It would work like this:
1) create an unsigned Bitcoin transaction that pays 1 BTC from Alice to Bob
2) create an Ethereum address (smart contract) that can be redeemed either a) by Alice using a signature for a pubkey specified by Alice in advance, plus an secp256k1 (Bitcoin) signature over the hash of the Bitcoin transaction or b) by Bob after a timeout (e.g. 7 days)
Bob sends the number of ethers he wants to pay for 1 BTC to this Ethereum address/contract, and if Alice takes the offer she will redeem this amount, thus revealing the signature for the Bitcoin transaction, which Bob can then publish and get his 1 BTC.
- DennisP 9y agoI think you independently invented atomic swaps! Ethereum uses the same signature algorithm; you can sign arbitrary data from Ethereum's javascript library and check it from a contract. https://ethereum.stackexchange.com/questions/2256/ethereum-ecrecover-signature-verification-and-encryption https://ethereum.stackexchange.com/questions/2256/ethereum-e... https://ethereum.stackexchange.com/questions/710/how-can-i-verify-a-cryptographic-signature-that-was-produced-by-an-ethereum-addr/718#718 https://ethereum.stackexchange.com/questions/710/how-can-i-v...