Skip to content

Commit 80500df

Browse files
committed
Include invalid opcode preamble
1 parent 54cdb97 commit 80500df

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

backwardsCompatibility.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ cost. The fee schedule for eWASM is yet to be specified.
1414
## Identification of code
1515
We assume there is some sort of code handler function that all clients have
1616
implemented. The code handler identifies the instruction set type by whether it
17-
starts with WASM's magic number or not.
17+
starts with the *eWASM preamble* or not.
18+
19+
The *eWASM preamble* consists of an invalid EVM1 opcode (`0xEF`) followed by the WASM magic number.
1820

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

contract_interface.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ The eWASM Contract Interface (ECI) specifies the structure of a contract module.
66

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

9+
The WASM bytecode must be prefixed with an invalid EVM1 opcode (`0xEF`).
10+
911
### Imports
1012

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

0 commit comments

Comments
 (0)