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

add a section on how to have someone else to pay tx gas fees #408

Merged
merged 1 commit into from
Nov 24, 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
37 changes: 37 additions & 0 deletions packages/docs/pages/users/fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,40 @@ Using two separate transactions instead avoids this issue (since the user can ca
It is also possible, using either of the two solutions presented above, to use MASP fee payment to pay fees for non-MASP transactions.
Please note that this is discouraged since it could establish a linkage between the MASP transaction and the entity behind the non-MASP transactions.
</Callout>

## Having someone else to pay for tx gas fees

When, for example, you don't have enough balance left to cover transaction's gas fees, you can have someone else to wrap the raw transaction and submit it on your behalf.

First, dump the raw transaction by adding `--dump-tx` flag and specify the `--gas-payer`'s public key and an `--output-folder-path` for the serialized tx. E.g.:

```shell copy
namadac transparent-transfer \
--source a \
--target b \
--token NAM \
--amount 1 \
--gas-payer pk-of-gas-payer \
--dump-tx \
--output-folder-path tx-dump-dir
```

Then produce a signature for this tx with e.g.:

```shell copy
namadac utils sign-offline \
--data-path tx-dump-dir/*.tx \
--secret-keys key-of-a \
--output-folder-path tx-dump-dir
```

You can now pass on the serialized transaction (\*.tx file) and signature (\*.sig) to whoever is going to wrap it.

They can then wrap this tx and submit it to the chain with e.g.:

```shell copy
namadac tx \
--tx-path transaction.tx \
--signatures signature.sig \
--gas-payer gas-payer-key
```
Loading