0

Let's get creation of a smart contract address out of the way:

The address for an Ethereum contract is deterministically computed from the address of its creator (sender) and how many transactions the creator has sent (nonce). The sender and nonce are RLP encoded and then hashed with Keccak-256.

Now my question is, if there is only one contract, deployed on 2 nodes, that one contract should have the same address right?

1

Once a contract is deployed (the deployment transaction is mined), that contract exists on all nodes in the network. Since the deployed contract is included in the state of the blockchain, it is replicated and redundant across all nodes. And yes, this contract will have the same address on all of the nodes.

If you deployed a contract from one node and then deployed the same contract from another node using the same externally owned account, the two contracts would have different addresses because the transaction count (nonce) of the externally owned account would be different. Both of these contracts--that have the same code, but different addresses--would then exist on every node in the network.

  • You answer could be 100% correct, but those 2 paragraphs seem a bit contradictory. Specially the same EOC part. Can a smart contract be deployed without EOC? How many ways are there to deploy a smart contract? – Faraz Durrani Aug 7 at 22:55
  • It is possible to deploy a contract from another contract. You can read more about that here: ethereum.stackexchange.com/questions/13415/… Typically if you are deploying contracts from a node it is from and EOA. An EOA is controlled by a private key, EOAs are not connected to specific nodes. – Josh Aug 8 at 13:36

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.