Skip to main content
Version: v2.0

Program structure

The goal of a Numscript program is to output financial transactions, based on the rules and constraints defined in the script, along with an initial state of the system of accounts provided as input.

Once a transaction is computed by the Numscript interpreter, it then becomes the role of the system leveraging Numscript to concretise it against the accounts involved.

Program

A Numscript program is composed of the following elements:

  • Variables declaration
    • This block is optional and allows you to define variables that can be used in the program, instead of hardcoding values.
  • Statements
    • Send statements
      • These statements are the core of a Numscript program and define the movement of value between accounts.
    • Metadata statements
      • These statements are optional and allow you to define metadata for accounts or the transaction itself.

The grammar of a Numscript program can be found here.