Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update shielded ibc docs #384

Merged
merged 4 commits into from
Sep 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).
Loading