SecretSCRT: Privacy Tokens Are Live on Mainnet

Hi Secret Agents :male_detective: :female_detective:

Privacy tokens are now LIVE on the Secret mainnet! We just introduced a fungible Secret Token that is backed by SCRT, the native currency of Secret Network.

SecretSCRT is the first implementation of SNIP-20, a privacy token standard, based on the CW20 spec of CosmWasm and inspired by ERC-20 tokens on Ethereum. It allows you to deposit X amount of SCRT, which is not private by itself, in order to mint and receive X amount of secretSCRT, the wrapped privacy token. Balances and transactions (amount and recipient) are fully private.

Read the full blog post:

Each person can still query their own (and only their own) balance, as well as send tokens to others, privately. Additionally, viewing keys can be generated to allow third parties (including other contracts) to view your balance, without actually taking control of your funds. To illustrate, the equivalent of Etherscan for Secret Network would only show the following details of Secret Tokens: total supply (essentially TVL), plus transfers and holdings corresponding to the viewer.

Usage is pretty simple: deposit SCRT into the contract in order to get secretSCRT, which you can use with the functionality provided by the contract: sending, receiving, allowing, and redeeming SCRT.

In terms of privacy, deposits and withdrawals are public because those on-chain transactions move SCRT (not a privacy token) in and out of the contract. However, the rest of the functionality involves encrypted inputs, i.e., nobody can see if you send / receive secretSCRT or to / from which account.

Viewing Keys

Privacy by default means the users have control of who sees what! To increase their usability, Secret Tokens are designed to enable owners to share verifiable proofs with anyone. This is also critical to build a compliant financial ecosystem. “Viewing Keys” are used to validate the identity of someone who queries a specific account. User-supplied strings are used for entropy for generation of the viewing key. Viewing keys are designed to be used by 3rd parties like auditors, wallets and explorers when users opt-in to share this information.

Usage Examples:

Assuming v1.0.3 of the CLI is installed. Users using v1.0.2 of the CLI can instead send raw compute transactions and queries based on the schema that the contract expects.

For full documentation:
secretcli tx snip20 --help
secretcli q snip20 --help

To deposit (public):
secretcli tx snip20 deposit sscrt --amount 1000000uscrt --from <account>

To redeem (public):
secretcli tx snip20 redeem sscrt <amount-to-redeem> --from <account>

To send secretSCRT (only you will be able to see the parameters you send here):
secretcli tx snip20 transfer sscrt <recipient-address> <amount-to-send> --from <account>

^ amount should be an integer number equal to the amount of uscrt you want to send (1 SCRT = 1,000,000 uscrt)

To create your viewing key:
secretcli tx snip20 create-viewing-key sscrt --from <account>

^ this transaction will be expensive, so set your gas limit to about 3M with --gas 3000000; key will start with the prefix api_key_...

To check your balance (only you will be able to see the response):
secretcli q snip20 balance sscrt <account-address> <viewing-key>

To view your transaction history:
secretcli q snip20 history sscrt <account-address> <viewing-key> [optional: page, default: 0] [optional: page_size, default: 10]

Here is a quickstart guide for how to work with secret contracts:

SecretETH and SecretERC-20s

We’ve also built a simple way to create synthetic (wrapped) ETH and ERC-20 tokens on Secret Network that can be used with full privacy, at lower cost. Read this blog post to learn more about how to lock ETH and ERC-20 tokens in order to receive / use privacy-preserving “secretETH” and other potential Secret Tokens!

What will you create?

Following the advent of ERC-20 tokens, the “world computer” saw exponential growth as more people learned about Ethereum. We believe Secret Tokens will have a similar effect on Secret Network, as more and more developers build useful applications that protect and empower users! Let’s focus on the why ~ solving real problems and opening the financial industry to everyone. Together, we hope to lead the way towards a better future that is universally fair and sustainable :seedling: :seedling: :seedling:


I started playing with this earlier in the week - it’s super cool! Can’t wait for the day for Keplr to integrate secret Token standard @josh-chainapsis :slight_smile: