Installation
This page explains how to check whether your utxo_compiler binary works. utxo_compiler is a command-line program: you run it in a terminal, pass it a .ct contract file, and it outputs compiled contract data.
Supported Platforms
- Linux
- Windows 64-bit
- Windows 32-bit
- macOS: planned
Release Package Structure
Linux Package Structure
After extracting the Linux package, the directory usually looks like this:
utxo_compiler-v1.0.0-linux/
├── utxo_compiler # Executable
├── doc/ # Documentation directory
├── install.sh # Installation script
└── VERSION # Version informationWindows Package Structure
The Windows package includes DLL files required at runtime. A DLL is a dependency file that the executable loads when it starts.
utxo_compiler-v1.0.0-windows-64/32/
├── utxo_compiler.exe # Windows executable
├── libstdc++-6.dll # C++ standard library
├── libgcc_s_seh-1.dll # GCC runtime library
├── libwinpthread-1.dll # Multi-threading support library
├── doc/ # Documentation directory
├── install.bat # Windows installation script
├── DEPENDENCIES.txt # Dependency library description
└── VERSION # Version informationTesting and Verification
Step 1: Check That the Program Starts
Open a terminal in the extracted directory and run the version command.
Linux:
./builds/linux/bin/utxo_compiler --versionYou can also do a basic check for Windows binaries on Linux with Wine:
# Install Wine first if needed
sudo apt install wine
wine ./builds/windows-64/bin/utxo_compiler.exe --version
wine ./builds/windows-32/bin/utxo_compiler.exe --versionStep 2: Compile a Minimal Contract
Create a file named p2pkh.ct:
Contract P2PKH:
def verify(sig: hex, pubKey: hex):
pubKeyHash = Hash160(pubKey.Clone())
EqualVerify(pubKeyHash, self.pubKeyHash)
result = CheckSig(sig, pubKey)This contract checks whether a signature matches the private key behind an expected public-key hash. Key parts:
sig: the transaction signature supplied when spending the UTXO.pubKey: the public key; the contract computes itsHash160.self.pubKeyHash: the expected public-key hash embedded in the locking script.Clone(): copiespubKey, becauseHash160consumes its input andCheckSigneeds the public key again.
Compile it:
./builds/linux/bin/utxo_compiler p2pkh.ctIf compilation succeeds, the compiler, parser, and bytecode generation path are working. Next, follow Tutorial 1: P2PKH to debug and use the contract.
Verify Windows Package Dependencies
If a Windows user cannot start the program, check whether the package includes the required DLL files:
# Check DLL dependencies of the Windows executable
x86_64-w64-mingw32-objdump -p builds/windows-64/bin/utxo_compiler.exe | grep "DLL Name"
# Verify DLLs included in the package
unzip -l dist/utxo_compiler-v*-windows-64.zip | grep "\.dll"Beginner Pitfalls
- Using the wrong path:
./builds/linux/bin/utxo_compileris a development-tree path. In a release package, the command may be./utxo_compiler. - Copying only the Windows
.exe: keep the DLL files next toutxo_compiler.exe. - Pointing to a missing
.ctfile: the last command argument must be an existing contract file. - Testing on-chain first: compile and debug locally before building a real transaction.
Quick Review
utxo_compilercompiles.ctcontracts into locking-script bytecode.- After installation, run
--version, then compile a minimal contract. - Windows packages need the
.exeand DLL files together. - If the same value is used twice in contract code, you usually need
.Clone().
Next Steps
- Bitcoin Basics — Learn how UTXO and BVM work