-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Skinny CREATE2 #1014
Merged
Merged
Skinny CREATE2 #1014
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
600fba9
Create Skinny_CREATE2.md
vbuterin b77eea1
Update Skinny_CREATE2.md
vbuterin c3131c6
Update and rename Skinny_CREATE2.md to eip-1014.md
vbuterin c368b27
Update eip-1014.md
vbuterin 89e9a1e
Update eip-1014.md
vbuterin 5a38a07
Update eip-1014.md
vbuterin 036d374
Update eip-1014.md
vbuterin 4bb9007
Merge branch 'master' into vbuterin-patch-2
Arachnid b9c28ee
Merge branch 'master' into vbuterin-patch-2
Arachnid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading from the comments it's:
sha3(0xff ++ msg.sender ++ salt ++ sha3(init_code))[12:]
instead of
sha3(0xff ++ msg.sender ++ salt ++ init_code)[12:]
so with the hash value
sha3(init_code)
and not the code itself. Am I correct on this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see #1375 . But yes, the
init_code
, not the code itselfThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks!