1. Most NFT projects are doing unfair or super complicated allowlist distribution. Lots of professional speculative studios dominate the quote of allowlist. Ture holders have to buy the quote from those studios which encourages the middleman business. It does against what web3 builds.
  2. Current raffle tools like gleam, premint are all centralized. We think web3 raffle should leverage blockchain to make it more transparent.

  3. Present raffle rules are not strong enough to prevent Sybil attack. Weight calculated from on-chain data per different scenarios should be widely applied.

What it does

  1. Scoring users with their on-chain PFP transactions. The user receives their PFP degenscore.

  2. Create an on-chain weighted raffle for allowlist distribution for NFT projects.

  3. Users can participate in the raffle with their PFP degenscore as weight.

How we built it

  1. Using Moralis api to retrieve on-chain NFT transactions.

  2. Calculate user’s PFP degenscore off-chain.

  3. Setup a weighted random sampling contract for allowlist raffle.

  4. Weighted random sampling is based on Algorithm A-Res which can also be called reservoir sampling. Every user need to request his unique random word from chainlink VRF.

  5. Random word and weight will decide user’s rank in raffle. Final users in reservoir will win the raffle.

Challenges we ran into

  1. Using on-chain data enabled degenscore as raffle weight to tackle Sybil attack for fair raffle.
  2. If there is a large scale of participants in raffle, it will be a big challenge to choose m from n espcially with weight in solidity because of the gas limit. Applying reservoir sample algorithm and request random seed for each signle user help to resovle the problem.

Accomplishments that we're proud of

  1. Find a degenscore based solution for fair on-chain raffle.
  2. Find a algorithm which can reslove large-scale on-chain raffle with solidity.

What we learned

Comprehensive understanding of chainlink VRF and Moralis API.

What's next for Eggshill

  1. Expand on-chain raffle applications to more scenarios than PFP allowlist distribution
  2. Change those user interactive funtion to meta transaction supported, thus user only need to sign the draw transaction without paying gas. It provides chain-agnostic and frictionless user experience.
  3. Optimize graphic user experience

Built With

Share this project: