Skip to content
2026Now

Smart contracts,native to Bitcoin's UTXO model.

UTXO_Compiler turns Python-like .ct sources into BVM bytecode you can drop straight into a Bitcoin locking script, with strong typing and compile-time ownership checks.

p2pkh.ct
live
Contract P2PKH:
    def verify(sig: hex, pubKey: hex):
        pubKey_copy = pubKey.Clone()
        pubKeyHash = Hash160(pubKey_copy)
        EqualVerify(pubKeyHash, self.pubKeyHash)
        result = CheckSig(sig, pubKey)
Sample p2pkh.ct contract — full source available below for screen readers and reduced-motion users.
Sample P2PKH contract written in p2pkh.ct, mirroring the official UTXO Compiler tutorial.

Hash160 consumes pubKey; Clone it first so the compile-time ownership check stays satisfied.

Powered by TBC · BVM · UTXO · PoW SHA-256 · Fair launch

Why UTXO Compiler
  1. 01 / 03

    Bitcoin contracts shouldn't mean hand-typing opcodes.

    Writing BVM opcodes by hand is error-prone and out of step with how product engineers ship. UTXO_Compiler lets you describe contract logic in a Python-like high-level grammar; the compiler turns it into BVM bytecode for you.

  2. 02 / 03

    Hand UTXO's "state-is-code" model to the type system.

    A contract's member fields land directly inside its bytecode, so different data produces different locking scripts. Mandatory type declarations plus compile-time ownership checks mean what you read in the source is what runs on the stack — failures get caught at build time, not at chain-tip rollback.

  3. 03 / 03

    Familiar syntax, with a real debugger behind it.

    An interactive debugger ships in the box; you can drive both the passing and failing branches deliberately. Compiled output is JSON-shaped bytecode, ready to embed in a locking script or hand to a wallet / indexer.

See it written

One .ct file beats ten paragraphs of explanation.

Contract P2PKH:
    def verify(sig: hex, pubKey: hex):
        pubKey_copy = pubKey.Clone()
        pubKeyHash = Hash160(pubKey_copy)
        EqualVerify(pubKeyHash, self.pubKeyHash)
        result = CheckSig(sig, pubKey)
Hash160 consumes pubKey; Clone it first so the compile-time ownership check stays satisfied.