How to Create Viewing Keys for Your Secret Tokens (Tutorial)

Secret Network
Secret Network Ecosystem
5 min readAug 3, 2022

One of the best things about Secret Tokens is that you get to decide who can see your funds, as viewing access is gated using viewing keys.

Here, we’ll show you step-by-step how to create viewing keys for your Secret Tokens using a variety of methods.

The viewing key generation methods we’ll cover:

  1. The SiennaSwap app
  2. The SecretSwap app
  3. The IBC wrap app (for IBC tokens)
  4. Manually add with the Keplr extension token list

What are Secret Tokens and viewing keys?

Secret Tokens are coins or tokens made private by encrypting balance and transaction details. Viewing keys act like passwords that give you, and others you share these with, the ability to access these encrypted details.

This means only people with the right viewing key can see the Secret Tokens you hold and details of your transactions.

💡 Go here to read more about Secret Tokens, viewing keys, and how they work.

Method #1: With the SiennaSwap app

SiennaSwap is one of the Secret DeFi apps you can use to create viewing keys. Here are the steps to take:

Step 1: Go to the SiennaSwap website

  • Navigate to the SiennaSwap app and approve connecting your Keplr wallet
  • Select the Secret Token you’d like to get a viewing key for by clicking on the “token picker” and choosing your coin or token of choice
  • Click on “View Balance” in the swap menu
  • Click on “Create Key” in the notification that appears

After clicking on “View Balance”, you’ll have to approve a series of pop-ups that will add the Secret Token to your Keplr wallet:

  • The first screen shows the smart contract address of the Secret Token you’re connecting with—click “Submit”
  • The second screen asks you to pay gas fees—click “Approve”

If all went well, you should’ve created a viewing key for your Secret Token! With this viewing key, you can see your Secret Token balance on the Secret Network tab of your Keplr extension wallet and in the SiennaSwap user interface.

Method #2: With the SecretSwap app

  • Navigate to the SecretSwap swap page
  • Click on one of the coins/tokens to open the token-picker menu
  • Select the Secret Token you’d like to create a viewing key for
  • After selecting the right Secret Token, click on “View Balance”
  • Click “Submit” and then “Approve” in the pop-ups from your Keplr wallet

Congratulations! You’ve now successfully created a viewing key for your Secret Token with which you can view your Secret Token balance on the Secret Network tab of your Keplr extension wallet.

Method #3: With the IBC wrap app (for IBC tokens)

You can also use the app.secretswap.net or wrap.scrt.network interface to create a viewing key:

  • Navigate to the Secret IBC Portal
  • Connect your Keplr wallet by clicking on “Connect wallet” in the top right corner
  • Click on the lil’ “thinking face” emoji (you’ll see “Set viewing key” when you hover over it)
  • Click “Submit” in the pop-up window that appears and “Approve” the transaction

Method #4: Manually add with the Keplr extension Token list

You can also create viewing keys by connecting your Keplr wallet to the smart contract of the Secret Token you’re trying to add without needing to use any external apps. This is similar to how you’d add ERC-20 tokens to your MetaMask wallet.

Here are the steps to do so:

Step 1: Find the smart contract address of the Secret Token you’d like to create a viewing key for

  • Head over to the Secret Analytics website
  • Click on the SNIP tab in the left-side menu
  • Scroll down until you see the list of Secret Tokens
  • Copy the “Contract Address” displayed next to the Secret Token you’d like to create a viewing key for

Step 2: Add the Secret Token to your Keplr wallet

Now it’s time to go to your Keplr wallet extension and create the viewing key for this Secret Token:

  • Open your Keplr wallet extension click on the menu in the left-hand corner
  • Select “Add Token”
  • Paste the contract address you copied into the “Contract Address” field and click “Submit”
  • You’ll need to pay some gas fees to complete this action — click “Approve” on the next screen

Congratulations! You’ve now successfully created a viewing key for your Secret Token. You can view your Secret Token balance in the Secret Network tab of your Keplr wallet extension.

That’s it! You know several ways to create viewing keys for your Secret Tokens, allowing you and select others to view your funds.

Want to know how to manage and share your viewing keys? We’ll be releasing follow-up tutorials soon, so subscribe to our Medium account or follow our Twitter account if you don’t want to miss these!

--

--

Secret Network
Secret Network Ecosystem

The Data Privacy Platform For Web3 — build and use blockchain applications that are both permissionless and privacy-preserving.