The Scrypto Runtime

In this section, we discuss the runtime behavior of Scrypto code (in WASM format).

When a transaction enters the system, Radix Engine validates its format and interprets its instructions one-by-one, which generally consists of two categories:

  • To update or assert the transaction worktop

  • To call a function or method

Scrypto code runs when a function/method get invoked.


Each blueprint has a mapping from function to an exported WASM function which serves as the entrypoint for a function call.

These are generally of the form {BlueprintName}_{function name}.


Execution of WASM code follows the standard with the following modifications:

  • Floating point instructions have been removed.

Host Functions

The Scrypto WASM runtime environment provides several host functions in order to manipulate runtime objects as well as make calls to other components or blueprints. A subset of these are described in the table below:

Host Function Description


Makes a call to a resource, another component or blueprint


Creates a new node object


Drops an existing node object


Locks a substate to be able to read/write the substate


Reads the data of a substate


Unlocks a substate which was previously locked

External Calls

A component can make calls to other components or blueprints via the Invoke host function.

When an invocation occurs, all data and resources in call arguments moves downstream from the caller to the callee. Call data is inspected by Radix Engine. Invalid data would result in a runtime failure.


Similar to external calls, all data and resources in a return object moves upstream from the callee to the caller.

When a call frame exits, dangling objects (such as buckets) are checked for and a runtime error is issued if some exist.