Skip to content

Commit b582c65

Browse files
vbuterinArachnid
authored andcommitted
Skinny CREATE2 (#1014)
* Create Skinny_CREATE2.md * Update Skinny_CREATE2.md * Update and rename Skinny_CREATE2.md to eip-1014.md * Update eip-1014.md * Update eip-1014.md * Update eip-1014.md * Update eip-1014.md
1 parent 3351cbf commit b582c65

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

EIPS/eip-1014.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
eip: 1014
3+
title: Skinny CREATE2
4+
author: Vitalik Buterin (@vbuterin)
5+
category: Core
6+
type: Standards Track
7+
status: Draft
8+
created: 2018-04-20
9+
---
10+
11+
### Specification
12+
13+
Adds a new opcode at 0xf5, which takes 4 stack arguments: endowment, memory_start, memory_length, salt. Behaves identically to CREATE, except using `sha3(msg.sender ++ salt ++ init_code)[12:]` instead of the usual sender-and-nonce-hash as the address where the contract is initialized at.
14+
15+
### Motivation
16+
17+
Allows interactions to (actually or counterfactually in channels) be made with addresses that do not exist yet on-chain but can be relied on to only possibly eventually contain code that has been created by a particular piece of init code. Important for state-channel use cases that involve counterfactual interactions with contracts.
18+
19+
#### Option 2
20+
21+
Use `sha3(0xff ++ msg.sender ++ salt ++ init_code)[12:]`
22+
23+
Rationale: ensures that addresses created with this scheme cannot collide with addresses created using the traditional `sha3(rlp([sender, nonce]))` formula, as 0xff can only be a starting byte for RLP for data many petabytes long.

0 commit comments

Comments
 (0)