6

As far as I know, we can deploy a contract with the same address in different chains by using the same private key to create an account in different chains, and using that account to deploy the contract. If that account has made no transactions in any chain, the nonce will be the same and therefore the address of the created account will also be the same.

But this means handling the private key, and that may be considered insecure.

In this EIP (in the "Deployment method" section) a method (called Nick's method, I don't know why) is proposed that allows to create a contract with the same address but guaranteeing that no one know the private key. And while I think I get the heart of the idea, I don't really know how to execute it.

So I'd like to know: How does that method work? What are the detailed steps to use it? And who is Nick?

3
  • 4
    I'm pretty sure I understand how to do this (though I don't know who Nick is). The basic idea is to make a transaction to deploy the contract and then change the s value to something obviously hand-picked (e.g. aaaaaaa). Then recover the address from that (altered) signature and transfer ether to that account to cover the deployment cost. If that didn't help, could you ask a more specific question?
    – user19510
    Commented Mar 22, 2018 at 21:49
  • The "something obviously hand-picked" was the part I was missing. And I guess you can change the s value arbitrarily? Thanks! If you make an answer I will accept it. Commented Mar 23, 2018 at 11:56
  • 1
    if I try to deploy the same smart contract on many networks (like MainNet, Ropsten, Kovan, Renkby), what I should to do to get the same address in all those networks ???
    – arafat877
    Commented May 20, 2021 at 3:33

3 Answers 3

4

On EIP 820 there is a link to Nick's article:

How to send Ether to 11,440 people

So Nick is Nick Johnson, according to his twitter account, he is "Core developer on go-ethereum, lead developer of ENS." The article linked above explains one time addresses, which I think is what you are looking for.

1

Take a look at CREATE2 https://docs.openzeppelin.com/cli/2.8/deploying-with-create2

The CREATE2 opcode gives us the ability predict the address where a contract will be deployed, without ever having to do so. This opens up lots of possibilities to improve user onboarding and scalability.

The whole idea behind this opcode is to make the resulting address independent of future events. Regardless of what may happen on the blockchain, it will always be possible to deploy the contract at the precomputed address.

It was recommended to me by https://twitter.com/2d_eddie

0

If you are looking for a most advanced explanation here it is: Nick's method -- Ethereum Keyless Execution

This article states who is nick, how the method works, and the details to recreate. Also provide the other usecases, limitations and edge cases and an npm package that facilitates all the work to deploy a contract on the same address at different chains.

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.