4

I am looking for someone to help clarify the 'stacktrace' of interactions that occur when a client interacts with a smart contract.

Clearly, one has to submit a transaction to a miner, who then has to locate the contract by address (by using his/her own local copy of the blockchain?), and complete the computation set out in the contract.

Is the entire contract then re-written once again into the blockchain with the outputs representing the output of the computation that has taken place?

1 Answer 1

4

Indeed the miner locates a contract by using their local copy of the blockchain.

Is the entire contract then re-written once again into the blockchain with the outputs representing the output of the computation that has taken place?

Contracts are immutable. But each contract can have a "hard disk", called storage, and that's where the outputs of computations can be written.

Technically:

The web3.js Javascript API Contract Methods are a way to interact with contracts.

JSON-RPC is a lower-level way of interacting with contracts.

3
  • Ok thanks - is the storage located within the original block in which the contract was mined?
    – glider
    Feb 11, 2016 at 20:02
  • Kind of, it's via pointers to trees. Each block has a "state root" which contains accounts. Each account has a "storage root". Overview at ethereum.stackexchange.com/questions/268/…
    – eth
    Feb 11, 2016 at 20:29
  • Fantastic links & description with pictures. +1
    – glider
    Feb 11, 2016 at 21:41

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.