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

Use invalid opcode as part of the eWASM magic #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backwardsCompatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ cost. The fee schedule for eWASM is yet to be specified.
## Identification of code
We assume there is some sort of code handler function that all clients have
implemented. The code handler identifies the instruction set type by whether it
starts with WASM's magic number or not.
starts with the *eWASM preamble* or not.

The *eWASM preamble* consists of an invalid EVM1 opcode (`0xEF`) followed by the WASM magic number.

The WASM magic number is the following byte sequence: `0x00, 0x61, 0x73, 0x6d`.

Expand Down
2 changes: 2 additions & 0 deletions contract_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The eWASM Contract Interface (ECI) specifies the structure of a contract module.

Every contract must be stored in the [WebAssembly Binary Encoding](https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md) format (in short, WASM bytecode).

The WASM bytecode must be prefixed with an invalid EVM1 opcode (`0xEF`).

### Imports

A contract can only import symbols specified in the [Ethereum Environment Interface](./eth_interface.md).
Expand Down