Installation and usage of the platform

Development and usage of smart contracts

The definition and general description of how smart contracts work on the Waves Enterprise blockchain platform are provided in the article Smart contracts.

Preparing to work

Before you start developing a smart contract, make sure that you have the Docker containerization software package installed on your machine. The principles of working with Docker are described in the official documentation.

Also make sure that the node you are using is configured for smart contract execution . If your node is running in the Mainnet, it is by default configured to install smart contacts from the open repository and has the recommended settings to ensure optimal smart contact execution.

If you are developing a smart contract to run on a private network, deploy your own registry for Docker images and specify its address and credentials on your server in the remote-registries block of the node configuration file. You can specify multiple repositories in this block if you need to define multiple storage locations for different smart contracts. Also you can configure repository authorization in the node configuration file.

You can also load a Docker contract image from a repository not specified in the node configuration file using 103 CreateContract transaction, which initiates the creation of a smart contract. For more information, see Development and installation of a smart contract and description of the 103 transaction.

When working in the Mainnet, the Waves Enterprise open registry is pre-installed in the configuration file.

Smart contract development

Waves Enterprise blockchain platform smart contracts can be developed in any programming language you prefer and implement any algorithms. The finished smart contract code is packaged in a Docker image with used protobuf files.

Examples of Python smart contract code using gRPC API methods to exchange data with a node, as well as a step-by-step guide on how to create the corresponding Docker images are given in the following articles:

You can use JS Сontract SDK Toolkit and Java/Kotlin Сontract SDK Toolkit to develop, test and deploy smart contracts in Waves Enterprise public blockchain networks. These toolkits are described in the following sections:

Uploading a smart contract into a registry

If you work in the Waves Enterprise Mainnet, contact the Waves Enterprise Technical Support team to place your smart contract into the open repository.

When working on a private network, upload the Docker image of the smart contract into your own Docker registry as described below.

Installing a smart contract into the blockchain

After uploading the smart contract to the repository, publish the contract on the network using the 103. CreateContract transaction.

To do this, sign the transaction via the blockchain platform client, the sign REST API method or the JavaScript SDK method.

The data returned in the method’s response is fed into transaction 103 when it is published.

Below, you will see the examples of signing and sending a transaction using the sign and broadcast methods. In the examples, the transactions are signed with the key stored in the keystore of the node.

After the 103. CreateContract transaction, which specifies a reference to the smart contract in the repository, is published, i.e., written to a block of the blockchain during a mining round, network users will be able to invoke that smart contract.


If the smart contract code is updated in the future, the contract will need to be republished. To do this, use the 107. UpdateContract Transaction.


The smart contract itself is not placed into the blockchain; the blockchain receives the transaction with the hash of the Docker image in which the smart contract code is packaged. Thus the smart contract Docker image hash is stored on all the nodes of the blockchain, but the smart contract itself is in the Docker registry outside the blockchain network.

Smart contract execution

Once a smart contract is installed in the blockchain, it can be invoked with a 104 CallContract Transaction.

This transaction can also be signed and sent to the blockchain via the blockchain platform client, the sign REST API method or the JavaScript SDK method. When signing a transaction 104, specify the ID of the 103 transaction for the called smart contract in the contractId field (the id field of the sign method response).

Examples of signing and sending a transaction using the sign and broadcast methods using a key stored in the keystore of a node: