Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-1707: Use Version Byte Prefix for Contract Account Versioning #1707

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 48 additions & 0 deletions EIPS/eip-1707.md
@@ -0,0 +1,48 @@
---
eip: 1707
title: Use Version Byte Prefix for Contract Account Versioning
author: Wei Tang (@sorpaas)
discussions-to: https://github.com/sorpaas/EIPs/issues/3
status: Abandoned
type: Standards Track
category: Core
superseded-by: 1702
created: 2019-01-17
---

## Simple Summary

Provide an alternative proposal compared with EIP-1702 / ECIP-1040,
with the following advantages:

* We don't need to modify existing account state format.
* We don't need to modify how precompiled contracts are invoked.
* Compatible with the standard WebAssembly binary format.

## Specification

After `FORK_BLOCK`, before an account or contract creation transaction
code is executed, check that whether:

* The first byte is `\0` (`0x00`).
* The code length is greater or equal to 4.

If so, we define the second to fourth bytes as version bits. Instead
of executing on the default EVM, pass the *whole* code array to a VM
defined by the version bits.

* If version bytes are `\0\0\1`, then invoke "EVM1", where the first 4
bytes are stripped, and the rest of the code bytes are executed in
an EVM with "EVM1" config.
* If version bytes are `asm`, then invoke WebAssembly virtual
machine. This is compatible with the standard WebAssembly binary
format because it always starts with `\0asm`.

If the above does not match, execute it on the default EVM. Note that
if the first byte is `\0`, the client can short circuit and stop
immediately.

## Copyright

Copyright and related rights waived via
[CC0](https://creativecommons.org/publicdomain/zero/1.0/).