Shielded Transfers

Once the user has a shielded balance, it can be transferred to a another shielded address. This is known as a shielded transfer.

Making a shielded transfer

Before making a shielded transfer, it is recommended to first sync the local shielded context:

namadac shielded-sync --spending-keys $SPENDING_KEY

To make a shielded transfer, you must possess the relevant spending key. See the glossary for an explanation on the types of keys and addresses used with the MASP.

Use the transfer command to make a shielded transfer to a target shielded (znam) address by providing the spending key associated with the source shielded (znam) address:

namadac transfer \
  --source $SPENDING_KEY \
  --target $PAYMENT_ADDRESS \
  --token $TOKEN \
  --amount $AMOUNT \
  --gas-payer $IMPLICIT_ACCOUNT
💡

Note: you must provide an implicit account which you control containing funds for transcation fees.

Viewing your balance

To view the up-to-date balance of your spending key (or viewing key), you must first run the shielded-sync command to sync the local shielded context with any MASP notes owned by your spending/viewing key:

namadac shielded-sync --spending-keys $SPENDING_KEY

or

namadac shielded-sync --viewing-keys $VIEWING_KEY
💡

The first time you wish to check the balance of a spending/viewing key, you must provide it to the shielded context with --spending-keys|--viewing-keys. On subsequent runs, you can simply use namadac shielded-sync.

After the sync has completed, check your balance with:

namadac balance --owner $SPENDING_KEY --token $TOKEN

(A viewing key can also be provided here instead of $SPENDING_KEY)

This will display the combined balance of all shielded addresses associated with that spending/viewing key.