Vala.ai
Overview
Vala.ai was an open-source platform for decentralised prediction markets, developed between May 2021 and the end of 2022. Users could create markets, trade on possible outcomes and act as oracles responsible for resolving the result. The system was non-custodial: users retained control of their funds, while market and trading rules were enforced by smart contracts.
Prediction markets have to remain usable even when a new question has little liquidity. Vala used Robin Hanson's Logarithmic Market Scoring Rule as an automated market maker, providing a continuous price and allowing every trade to express information without requiring a matching counterparty.
My work
I designed and built Vala.ai, including its smart contracts, market-making libraries, non-custodial wallet, web application and supporting infrastructure. I released the code and documentation publicly.
An LMSR market maker in Bitcoin Script
Vala ran on a UTXO-based blockchain so markets could execute independently and in parallel. Bitcoin SV was selected for its low transaction fees and ability to execute the large scripts required by the market maker. The contracts were written in sCrypt and compiled to Bitcoin Script.
Implementing LMSR required logarithmic and exponential functions that Bitcoin Script does not provide. I built and released a fixed-point arithmetic library to make those calculations possible, as well as a Merkle tree library for compressing and validating growing market state. The smart contracts were accompanied by a TypeScript library for creating markets, calculating trades and constructing transactions.
Trust without custody
The backend indexed and relayed transactions but did not execute trades or hold funds. Market logic ran in the client and contracts, so a valid transaction could be broadcast independently of Vala's server. This kept the central infrastructure small enough to operate on a $10-per-month VPS.
Oracles were deliberately open rather than selected by the platform. Anyone could register one by proving control of a domain through DNS. Users could inspect that identity and the oracle's complete decision history before choosing its markets. The oracle could create and resolve a market but had no additional control over trades or funds.
The platform included its own non-custodial wallet. Encrypted backups could be accessed using zero-knowledge proofs rather than conventional account authentication, reducing the information and authority held by the backup service.
Public beta
Vala ran a public beta from September to November 2022. During the beta, 168 users created wallets, 20 oracles registered, 56 markets were created and 1,184 trades were made. The platform processed 1,297 blockchain transactions, representing approximately 75 MB of data.
During the beta, a critical smart-contract vulnerability was disclosed and corrected without loss of funds. No oracle submitted a false result during the test, suggesting that implementation risk was more immediate than the oracle-trust problem the design had spent considerable effort addressing.
The technical system worked and the beta produced real usage, but the surrounding ecosystem did not justify continued investment in the platform. Vala was shut down rather than kept alive without a credible path to broader adoption.
Archive
The source code remains available on GitHub. The original illustrated January 2023 project report documents the design, beta and conclusions in greater detail.