0

I was wondering about the immutabilty part of blockchain. I have written a good number of smart contracts but, recently I used delete and you can remove the data in the blockchain. Now, the data deleted will be there in some older blocks so is there way to get it?

I stumbled upon this question when I was searching for an answer.

1

You can, but you need to have a node with the state of the old block. You won't be able to access that data on-chain, but with enough effort you can access it off-chain. One potential way to do this is sync your local node only up to the block that had the data, then stop syncing and query the node.

I believe the various nodes have other mechanisms for accessing old state, but don't expect that getting at the data will be easy and again, these techniques are only for accessing the data off-chain, meaning you can't get at the deleted data from a new smart contract.

  • Tracking the data each time the data is updated doesn't sound reasonable to me, but as I according to my knowledge ethereum creates a mapping from contract address to functions/variables. SO can i use this information and get that? Can you give an example of off-chain techniques or it would be good if you could point me to any resource in this regard. – Rajat Aug 1 '17 at 5:32
  • It may help if you describe the specific problem you are trying to solve a bit more. Is this a one-time operation where you need to dig up some old data? Are you building a tool that will let you dig up arbitrary old data from the blockchain? Are you writing a contract that needs to track a history of state changes? I ask this because the solution for each is quite different. One of the answers in the other question you linked hints at a way to look at old blocks: ethereum.stackexchange.com/a/1065/704 – Micah Zoltu Aug 1 '17 at 14:17
  • @Micha I dont have to do anything speacial its just that, blockchain acts as immutable and a databse which can be trusted. So I was curious as to how can i get the old values as well. Now I think it would be not very frequent and it is not for any application or tool. Thanks for the question your directed me too, it was really helpful – Rajat Aug 2 '17 at 6:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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