[Ethereum] How does Ethereum avoid address collision

addressesgo-ethereumhash

Recently PillarProject reported an issue where there was collision (?) of sort. Apparently their smart contract address on Rinkeby testnet matched with real address on the mainnet.

I am aware that smart contract addresses don't have private key perse. These are generated via a deterministic algorithm that takes into account

  1. address of the creator (sender)
  2. how many transactions the creator has sent
  3. And this is hashed with Keccak-256.

Now theoretically if I were to create a real address on a testnet and assuming that this address matches with a smart contract address on the mainnet. If I were to import my private key to mainnet from any of the ethereum client nodes. Would I have access to the smart contract ether as well?? Is this possible? Or am I talking nonsense??

Lets take the example of Pillarproject itself. If the person having access to the address on the mainnet were to import his address onto rinkeby. What would happen?

Any thoughts?

Best Answer

I think this answer might be what you are looking for.

Is each Ethereum address shared by (theoretically) 2 ** 96 private keys?

There is no difference between testnet accounts and main-net accounts, you can move accounts between them, but of course transactions done in one net have not happen on the other.

Contracts live on the block chain, so they are unique to the current test/main network. if someone (speculating) creates a contract with the same address as a contract on another network, it doesn't mean anything and doesn't grant them any powers to the contract with the same address on the other network.

It's the contract owner account private key that is important (as the creator/owner).

Related Topic