Skip to main content
Fift is a stack-based general-purpose tacit programming language optimized for creating, debugging, and managing smart contracts on TON Blockchain. It has been specifically designed to interact with TON Virtual Machine (TVM) and TON Blockchain. In particular, it offers native support for 257-bit integer arithmetic and cell manipulation, as well as an interface to the Ed25519-based cryptography employed by TON. Fift also includes a macro assembler for TVM code, which is a common intermediate target of higher-level languages such as Tolk and FunC, as well as a common textual bitcode representation of smart contracts. For more examples of the latter, see various blockchain explorers and disassembled smart contracts.

Installation

Interpreter and libraries

Fift interpreter binaries for Windows, macOS (Intel or Arm64), and Ubuntu can be downloaded from the latest GitHub release. Make sure to also download the necessary libraries — download and unpack the smartcont_lib.zip. The lib/ folder inside contains standard libraries of Fift, which must be exposed to it when running the interpreter. Consider the following example installation steps:
1

Download the latest Fift binary

Go to the latest GitHub release, download fift.exe and place it somewhere on your PATH. To see the current state of the PATH variable, run echo $env:PATH in the PowerShell.
2

Download Fift's standard libraries

  • Download smartcont_lib.zip from the latest GitHub release.
  • Unzip it and extract the contents.
  • Move the extracted lib/ folder somewhere convenient. You can also place it under a different name.
    • For example, for Linux and macOS, it can be moved to ~/.local/lib/fiftlib
    • For Windows, to ~/.fiftlib
3

Run Fift

To invoke the Fift binary, you’ll need to pass it the standard libraries as such:
fift -I /path/to/extracted/lib -i Asm.fif
If you see errors or red-colored output lines, double-check the placement of the Fift binary and related libraries from previous steps.Otherwise, write the following and press “Enter”:
2 2 + .s
If you see “4 ok”, then Fift has been successfully installed on your machine!To learn about other launch options, add the -h flag by the end of the prior Fift invocation command.

Additional tooling

Extensions and plugins

Online utilities

Getting started

Here is a simple Hello, World! example written in Fift:
."Hello, World!"
When executed with fift binary, it produces the following output:
Hello, World! ok
There, ok means successful end of execution of the given code snippet. To continue learning Fift, see the educational materials section, or move to the follow-up references.

Fift and TVM assembly

Deep dive into Fift

Simple multi-signature wallet

Whitepapers (see below)

Educational materials

Whitepapers

Fift language specification, web version

Tacit stack-based programming language with a deep connection to TVM.

Fift language specification, PDF

Original documentation written by Dr. Nikolai Durov, a comprehensive whitepaper.

Articles

Introduction to Fift

Videos and playlists

«His majesty Fift»

Examples

Simple multi-signature wallet

Multi-signature wallet v2

See also