Skip to main content

ブログ > 2025 > July > Smart contracts on Bitcoin

Smart contracts on Bitcoin

Bringing expressive smart contracts and decentralized applications to Bitcoin with a new toolset

19 July 2025 Riley Kilgore 4 分で読めます

Smart contracts on Bitcoin

What if you could take a smart contract, written using a modern language like Python, TypeScript, or Scala, and run it on Bitcoin without modifying Bitcoin itself?

Thanks to a novel compilation pipeline being developed at Input | Output (IO), that idea is becoming a reality. By combining a serialized smart contract format (Untyped Plutus Core – UPLC), a clever interpreter architecture (Control, Environment, Continuation (CEK) machine), and a widely supported open-source reduced instruction set architecture (RISC-V), IO is building a connection from the expressive world of Cardano smart contracts to the solid base layer of Bitcoin. At the center of this is BitVMX, an optimistic verification system for Bitcoin that leverages RISC-V to safely execute off-chain logic.

While Bitcoin is secure, simple, and stable, its scripting language is extremely limited. That’s a feature, not a bug, but it makes decentralized finance (DeFi) and complex applications hard to build natively.

So instead of rewriting Bitcoin, what if it had an optimistic execution environment where rich logic can run off-chain, and Bitcoin only gets involved when there's a disagreement?

That’s exactly what BitVMX does, and its pipeline makes it easy to feed real smart contracts into this environment.

How it works: UPLC → CEK → RISC-V → Bitcoin

  1. High-level code: developers write smart contracts in modern languages built for (or adapted to) Cardano.
  2. UPLC compilation: that code compiles down to UPLC – a minimal, functional representation. Think of it like a clean, language-agnostic bytecode.
  3. Serialization: UPLC terms are serialized or encoded into a specific byte format that can be passed around like a message or file.
  4. The CEK machine: this is a lightweight interpreter for UPLC, which is essentially a small virtual computer that knows how to execute UPLC code.
  5. Compiled to RISC-V: instead of attempting to interpret UPLC directly on Bitcoin, we compile the CEK machine itself into RISC-V. It’s a real-world, simple CPU instruction set. This version of the CEK machine can then accept serialized UPLC as input.
  6. Verified with BitVMX: BitVMX allows this RISC-V execution trace to be verified optimistically. Only when someone disputes the result does a ‘challenge game’ begin, revealing parts of the execution trace and resolving the dispute. Because the prover provides a deposit as collateral before submitting a computation trace, economic disincentives can be put in place such that in the case that the challenger can prove fraud occurred, the protocol may retain the collateral of the bad actor who posted the incorrect computation trace hash.

Why RISC-V and BitVMX?

  • RISC-V is open, simple, and powerful: it’s an instruction set architecture used across the world in computer chips and academic projects. It also has well-established simulators, tooling, and LLVM backends.
  • BitVMX makes Bitcoin programmable: it runs computations off-chain, but gives Bitcoin users a way to successfully challenge suspicious transactions.
  • The CEK machine is small and deterministic: this makes it a perfect candidate for compiling to RISC-V and verifying with BitVMX.

Why this matters

This architecture enables developers to reuse the existing Cardano smart contract infrastructure without starting from scratch for Bitcoin. This means:

  • True Bitcoin-native DeFi: developers can write contracts in languages built for Cardano and use them to build decentralized exchanges (DEXs), stablecoins, escrows, and more, secured by Bitcoin.
  • Cross-chain bridges: assets can move trustlessly between Cardano and Bitcoin ecosystems.
  • Secure, dispute-resistant computation: fraud proofs via BitVMX ensure correctness without bloating the blockchain. When computation is carried out incorrectly, there is a challenge-response protocol to prove that the computation is incorrect, and appropriately punish bad actors.

IO, BitVMX, and the future

This work is part of a broader collaboration called BitVMX FORCE, launched by IO, Fairgate Labs, and Rootstock Labs. At Bitcoin 2025, IO demonstrated the UPLC-to-RISC-V compiler, leveraging the BitVMX verifier stack, paving the way for safe, scalable, and expressive smart contracts on Bitcoin.

IO believes Bitcoin can serve as the settlement layer for a new class of decentralized applications. By anchoring computation and interoperability on secure, auditable systems like BitVMX, the goal is not only to enable new functionality but also to bridge multiple ecosystems and communities.

Get involved

The toolchain is planned to open soon. In the meantime, watch for announcements from IO and BitVMX FORCE and:

  • Check out Aiken to explore writing contracts targeting UPLC
  • Follow @InputOutputHK and @BitVMX for technical updates
  • Join upcoming hackathons and conventions, especially if you're interested in RISC-V, dispute systems, or zero-knowledge cryptography
  • Join the Telegram group.

Let’s make Bitcoin programmable, together.