axiomzen / eth-random Goto Github PK
View Code? Open in Web Editor NEWcommit-reveal RNG method in Ethereum
License: MIT License
commit-reveal RNG method in Ethereum
License: MIT License
The current implementation can be predicted:
block.blockhash(block.number)
will always be zero, since block hash is not known until block is mined;web3.eth.getStorageAt()
;now
is shared within internal messages in the same transaction, so we can make an exploit contract that will call target contract.Consider switching to commit-reveal approach or using an externally updated seed.
Hi,
Just wondering about the RPG.sol example:
https://github.com/axiomzen/eth-random/blob/master/example/contracts/RPG.sol#L18
Would it be just as good if RPG inherited from Random so you wouldn't have to pay the extra gas for calling another contract? CALL costs 700 gas whereas JUMP only costs 1 gas. If you're doing this (and/or the network gets overloaded and gas prices), seems like you'd make a good saving by inheriting from Random rather than calling it from an external contract.
Is the above accurate?
Should make use of the described technique to implement what the README describes
Received a great feedback at OpenZeppelin's #article channel, ended up discussing about a lot of tradeoffs and design decisions we talked about a lot with @KaiCode2 and @jordanschalm and we absolutely should make room for those on the README
Namely:
micah.zoltu
suggestion on eliminating the use of now
In addition to those, it would make sense to use Github release feature to release of a Smart Contract to a certain commit, as we are likely to release other versions of Random with more features in the near future.
Add alternative: https://github.com/randao/randao
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.