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

Alias a new name to the SHA3 opcode #363

Closed
ethers opened this issue Jan 21, 2016 · 10 comments
Closed

Alias a new name to the SHA3 opcode #363

ethers opened this issue Jan 21, 2016 · 10 comments
Assignees

Comments

@ethers
Copy link
Member

ethers commented Jan 21, 2016

As a first step to ethereum/EIPs#59

  • alias a new Solidity function to existing EVM SHA3 opcode (basically same as aliasing selfdestruct to SUICIDE opcode)
  • encourage use of new Solidity function by providing warnings in Solidity when sha3 is used
  • then possibly eventually compiler errors when sha3 is used in new Solidity code.

Below the surface, the same existing EVM SHA3 opcode is used by Solidity.

This issue is also a prerequisite if #362 (a Solidity function that does output SHA-3) was ever going to be implemented.

@ethers
Copy link
Member Author

ethers commented Feb 2, 2016

suggestions for the new name, ksha3, keccak, others?

@axic
Copy link
Member

axic commented Feb 2, 2016

@ethers I would vote for keccak. However I do not think any alias or change should be made without consensus on the EIP. It would just create bigger confusion for the users of Solidity.

@VoR0220
Copy link
Member

VoR0220 commented Feb 2, 2016

^agree with @axic

@ethers
Copy link
Member Author

ethers commented Feb 2, 2016

@chriseth what would it take for consensus? ;) I'm fine with keccak, so there's 3 "votes" for it. I'm not sure if we're going to get much ideas for better names...

@chriseth
Copy link
Contributor

chriseth commented Aug 5, 2016

I'm not sure if keccak is enough to disambiguate here. Of course, sha3 is probably worse, so we could go for it.

@emansipater
Copy link

keccak256 would be completely unambiguous, if ambiguity is the issue.

@emansipater
Copy link

Btw, in regard to @axic and @VoR0220 comments from Feb, I sincerely hope that "waiting for the EIP" is not the reason this has been held up here. SHA3 is flat out inaccurate, and it confuses the hell out of every programmer I introduce to solidity. There is no disadvantage to simply adding an alias as soon as possible so that at least new code can be changed to appear way less confusing outside of the very narrow circle of Etherum people who understand how this happened historically. It will be way less work for everyone coming in if the first thing I can tell them is "Ethereum uses a hash function very similar to SHA3 called Keccak256" and just have them use that in their code from scratch. I highly support the EIP, but a Solidity alias is definitely the lowest hanging fruit to get the ball rolling. /rant

@axic
Copy link
Member

axic commented Sep 11, 2016

@emansipater I was actually reconsidering this in the past week and came to a similar conclusion. I don't see a change in EVM or the protocol likely, but at least the RPC documentation could be updated next to Solidity.

@bobsummerwill
Copy link
Contributor

Adding the aliasing makes a lot of sense to me.

@chriseth chriseth added the soon label Sep 11, 2016
@chriseth
Copy link
Contributor

Let's go for keccak256 as an alias and create warnings for usages of sha3. Those can turn into errors for a later release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants