1

TO be specific, how to read block headers of Rinkeby on Ropsten blockchain? Since both the blockchains are public test networks, reading data of one blockchain on another should be possible using smart contracts, isn't it?

1
  • Do you mean of Rinkeby **and** Ropsten ? Commented Mar 16, 2020 at 8:08

1 Answer 1

1

Both Rinkeby and Ropsten are public networks. But they are two different ethereum networks and have two seperate blockchains. By design, a blockchain Smart Contract cannot access any outside information other than what it receives by means of the signed payload which is the transaction that invoked this Smart Contract. The Smart Contract in a blockchain is able to read the block number etc. in that chain because there is already a consensus on what these values are between the nodes in that network where the contract is running and thus does not affect determinism.

The block headers of a different blockchain are surely outside information which might be read differently by different nodes and hence cannot be read directly by a Smart Contract. So to answer your question.. No. It is not possible directly.

Having said that you can implement an oracle which is a way to make outside information available to your Smart Contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.