bitcoinwarrior1 / learn-solidity-with-examples

A repo full of smart contracts written in solidity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dynamic calling of BTC Relay

ethers opened this issue · comments

Wanted to let you know
https://github.com/James-Sangalli/Solidity-Contract-Examples/blob/8b4889cfc67abc7debdc6a4cd6d688f0d2157e3e/Finance/bitcoin-to-ethereum-swap/BTC2ETH.sol#L353-L355 shouldn't work.

As a start, the method is verifyTx. But you shouldn't need to use dynamic calling: you should be able to give the btcrelay variable a contract type, instead of address, so you can then do btcRelay.verifyTx(...)

@ethers made some of the changes, I am wondering how the spv proofs are validated in btcrelay? How do we know the node is providing the actual chain state of bitcoin?

@ethers not really sure how you would pull of dynamic calling (except from manually manipulating the bytecode) if my contract is in solidity and btcrelay is in serpent.

As for the proofs, I guess it is easy to verify (independently) that the truth is in the contract? I mean, the history might be wrong but you can at least tell that is the case?

Handled.