Inspiration
- 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.
Current raffle tools like gleam, premint are all centralized. We think web3 raffle should leverage blockchain to make it more transparent.
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
Scoring users with their on-chain PFP transactions. The user receives their PFP degenscore.
Create an on-chain weighted raffle for allowlist distribution for NFT projects.
Users can participate in the raffle with their PFP degenscore as weight.
How we built it
Using Moralis api to retrieve on-chain NFT transactions.
Calculate user’s PFP degenscore off-chain.
Setup a weighted random sampling contract for allowlist raffle.
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.
Random word and weight will decide user’s rank in raffle. Final users in reservoir will win the raffle.
Challenges we ran into
- Using on-chain data enabled degenscore as raffle weight to tackle Sybil attack for fair raffle.
- 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
- Find a degenscore based solution for fair on-chain raffle.
- 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
- Expand on-chain raffle applications to more scenarios than PFP allowlist distribution
- 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.
- Optimize graphic user experience
Built With
- chainlink
- flask
- mongodb
- moralis
- nestjs
- node.js
- typescript
Log in or sign up for Devpost to join the conversation.