From 2081af0eac980b8ad6c3aa3f6c087290e1bfdd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Zemanovi=C4=8D?= Date: Thu, 21 Nov 2024 13:40:35 +0000 Subject: [PATCH] add a section on how to have someone else to pay tx gas fees --- packages/docs/pages/users/fees.mdx | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/packages/docs/pages/users/fees.mdx b/packages/docs/pages/users/fees.mdx index 6cd8948..d2c7d1c 100644 --- a/packages/docs/pages/users/fees.mdx +++ b/packages/docs/pages/users/fees.mdx @@ -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. + +## 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 +```