Secret Contracts are written using the . CosmWasm contracts are written in Rust, which is later compiled to WebAssembly (or WASM for short). To write our first Secret Contract, we need to set up a development environment with all of the tools required so that you can upload, instantiate, and execute your smart contracts.
For a step-by-step Secret Network environment configuration video tutorial, ๐ฅ. Otherwise, continue reading!
Install Requirements
To follow along with the guide, we will be using git, make, rust, and docker.
sudo apt-get install git make
Install git:
Download the latest .
Follow the prompts to install Git.
Open a terminal and verify the installation was successful by typing git --version
Install make:
brew install make
Install git and perl (for Windows):
Go to and the download will start automatically. Note that this is a project called Git for Windows, which is separate from Git itself; for more information on it, go to .
Go to and download the recommended version for your system. StrawberryPerl is an open-source Perl environment for Windows; for more information, visit . Perl is used to build other dependencies that will be installed later.
Note: support for make on Windows is limited, so we'll provide separate commands for Windows where necessary
Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
curl https://sh.rustup.rs -sSf | sh
Download and run .
Download and run
Add WASM build target
rustup target add wasm32-unknown-unknown
Having Trouble? You might need to restart your terminal, or run a command like:
source "$HOME/.cargo/env"
After installing Rust to configure the current shell
Install Cargo Generate
Cargo generate is the tool you'll use to create a smart contract project.
SecretCLI is a command-line tool that lets us interact with the Secret Network blockchain. It is used to send and query data as well as manage user keys and wallets.