15 Ways to Lose Your Bitcoin

Research firm Chainanalysis estimated that as much as 20% of all Bitcoin in existence is lost forever. At the time the study was released that was about 3.8 million Bitcoins that could never be…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How PoolTogether Selects Winners

Over the past few weeks a number of our users have asked how PoolTogether selects winners. We’ve touched on the topic before in the article Inside PoolTogether v2.0, but we’ll elaborate in more detail here.

There are two main components to random winner selection:

Note: if you don’t understand some the open and committed terminology you may want to scan Inside PoolTogether v2.0 for some insight.

In PoolTogether v2.0 the pool administrators provide the random number. It’s provided like so:

As you may note, the random number selection is centralized. We’ve published this limitation of PoolTogether previously in PoolTogether v2.0: Audit Disclosures. We have several research areas we are pursuing to address this. The next version of PoolTogether will be much improved! Stay tuned.

Let’s dig deeper into step 5 above: where the smart contract uses the random number to select a winner. How does this work?

The key property we want to hold is that a users chance to win is proportional to the size of their deposit. To accomplish this, we treat the random number as a token index.

Let’s imagine that two users have deposited a total of 1,000 tokens. Alice has deposited 800 tokens, and Bob has deposited 200 tokens. Let’s visualize the total supply of tokens as a segmented block:

Alice and Bob’s shares of 1000 tokens

Out of the total deposit of 1000 tokens Alice has 800 and Bob has 200.

The smart contract reframes these deposits: Alice has the first 800 tokens and Bob has the last 200 tokens. So in a sense, Alice owns tokens 1–800 and Bob owns the tokens 801–1000. The smart contract cleverly structures the deposits such that users own certain ranges of tokens.

Now that we’re seeing deposits as “ranges” of tokens out of the total supply, we can treat the random number like an index into the total supply.

If the random number is 513, who is the winner? Let’s see:

Token 513 is owned by Alice

Since Alice owns token 513, she is the winner!

What if the random number is 842?

Token 842 is owned by Bob

Then Bob wins!

As we can see, Alice owns 800 tokens out of the 1000, so she has an 80% chance of winning. Bob owns 200 out of the 1000, so he has a 20% chance of winning. In this way, the chance a user is selected is proportional to their deposit.

Add a comment

Related posts:

Our Partnership Campaign with MagNFT is now live!

MagNFT is an online magazine spotlighting digital artists. Created & Published by SatoshiInitiatives. The project is comprised of 3 parts: 2. Weekly Chill Issues which are their editorial issues…