Vala.ai Blog

Scaling scripts with Merkle Trees

A while back this article introduced the concept of minizing on-chain state through the usage of merkle tree validation in Bitcoin Script. At Vala, we use a version of this and now published an independent library for easy usage, validation and updating of merkle trees in Script. Each prediction market in Vala has to track a ledger of balances in its current output. Without a mechanism to hide the ledger, this would lead to uncontrollable utxo growth....

November 1, 2022 · 2 min · 399 words · Merlin

Advanced Arithmetic in Bitcoin Script

In Bitcoin, we are limited to basic arithmetic. Everything available to us in Script is addition, subtraction, multiplication, division, and modulus. If we want to challenge Ethereum and build Defi applications using automated market makers, compound interest or liquidity mechanisms, this is not enough. Fortunately, there is a way to use what we have available and implement everything we need. We built a library for Vala implementing log, exp, root and pow....

October 16, 2022 · 6 min · 1150 words · Merlin