Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

SecretNetwork

> 编程语言
Open source

The Secret Network

582 stars0 likes0 views
WebsiteGitHub

About

The Secret Network

Secret Network offers scalable permissionless smart contracts with a private by default design— bringing novel use cases to blockchain not feasible on public systems. Secret Network enables users to take back ownership over their private (financial) information and for them to share this information with whom they trust. Secret Network was the first protocol to provide private smart contracts on mainnet, live since September 2020. Secret Network is Built with the Cosmos Software Development Kit (SDK) bringing Interoperable privacy to the entire Cosmos ecosystem. Secret Network uses a combination of the Intel SGX (Software Guard Extension) Trusted Execution Environment technology, several encryption schemes and key management to bring privacy by default to blockchain users. Secret Contracts are an implementation of the Rust based smart contract compiling toolkit CosmWasm, adding private metadata possibilities. Secret Network is powered by the Native public coin SCRT which is used for fees, Proof Of Stake security and Governance. With more than 20+ Dapps, 100+ full time builders and a strong grassroots community Secret Network aims to bring privacy to the masses.

Setting up Environment

Prebuilt Environment

Gitpod

Click the button below to start a new development environment:

VSCode Docker Environment

  1. Install extension

  2. Clone this repository into a new dev container

Docker Dev Environments

  1. From Docker Desktop, create a new Dev Environment from the prebuilt image - ghcr.io/scrtlabs/secretnetwork-dev:latest
  2. Connect with VSCode, or use the container directly
  3. Make sure the code is updated by using get fetch and git pull

Manual Set up

You can find everything below in a handy script that you can copy and run from here

Install prerequisite packages

bash
sudo apt-get install -y --no-install-recommends g++ libtool automake autoconf clang

Optinal packages to install ((needed for local testing))

bash
sudo apt install -y  jq nodejs npm

Consider installing nvm (https://github.com/nvm-sh/nvm)

bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
nvm install 22

Note: lcp - Simple proxy to bypass CORS issues. It solve the issue

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disable

You may need to isntall lcp CORS bypass proxy if you plan on running your network of nodes locally:

bash
sudo npm install -g local-cors-proxy

Ubuntu 22+

The build depends on libssl1.1. Install using:

bash
wget https://debian.mirror.ac.za/debian/pool/main/o/openssl/libssl1.1_1.1.1w-0%2Bdeb11u1_amd64.deb
bash
sudo dpkg -i libssl1.1_1.1.1w-0+deb11u1_amd64.deb

Clone Repo

Clone this repo to your favorite working directory. e.g. ~/SecretNetwork

bash
git clone [email protected]:scrtlabs/SecretNetwork.git ~/SecretNetwork
cd ~SecretNetwork
git checkout 

Install Rust

Install rust from https://rustup.rs/.

bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Then, while in your SecretNetwork add the rust-src componenti and wasm32-unknown-unknown target. This will also install the version of rust that is defined by the workspace (in rust-toolchain) -

rustup component add rust-src

To run tests you'll need to add the wasm32 target -

rustup target add wasm32-unknown-unknown

Install Go (v1.18+)

Install go from https://go.dev/doc/install Any version up to 1.22.4 should work.

Install gobindata

bash
sudo apt install go-bindata

Install SGX

To compile the code and run tests, you'll need to install the SGX SDK and PSW. To run in simulation (or software) modes of SGX you do not need to install the SGX driver. For a simple install, run the install-sgx.sh script in the following way:

bash
chmod +x ./scripts/install-sgx.sh
sudo ./scripts/install-sgx.sh true true true false

After SGX installs successfully, please add the following line to your .bashrc file

SGX_HOME=/opt/intel/sgxsdk # or the directory where installed it if defferent
. ${SGX_HOME}/environment

and

source ~/.bashrc

to bring into your shell the important paths from SGX that you will need when building SecretNetwork

It may be worth mentioning that your LIBRARY_PATH should also point to SGX_SDK/sdk_libs

If you plan to run in SGX_MODE=SW indicate it by exporting SGX_MODE

bash
export SGX_MODE=SW

There is one more important step you need to do:

ln -s $SGX_HOME/lib64/libsgx_epid.so $SGX_HOME/sdk_libs/libsgx_epid.so

as this library will be required during building.

Note: If you are using WSL you'll need to use the 5.15 kernel which you can find how to do here, otherwise you'll have to run anything SGX related only in docker

Install DCAP

bash
sudo apt-get install libsgx-epid libsgx-quote-ex libsgx-dcap-ql

assume LIB_PATH points to /usr/lib/x86_64-linux-gnu/

bash
sudo ln -s $LIB_PATH/libsgx_dcap_ql.so.1 $LIB_PATH/libsgx_dcap_ql.so
sudo ln -s $LIB_PATH/libsgx_dcap_quoteverify.so.1 $LIB_PATH/libsgx_dcap_quoteverify.so

Install Xargo

We need a very specific version of xargo for everything to compile happily together

cargo install xargo --version 0.3.25

Install submodules

We use incubator-teaclave-sgx-sdk as a submodule. To compile the code, you must first sync this submodule

bash
git submodule init
git submodule update --remote

Optional (docker)

If you plan on re-generating proto files, you need docker installed. How to install you can reference the following link: How to install docker on Ubuntu 22.04

Build from Source

Use make build-linux to build the entire codebase. This will build both the Rust (enclave & contract engine) and the Go (blockchain) code.

To build just the rust code, you can use make build-linux, while to build just the Go code, there is the aptly named make build_local_no_rust.

Tip: For a production build the enclave must be copied from the most recent release. This is due to non-reproducible builds, and the fact that enclaves must be signed with a specific key to be accepted on mainnet. Still, the non-enclave code can be modified and ran on mainnet as long as there are no consensus-breaking changes

Running Something

Run tests

To build run all tests, use make go-tests

Start local network

Before you run your dev node, you need to point to the shared libraries needed by secretd:

bash
export SCRT_ENCLAVE_DIR=~/SecretNetwork/go-cosmwasm

In order to run secretd you need to have built librust_cosmwasm_enclave.signed.so. The latter can be built by cloning:

bash
git clone [email protected]:scrtlabs/tm-secret-enclave.git ~/tm-secret-enclave

This repo also uses submodules:

bash
cd tm-secret-enclave
git submodule init
git submodule update --remote
make build-rust

Run ./scripts/start-node.sh

Documentation

For the latest documentation, check out https://docs.scrt.network

Community

  • Homepage: https://scrt.network
  • Blog: https://blog.scrt.network
  • Forum: https://forum.scrt.network
  • Docs: https://docs.scrt.network
  • Discord: https://chat.scrt.network
  • Twitter: https://twitter.com/SecretNetwork
  • Community Telegram Channel: https://t.me/SCRTnetwork
  • Community Secret Nodes Telegram: https://t.me/secretnodes

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustblockchaincomputational-privacycosmos-hubcosmos-sdk

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言