ECIP 1069: Account Versioning Extension for CREATE and CREATE2 Source

AuthorWei Tang
Discussions-Tohttps://github.com/ethereumclassic/ECIPs/issues/169
StatusDraft
TypeStandards Track
CategoryCore
Created2019-06-24
Requires 1040

Simple Summary

Specification for an extension of ECIP-1040 to allow an EVM contract to create multiple versions.

Abstract

This ECIP defines an extension to the base layer of account versioning (ECIP-1040) to allow an EVM contract to create sub-contracts of multiple versions. Although this is not necessary at this moment, it will be a nice-to-have add-on.

Motivation

The base account versioning layer only allows contracts of the same version to be deployed through CREATE and CREATE2. In this section, we provide an extension to allow different versions of contracts to be deployed via them, by providing two new opcodes, VCREATE and VCREATE2.

Specification

Define two new opcodes VCREATE and VCREATE2 at 0xf6 and 0xf7 respectively. VCREATE takes 4 stack arguments (version, value, input offset, input size), and VCREATE2 takes 5 stack arguments (version, endowment, memory_start, memory_length, salt). Note that except the stack item version, other arguments are the same as CREATE and CREATE2.

The two new opcodes behave identically to CREATE and CREATE2, except that it deploys contracts with version specified by stack item version.

The network at all times maintains a constant list within the client of all deployable versions (which can be different from supported versions). Upon VCREATE and VCREATE2, if the specified version is not on the list of deployable versions, return out-of-gas.

Rationale

By providing two additional opcodes VCREATE and VCREATE2, contract developers can deploy new contracts that take advantage of them to create new sub-contracts of multiple versions. This may be useful for situations like upgradable contracts (while it currently still can be done via proxy contacts using only base layer account versioning).

Backwards Compatibility

This ECIP introduces two new opcodes for EVM runtime. Based on current assumed invariants, it should not have any noticeable backward compatibility issues.

Test Cases

Not yet provided.

Implementation

Not yet implemented.

This work is licensed under Apache License, Version 2.0.