From f6412e970086165cb9d118e0b14a4898a9b64872 Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Fri, 5 Jul 2024 11:30:11 +0200 Subject: [PATCH 01/10] Create rip-77XX.md --- RIPS/rip-77XX.md | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 RIPS/rip-77XX.md diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md new file mode 100644 index 0000000..8137770 --- /dev/null +++ b/RIPS/rip-77XX.md @@ -0,0 +1,45 @@ +--- +rip: 77XX +title: Predeploys for deterministic deployments +description: Proposal to add predeployed factory contracts at common addresses that enable determinstic contract deployment. +author: Richard Meissner (@rmeissner) +discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 +status: Draft +type: Standards Track +category: Core +created: 2024-06-24 +--- + +## Abstract + +This proposal introduces a set of predeployed factory contracts at common addresses that enable deterministic deployment at the same address across different networks. + +## Motivation + +- There are multiple factory contracts that are common + - [Deterministic Deployment Proxy](https://github.com/Arachnid/deterministic-deployment-proxy) + - [Safe Singleton Factory](https://github.com/safe-global/safe-singleton-factory?tab=readme-ov-file) + - [CreateX](https://github.com/pcaversaccio/createx) +- Risk of centralized keys +- Risk of parameters (gas price or gas limit) changes +- 7702 uses an address + +## Specification + +### Factories + +### Addresses + +### Gas Cost + +### References + +- OP Genesis definition + +## Rationale + +### Why not align on one factory? + +## Backwards Compatibility + +No backward compatibility issues found as the precompiled contract will be added to `PRECOMPILED_ADDRESS` at the next available address in the precompiled address set. From 3b7289b9f59a61f7f74768314ee08f3893f69604 Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Fri, 5 Jul 2024 13:47:49 +0200 Subject: [PATCH 02/10] Update rip-77XX.md --- RIPS/rip-77XX.md | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index 8137770..d93dc2b 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -1,7 +1,7 @@ --- rip: 77XX -title: Predeploys for deterministic deployments -description: Proposal to add predeployed factory contracts at common addresses that enable determinstic contract deployment. +title: Preinstall deterministic deployment factories +description: Proposal to add deployment factory contracts at common addresses that enable determinstic contract deployment. author: Richard Meissner (@rmeissner) discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 status: Draft @@ -12,34 +12,45 @@ created: 2024-06-24 ## Abstract -This proposal introduces a set of predeployed factory contracts at common addresses that enable deterministic deployment at the same address across different networks. +This proposal introduces a set of deployment factory contracts that should be preinstalled at common addresses. This will enable deterministic contract deployment at the same address across different networks. ## Motivation -- There are multiple factory contracts that are common - - [Deterministic Deployment Proxy](https://github.com/Arachnid/deterministic-deployment-proxy) - - [Safe Singleton Factory](https://github.com/safe-global/safe-singleton-factory?tab=readme-ov-file) - - [CreateX](https://github.com/pcaversaccio/createx) -- Risk of centralized keys -- Risk of parameters (gas price or gas limit) changes -- 7702 uses an address +Many projects rely on deployment factories that make use of `create2` to increase the security and determinism of deployments. Utilizing `crreate2` has a couple major advantages: +- The address does not depend on the deployment key, therefore reducing the needs to manage a deployment key +- The address of the contract is tied to the deployment code, which provides strong guarantees on the deployed code +- Contracts can be redeployed in case of a selfdestruct + +The downside is that it is still necessary to deploy these deployment factories. There are two common ways to do so: +- Utilize a randomly generated signature for a fixed deployment transactions +- Manage a deployment key for the deployment factory. + +Using a randomly generated signature for a fixed deployment transaction has the advantage that this is a fully trustless process and no deployment key has to be managed. But the parameter of signed deployment transaction cannot be changed, therefore it is not possible to adjust gas price, gas limits or set the chain id. + +Providing a stable way for deterministic and trustless deployments will become even more important with EIPs like EIP-7702. The strong guarantees provided by a deployment factory are extremely helpful in this case, as this EIP depends on the code at a specific address. + +To enable developers to rely on such libraries this RIP proposes to align on a set of deterministic deployment factories and preinstall these on all Rollups. ## Specification ### Factories -### Addresses - -### Gas Cost +The following factories should be added + - [Deterministic Deployment Proxy](https://github.com/Arachnid/deterministic-deployment-proxy) at `0x4e59b44847b379578588920ca78fbf26c0b4956c` + - [Safe Singleton Factory](https://github.com/safe-global/safe-singleton-factory) at `0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7` + - [CreateX](https://github.com/pcaversaccio/createx) at `0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed` + - [Create2 Deployer](https://github.com/pcaversaccio/create2deployer) at `0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2` ### References -- OP Genesis definition +- [OP Stack Preinstalls](https://docs.optimism.io/builders/chain-operators/features/preinstalls) ## Rationale ### Why not align on one factory? +The listed factories are already in active use on multiple networks. To ensure future compatibility without having to redeploy existing contracts it makes the most sense to enable a set of deployment factories that also cover a large part of the exsiting ecosystem. + ## Backwards Compatibility No backward compatibility issues found as the precompiled contract will be added to `PRECOMPILED_ADDRESS` at the next available address in the precompiled address set. From 1fb1dc9c4af3862736c51201ae0d7292aa19a0fa Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:32:50 +0200 Subject: [PATCH 03/10] Fix grammar and expand on motivation by highlighing that there are rollups already doing this --- RIPS/rip-77XX.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index d93dc2b..feeafbb 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -1,7 +1,7 @@ --- rip: 77XX title: Preinstall deterministic deployment factories -description: Proposal to add deployment factory contracts at common addresses that enable determinstic contract deployment. +description: Proposal to add deployment factory contracts at common addresses to enable deterministic contract deployments author: Richard Meissner (@rmeissner) discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 status: Draft @@ -12,12 +12,12 @@ created: 2024-06-24 ## Abstract -This proposal introduces a set of deployment factory contracts that should be preinstalled at common addresses. This will enable deterministic contract deployment at the same address across different networks. +This proposal introduces a set of deployment factory contracts to be preinstalled at common addresses. This will enable deterministic contract deployment to the same address across different networks. ## Motivation -Many projects rely on deployment factories that make use of `create2` to increase the security and determinism of deployments. Utilizing `crreate2` has a couple major advantages: -- The address does not depend on the deployment key, therefore reducing the needs to manage a deployment key +Many projects rely on deployment factories that make use of `create2` to increase the security and determinism of deployments. Utilizing `create2` has a couple of major advantages: +- The address does not depend on the deployment key, therefore reducing the need to manage a deployment key - The address of the contract is tied to the deployment code, which provides strong guarantees on the deployed code - Contracts can be redeployed in case of a selfdestruct @@ -25,11 +25,11 @@ The downside is that it is still necessary to deploy these deployment factories. - Utilize a randomly generated signature for a fixed deployment transactions - Manage a deployment key for the deployment factory. -Using a randomly generated signature for a fixed deployment transaction has the advantage that this is a fully trustless process and no deployment key has to be managed. But the parameter of signed deployment transaction cannot be changed, therefore it is not possible to adjust gas price, gas limits or set the chain id. +Using a randomly generated signature for a fixed deployment transaction has the advantage that this is a fully trustless process, and no deployment key has to be managed. But the parameter of signed deployment transaction cannot be changed, therefore it is not possible to adjust the gas price, gas limits or set the chain id. Providing a stable way for deterministic and trustless deployments will become even more important with EIPs like EIP-7702. The strong guarantees provided by a deployment factory are extremely helpful in this case, as this EIP depends on the code at a specific address. -To enable developers to rely on such libraries this RIP proposes to align on a set of deterministic deployment factories and preinstall these on all Rollups. +This RIP proposes aligning on a set of deterministic deployment factories and preinstalling these on all Rollups to enable developers to rely on such libraries. Some rollups, such as Optimism, already have a set of preinstalled contracts for deterministic deployments, and this proposal aims to extend this set to other Rollup stacks to prevent fragmentation. ## Specification @@ -44,7 +44,7 @@ The following factories should be added ### References - [OP Stack Preinstalls](https://docs.optimism.io/builders/chain-operators/features/preinstalls) - +- ## Rationale ### Why not align on one factory? From 600882ccf9deecb8cd41e34634921a67d32f7d6c Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:37:54 +0200 Subject: [PATCH 04/10] Update rip-77XX.md --- RIPS/rip-77XX.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index feeafbb..5a2af24 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -22,10 +22,10 @@ Many projects rely on deployment factories that make use of `create2` to increas - Contracts can be redeployed in case of a selfdestruct The downside is that it is still necessary to deploy these deployment factories. There are two common ways to do so: -- Utilize a randomly generated signature for a fixed deployment transactions +- Utilize a randomly generated signature for fixed deployment transactions - Manage a deployment key for the deployment factory. -Using a randomly generated signature for a fixed deployment transaction has the advantage that this is a fully trustless process, and no deployment key has to be managed. But the parameter of signed deployment transaction cannot be changed, therefore it is not possible to adjust the gas price, gas limits or set the chain id. +Using a randomly generated signature for a fixed deployment transaction has the advantage that this is a fully trustless process, and no deployment key has to be managed. But the parameter of the signed deployment transaction cannot be changed, therefore it is not possible to adjust the gas price, gas limits or set the chain ID. Providing a stable way for deterministic and trustless deployments will become even more important with EIPs like EIP-7702. The strong guarantees provided by a deployment factory are extremely helpful in this case, as this EIP depends on the code at a specific address. @@ -44,13 +44,13 @@ The following factories should be added ### References - [OP Stack Preinstalls](https://docs.optimism.io/builders/chain-operators/features/preinstalls) -- + ## Rationale ### Why not align on one factory? -The listed factories are already in active use on multiple networks. To ensure future compatibility without having to redeploy existing contracts it makes the most sense to enable a set of deployment factories that also cover a large part of the exsiting ecosystem. +The listed factories are already in active use on multiple networks. To ensure future compatibility without having to redeploy existing contracts, it makes the most sense to enable a set of deployment factories that also cover a large part of the existing ecosystem. ## Backwards Compatibility -No backward compatibility issues found as the precompiled contract will be added to `PRECOMPILED_ADDRESS` at the next available address in the precompiled address set. +No backward compatibility issues were found. From bf4d9f0e8c784a506259eee08d16546d8f02e983 Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:59:05 +0200 Subject: [PATCH 05/10] Expand on a potential backwards compatibility issue, add myself to the author list --- RIPS/rip-77XX.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index 5a2af24..8d91ad1 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -2,7 +2,7 @@ rip: 77XX title: Preinstall deterministic deployment factories description: Proposal to add deployment factory contracts at common addresses to enable deterministic contract deployments -author: Richard Meissner (@rmeissner) +author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08) discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 status: Draft type: Standards Track @@ -53,4 +53,8 @@ The listed factories are already in active use on multiple networks. To ensure f ## Backwards Compatibility -No backward compatibility issues were found. +One potential issue that is unlikely to arise is a rogue actor obtaining access to key-managed factories and deploying different code at the factory address to one of the networks affected by the proposal. If this happens before the proposal is implemented, the Authors propose two potential solutions: +- Revisit the list of factories +- Overwrite the code at the address. + +No other backward compatibility issues were found. From 58abef835dec12fa6a96282db15abd7929cfa400 Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Fri, 5 Jul 2024 15:01:12 +0200 Subject: [PATCH 06/10] Update rip-77XX.md --- RIPS/rip-77XX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index 8d91ad1..a8459d6 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -53,7 +53,7 @@ The listed factories are already in active use on multiple networks. To ensure f ## Backwards Compatibility -One potential issue that is unlikely to arise is a rogue actor obtaining access to key-managed factories and deploying different code at the factory address to one of the networks affected by the proposal. If this happens before the proposal is implemented, the Authors propose two potential solutions: +One potential issue that is unlikely to arise is a rogue actor obtaining access to a deployer key of one of the key-managed factories and deploying a different bytecode at the factory address to one of the networks affected by the proposal. If this happens before the proposal is implemented, the Authors propose two potential solutions: - Revisit the list of factories - Overwrite the code at the address. From 785d495e20a174743856daf574441c01e80c4c76 Mon Sep 17 00:00:00 2001 From: Mikhail <16622558+mmv08@users.noreply.github.com> Date: Fri, 5 Jul 2024 17:53:54 +0200 Subject: [PATCH 07/10] Expand on collisions --- RIPS/rip-77XX.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-77XX.md index a8459d6..8cb4183 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-77XX.md @@ -2,7 +2,7 @@ rip: 77XX title: Preinstall deterministic deployment factories description: Proposal to add deployment factory contracts at common addresses to enable deterministic contract deployments -author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08) +author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08), Nicholas Rodrigues Lordello (@nlordell) discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 status: Draft type: Standards Track @@ -35,12 +35,14 @@ This RIP proposes aligning on a set of deterministic deployment factories and pr ### Factories -The following factories should be added +The following factories should be added: - [Deterministic Deployment Proxy](https://github.com/Arachnid/deterministic-deployment-proxy) at `0x4e59b44847b379578588920ca78fbf26c0b4956c` - [Safe Singleton Factory](https://github.com/safe-global/safe-singleton-factory) at `0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7` - [CreateX](https://github.com/pcaversaccio/createx) at `0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed` - [Create2 Deployer](https://github.com/pcaversaccio/create2deployer) at `0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2` +For factories with a managed key, the nonce of the deployer account should be kept as is since the factories are not destructible and CREATE opcodes [revert](https://eips.ethereum.org/EIPS/eip-684) in case of a collision. + ### References - [OP Stack Preinstalls](https://docs.optimism.io/builders/chain-operators/features/preinstalls) From fc60104e1ebaf0f302c106b09a32bff418ab7c7a Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Wed, 10 Jul 2024 16:06:34 +0200 Subject: [PATCH 08/10] Update and rename rip-77XX.md to rip-7740.md --- RIPS/{rip-77XX.md => rip-7740.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename RIPS/{rip-77XX.md => rip-7740.md} (99%) diff --git a/RIPS/rip-77XX.md b/RIPS/rip-7740.md similarity index 99% rename from RIPS/rip-77XX.md rename to RIPS/rip-7740.md index 8cb4183..0fe76b5 100644 --- a/RIPS/rip-77XX.md +++ b/RIPS/rip-7740.md @@ -1,5 +1,5 @@ --- -rip: 77XX +rip: 7740 title: Preinstall deterministic deployment factories description: Proposal to add deployment factory contracts at common addresses to enable deterministic contract deployments author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08), Nicholas Rodrigues Lordello (@nlordell) From 1173ea473e45cc3e5bb402a13a68fe2ee7550e3d Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Wed, 15 Jan 2025 20:03:13 +0100 Subject: [PATCH 09/10] Update RIPS/rip-7740.md Co-authored-by: Nicolas Consigny <101647594+nconsigny@users.noreply.github.com> --- RIPS/rip-7740.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIPS/rip-7740.md b/RIPS/rip-7740.md index 0fe76b5..5edccf2 100644 --- a/RIPS/rip-7740.md +++ b/RIPS/rip-7740.md @@ -6,7 +6,7 @@ author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08), Nicholas Rodrig discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 status: Draft type: Standards Track -category: Core +category: RRC created: 2024-06-24 --- From 7166f8287b75f74dcc766931b66436a8f16b9a1d Mon Sep 17 00:00:00 2001 From: Richard Meissner Date: Wed, 15 Jan 2025 20:12:06 +0100 Subject: [PATCH 10/10] Add discussion thread --- RIPS/rip-7740.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIPS/rip-7740.md b/RIPS/rip-7740.md index 5edccf2..a82c13e 100644 --- a/RIPS/rip-7740.md +++ b/RIPS/rip-7740.md @@ -3,7 +3,7 @@ rip: 7740 title: Preinstall deterministic deployment factories description: Proposal to add deployment factory contracts at common addresses to enable deterministic contract deployments author: Richard Meissner (@rmeissner), Mikhail Mikheev (@mmv08), Nicholas Rodrigues Lordello (@nlordell) -discussions-to: https://ethereum-magicians.org/t/eip-proposal-create2-contract-factory-precompile-for-deployment-at-consistent-addresses-across-networks/6083/29 +discussions-to: https://ethereum-magicians.org/t/rrc-7740-add-pre-installs-for-deployment-factories/22544 status: Draft type: Standards Track category: RRC