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
This commit is contained in:
vbuterin 2018-06-18 11:42:44 -04:00 committed by Nick Johnson
parent 3351cbf57f
commit b582c6579b
1 changed files with 23 additions and 0 deletions

23
EIPS/eip-1014.md Normal file
View File

@ -0,0 +1,23 @@
---
eip: 1014
title: Skinny CREATE2
author: Vitalik Buterin (@vbuterin)
category: Core
type: Standards Track
status: Draft
created: 2018-04-20
---
### Specification
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.
### Motivation
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.
#### Option 2
Use `sha3(0xff ++ msg.sender ++ salt ++ init_code)[12:]`
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.