Skip to content

Commit

Permalink
Merge branch 'grarco/ibc-updates' (#384)
Browse files Browse the repository at this point in the history
Update shielded ibc docs
  • Loading branch information
brentstone authored Sep 8, 2024
2 parents 9060d62 + 7900c2a commit aea680f
Showing 1 changed file with 28 additions and 13 deletions.
41 changes: 28 additions & 13 deletions packages/docs/pages/users/ibc/shielded-ibc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,32 @@ This section covers sending assets to and from a shielded ( `znam` ) address.

- An active IBC connection has been created and maintained between the two chains by operators running relayer
software such as [Hermes](https://github.com/heliaxdev/hermes).
- You will need to know the corresponding channel id
- You will need to know the corresponding channel ID.

## IBC transfer to a shielded address
<Callout>
Previous versions of Namada required a two-step process to make IBC transfers to a shielded address: first a MASP proof was generated using the
`ibc-gen-shielded` command, and this proof was included in the `memo` field of the transfer.

It is no longer necessary to manually generate the MASP proof, and the `ibc-gen-shielded` command has been removed.
</Callout>
First, we need to generate the shielding data with the command:

```bash copy
namadac ibc-gen-shielding \
--output-folder-path \
$OUTPUT_FOLDER_PATH \
--target \
$RECEIVER \
--token \
$TOKEN \
--amount \
$AMOUNT \
--port-id
$PORT_ID \
--channel-id \
$CHANNEL_ID
```

IBC transfers to a shielded address work similarly to those for a [tranparent address](./transparent-ibc.mdx),
the only difference being that we provide the MASP internal address as the value instead of `$RECV_ADDRESS`:
This command will generate the shielding data in a file inside the provided directory and will output the path to this file, `$SHIELDING_DATA_PATH`.

After that, IBC transfers to a shielded address work similarly to those for a [transparent address](./transparent-ibc.mdx),
the only differences being that we provide the MASP internal address as the value instead of `$RECV_ADDRESS` and we add a `--memo` arg with the path to the file we have just generated:

```bash copy
gaiad tx ibc-transfer transfer \
Expand All @@ -31,14 +45,16 @@ gaiad tx ibc-transfer transfer \
${AMOUNT}${IBC_TOKEN_ADDRESS} \
--from $COSMOS_ALIAS \
--node $COSMOS_RPC_ENDPOINT \
--fees 5000uatom
--fees 5000uatom \
--memo $SHIELDING_DATA_PATH
```

<Callout>
The previous command would work even with `$RECEIVER_PAYMENT_ADDRESS` as the second argument, but it is highly recommended to use `$MASP_ADDRESS` to preserve privacy.
</Callout>

## IBC transfer from a shielded address

You can also send IBC transfers from a shielded address, by providing the associated spending key as the source:
```bash copy
namadac ibc-transfer \
Expand All @@ -47,8 +63,7 @@ namadac ibc-transfer \
--token $TOKEN \
--amount $AMOUNT \
--channel-id $CHANNEL_ID \
--gas-payer $IMPLICIT_ADDRESS
```
<Callout>
When sending any transaction from a shielded address, you must also provide an implicit address which you control with enough funds to cover gas costs.
</Callout>

Gas fees can be paid like all the other transactions either directly from an implicit account adding `--gas-payer $IMPLICIT_ADDRESS` or via the MASP.
For more information please refer to the [fees section](../fees.mdx).

0 comments on commit aea680f

Please sign in to comment.