Let's have a simple contract as given in Solidity documentation.

pragma solidity ^0.4.11;

contract SimpleStorage {
    uint storedData;

    function set(uint x) {
        storedData = x;

    function get() constant returns (uint) {
        return storedData;

We have a contract at an address where anyone can change value. What I fail to understand here when anyone can come and change the value of such contract, how can we say blockchain is immutable?

Is blockchain immutable with respect to the position of contract itself in the blockchain and its address only? If anyone could wrap my head around this please, it would be helpful.

1 Answer 1


Don't confuse immutability of previous transactions with mutable state.

What Ethereum brought to the party was "state." By its nature state needs to be mutable, otherwise it's just a constant and nothing dynamic happens.

The thing that's immutable is the history of how the state has changed. That history is stored in transactions which are stored in blocks.

The transactions and blocks are unchangeable once the system comes to consensus. They record with perfect clarity for all time how the state has changed.

  • Thanks Tom, in the context of the get, set contract above, do you mean by your answer that let's say if I set some value there will be transaction which will be generated and blockchain will have the value of x as its state. Whenever I set the value again, a new transaction will be generated meaning the state being dynamic will change. It will transition from the value of x which I put in my first get as 1234 to 12345 which I set it to later. Am I making sense?
    – Manganese
    Commented Aug 2, 2017 at 3:54
  • 2
    Exactly. To change state you must send a transaction. Instructions for changing the state are encoded in the 'input' data field of the transaction which carries the function call and the parameters to the function. In your case the set would be encoded. Note that the get does not cause a transaction because it is constant and does not change state. Commented Aug 2, 2017 at 3:59
  • Note that the get does not cause a transaction because it is constant and does not change state. --- Sir yes sir! Perfect, thanks much.
    – Manganese
    Commented Aug 2, 2017 at 4:00

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.