Note: We're applying to the MLH Starknet track
Inspiration
As students with experience in a wide array of computer science areas, we had always wanted to learn more about blockchain but had been turned off due to its steep learning curve. We were also unclear about its potential use cases. To help us learn more, we read a portion of "Read Write Own", a recently published by VC Partner Chris Dixon about the potential of blockchains to change society. We were particularly inspired by his discussion of blockchains to support long-term thinking while minimizing trust in third parties, while also thinking about the long-term reality of exploring and traveling outer space and debating how feasible it would be. Through our debate, we came up with the idea of a blockchain-based wager platform to make financial bets about the future.
What it does
Our platform is a blockchain-based wager platform. Users can create a wager as a proposer by choosing a text-based prediction, an amount to stake, a mediator to resolve the wager, and a resolution date -- or take a challenger position to an existing wager. Once two parties must agree to a wager, their amount is deposited into an escrow contract in a token of their choice, and it is up to the mediator to resolve the wager by the deadline. The purpose of this platform is to provide a trustless and incentive-based mechanism for making accurate predictions, both short-term and long-term.
How we built it
We used the Cairo programming language to implement a smart contract on Starkware, an Ethereum L2. This contract stores a list of open, active, and resolved wagers, while also allowing users to create and accept wagers. We also used React and the React-Starknet library to create a friendly user interface for interacting and viewing these contracts. Additionally, we made use of the Argent X Chrome Wallet to set up accounts on the Starknet test network and the Starkli CLI to deploy our smart contracts on this network.
Challenges we ran into
We ran into many issues creating the smart contracts, largely because it was our first time developing with the Cairo language. We were unfamiliar with many syntax standards and continuously had to experiment with new algorithms to leverage the small number of primary data structures that are available on Cairo. We also ran into issues using the Starkli CLI, due to malfunctioning public RPC endpoints and the inability to complete the deploy contract process from Argent X.
Accomplishments that we're proud of
Despite these challenges, we made a fully-functioning full-stack web app using the blockchain and we are very proud of that. We believe our platform will set the standard for long-term wagers and shed light on the utility of using the blockchain for this use case, among many others. We believe blockchain will become an essential part of our daily lives and we are glad to be a pioneer in this ecosystem.
What we learned
We gained an appreciation and understanding of the fine-grained components that make up a decentralized application, such as RPC endpoints that connect to nodes which allow users to read and write directly to a blockchain. We learned about the benefits of Cairo as a memory-safe and exploit-resistant programming language, and Starknet as privacy-benefiting scalable L2 built on top of Ethereum. We are excited for the future of Starknet, as we believe this is only the beginning for its many use cases, and we hope to contribute to its ecosystem.
What's next for BlockBetChain.
We will continue refining our smart contracts, and have them professionally audited by an audit service such as Certik or OpenZeppelin. Then, we will deploy the smart contract to the Starknet mainnet. Once we do this, we will spread the word about our app and use it among our friends.
Built With
- cairo
- react
- starknet
- typescript
Log in or sign up for Devpost to join the conversation.