Skip to main content

Frequently Asked Questions

Short answers to common questions about Chialisp, with links to the pages that cover each topic in detail.

What is Chialisp?​

Chialisp is a pure, functional, Lisp-based language used on the Chia blockchain to lock coins until they are spent and released by their owner. This enables behavior similar to that of smart contracts. See About Chialisp for the design goals.

What is the difference between Chialisp and CLVM?​

Chialisp is the high-level language you write. It compiles to CLVM (Chialisp Virtual Machine) bytecode, which is what the blockchain actually runs. Because programs are compiled, the language can change over time while still being executed in the same way. See CLVM for the low-level details.

What is the difference between Chialisp and Rue?​

Both are languages for writing coin puzzles on the Chia blockchain, and both compile to CLVM, so a puzzle written in either one runs on chain in the same way. Chialisp is the original, Lisp-based language that this site documents. Rue is a newer, statically typed language with a Rust-like syntax, type checking at compile time, and a standard library that covers conditions, tree hashing, currying, singletons and offers. Rue is developed in the xch-dev/rue repository on GitHub, and its documentation is at rue-lang.com. The CLVM, Operators, Conditions and Costs pages on this site apply to programs written in either language.

Where do I start?​

Begin with the Intro to Chialisp guide. It walks you through writing programs, creating smart coins and spending them on the command line.

What tools do I need to compile and run programs?​

Install chia-dev-tools. It provides the cdv clsp commands (such as build, curry and treehash) as well as the run command to compile Chialisp and brun to execute CLVM. See Commands for every command with examples.

Can I try Chialisp without installing anything?​

Many code blocks in this documentation can be edited and evaluated in the browser. Click the play button in the top right of the block. You can edit the program arguments at the top of the block.

What is currying?​

Currying lets you set some of a puzzle's parameters before the coin is created. The same puzzle can then be reused as a template, with each version producing a different puzzle hash. See Currying.

Why does my program fail with an error about first or rest, or about a path into an atom?​

These errors usually mean the program received an environment (solution) with a different shape than it expected. The Debugging page explains the most common errors and how to track them down, including the raise operator, verbose output and the symbol table.

How much does it cost to run a program?​

Every CLVM operator has a cost, and a block has a maximum total cost. See Costs for the cost table and for how to evaluate the cost of your own program, and Optimization for ways to reduce it.

Which operators and conditions are available?​

See Operators for the CLVM operators and Conditions for the conditions a puzzle can return, such as CREATE_COIN and AGG_SIG_ME.

What are the new language features?​

Newer versions of the compiler add features such as let and assign forms, function closures, lambda and defmac. They are listed in Modern Chialisp.

Is it safe to lock a coin with only a password?​

No. Farmers can see the solution, including the password, and can replace the conditions with their own. Secure coins with signatures such as AGG_SIG_ME instead. See Password Coin and the rest of Common Issues for other pitfalls, and Attacks and Countermeasures.

How do CATs, NFTs, DIDs, offers and singletons work?​

Each has its own page under Primitives: Standard Transactions, Singletons, CATs, NFTs, DIDs, Offers and Pooling.