how is contract validated

Hi, I am wondering how is the transaction creating a contract validated by the blockchain, also the message sent to a contract. I know bitcoin has a set of criteria to verify the transactions. Does ethereum use any criteria to verify transactions with code?

Thanks. :)

Comments

  • SmithgiftSmithgift Member Posts: 64
    I'm not sure if I understand your question. Are you asking how the network agrees a contract was executed properly?

    Essentially, the miner runs the contract creation or message transaction in the Ethereum Virtual Machine, and will put whatever changes the transaction makes in the block he is trying to mine. Once that block is mined, all the other nodes and miners will examine the transaction to see if their execution of the same transaction matches the miner's block. If it does, they start mining on that block. If it doesn't, they reject the block.
Sign In or Register to comment.