7 ms·
Show HN: EtherPot – A decentralized, autonomous, provably fair lottery
- aakilfernandes 11y agoHey everyone, EtherPot is a smart contract on the Ethereum Blockchain. That means that no one can steal the funds or cheat to win. The lottery is provably fair. 100% of finds (except for transaction costs that go to miners) get returned to the users who play.
- vdaniuk 11y agoThis is fantastic, straight from cyberpunk stories! Thanks for a reason to look into ethereum.
- deleted 11y ago[deleted]
- nickpsecurity 11y agoThanks for the English description for the rest of us. :)
- TerryADavis 11y agoNIST random beacon is government. It's better. It's free. It's every minute.
- computer 11y agoI have some questions about the legality: Since the miners mine this contract (or include it in the blockchain, or whatever it is for Ether), does that make them violate the UIGEA [1] or other gambling laws? And since the OP lives in NY, does creating & posting this violate, for example, "promotion of gambling"-laws? [2] [1] https://en.wikipedia.org/wiki/Unlawful_Internet_Gambling_Enforcement_Act_of_2006 https://en.wikipedia.org/wiki/Unlawful_Internet_Gambling_Enf... [2] http://ypdcrime.com/penal.law/article225.htm http://ypdcrime.com/penal.law/article225.htm
- nadams 11y agoI think this would be illegal. Could this be considered a raffle?
- Uptrenda 11y agoYou have no idea how hard this would be to do with a normal blockchain OP. In fact, I have spent literal months just thinking of ways to hack Bitcoin to do more complex smart contracts when its already possible with a few patches and extra OP codes. I must check out Ethereum when I get chance.
- natrius 11y agoIt helps to stop thinking about blockchains and smart contracts. Ethereum is a global public computer where programs have their own storage space that can't be modified by anything other than the program itself. You can remove the trusted middleman from pretty much any system that used to require one. That is a significant fraction of the economy. It's a significant fraction of our society.
- Nadya 11y agoIn one paragraph you've given me a better understanding of Ethereum than several blog posts and even the Ethereum website itself. Good job and thank you.
- natrius 11y agoThanks! Spread the word! There are lots of decentralized applications that need to be built.
- tinybike 11y agoWow, that's a really good, easy-to-understand description of Ethereum.
- aakilfernandes 11y agoHa, you're a brave soul. I spent a month on an ultimately doomed attempt to build a decentralized marketplace on Bitcoin. Very excited about Ethereum.
- FatalLogic 11y agoAs I'm sure you know, Bitcoin's scripting language, as originally designed, is deliberately not Turing complete[1]. That's one of Ethereum's key points of difference with Bitcoin. It's a very difficult challenge to keep control of resource use in any such decentralized system, and even more of a challenge when scripts can loop. It's going to be interesting to see if Ethereum can eventually work without frequent human intervention to modify the code. Even Bitcoin didn't quite get to that state yet. [1]https://en.bitcoin.it/wiki/Script https://en.bitcoin.it/wiki/Script
- doomrobo 11y agoThis is really cool, but I think there might be issues with this: 1) The "random" selection of a winner seems to come from the modulo of the hash of a determinidtically selected block in the blockchain. How difficult would it be for someone to rig the lottery by simply waiting until the right moment and adding a block to the chain with a hash that would make them the winner? 2) Aside from the above, the "random" winning ticket index is not uniformly distributed unless the number of tickets is a power of 2, so there will be a significant bias in ticket selection. Are these real shortcomings or am I misunderstanding something?
- aakilfernandes 11y ago1. By failing to submit a block, a miner loses the block reward of mining that block (5 ether). The lottery is set up in subpots of 5 ether each, and each subpot is decided by a seperate blockhash. The miners could cheat, but their economic incentive is to be honest. 2. Not sure if I understand this. Can you expand on it a little more?
- doomrobo 11y agoAh, gotcha. I'll try to explain and correct my claimed in #2. So the winning ticket index is chosen as H % n (read: H mod n) where H is a uniformly distributed number between 0 and 2^256 obtained from the hash of some block (I'm just picking 256, I don't know what hashing algorithm is being used, but I'm assuming the digest's length is a power of 2), and n is the number of tickets that were bought. This computation does not produce a uniform distribution unless |H| is a multiple of n. Here's an example {0..7} % 3 takes on the values 0,1,2,0,1,2,0,1. Notice that 0 and 1 appear 3 times but 2 only appears twice. So even if you chose x from a uniform distribution of the numbers 0-7, x % 3 would have a 3/8 chance of being 0 or 1, but only a 2/8 chance of being 2. This bias disappears only when the order of the set that's being randomly sampled is a multiple of the modulus. I hope that made sense. So even assuming that the block hash is randomly distributed, you're still introducing a bias with the modulus. I think this might be fixable by simply multiplying the number of tickets everyone has by 2. Edit: Strike that last part. If the number of tickets is not a power of 2, and the digest of the hash is a uniformly selected number from a set with a magnitude that is a power of 2, then there must be a bias in the winning ticket selection as it's performed in this code.
- coderzach 11y agoThe entropy comes from the mined hash. Could a cartel of miners all decide to not submit hashes where they don't win? Wouldn't that make this technically exploitable?
- aakilfernandes 11y agoThe could, but their incentive is to not. Each block they do not submit costs them the block reward (5 ether). The jackpot is split into subpots of 5 ether for this reason. Each subpot is decided on by a single blockhash. The incentive of the miners is to play honestly.
- misiti3780 11y agoVery cool idea! I just finished the Orielly book called "Blockchains" and it is exciting to see these applications now that I have a better understanding of Smart Contracts, etc.
- patcon 11y ago30 minutes until first payout. Let the unlawful gambling BEGIN :) https://etherchain.org/account/0x539f2912831125c9b86451420bc0d37b219587f9 https://etherchain.org/account/0x539f2912831125c9b86451420bc...
- aakilfernandes 11y agoWhere are you getting 30 mintues from? I'm showing ~5 hours
- patcon 11y agoHm. The first transaction sent was in block 141,525, and the site says 6,800 blocks per round... but block 148,325 has passed without payout, so I guess I skimmed and missed something :/