Conversation
| 1. Create the inner transaction separately. (Sender signature and relayer signature are added in different steps.) | ||
| 2. Create directly the relayed transaction. (Both signatures are added in one step.) | ||
|
|
||
| ### Creating the inner transaction |
There was a problem hiding this comment.
I am not sure we should still call it inner transaction.
There was a problem hiding this comment.
should be ok, for both v1 and v2 inner is used
| ``` | ||
|
|
||
| After creating the inner transaction, we are ready to create the relayed transaction. We have to keep in mind that for `Relayed V3` transactions, the receiver has to be the same as the relayer, in our case, Carol. Another requirement is that the relayed transaction has to have enough gas. The gas is computed by multiplying the base cost (50_000) with the number of inner transactions plus the gasLimit for each inner transaction. For more details on how the gas is computed, check out [this page](/developers/relayed-transactions/#relayed-transactions-version-3). | ||
| After creating the inner transaction, we are ready to create the relayed transaction. We have to keep in mind that for `Relayed V3` transactions. |
There was a problem hiding this comment.
the second sentence can be deleted. (just my tought)
| --relayer-pem ~/multiversx-sdk/testwallets/latest/users/carol.pem \ | ||
| --gas-limit 100000 --value 1000000000000000000 \ | ||
| --proxy https://devnet-gateway.multiversx.com --chain D \ | ||
| --inner-transactions inner_transactions.json \ | ||
| --relayer erd1k2s324ww2g0yj38qn2ch2jwctdy8mnfxep94q9arncc6xecg3xaq6mjse8 \ |
There was a problem hiding this comment.
maybe --relayer and --relayer-pem should be next to each other for readability purpose. just my opinion.
|
|
||
| The inner transaction is any regular transaction, with the following notes: | ||
| - relayer address must be added | ||
| - extra 50000(base cost) gas must be added for the relayed operation. For more details on how the gas is computed, check out [this page](/developers/relayed-transactions/#relayed-transactions-version-3). |
There was a problem hiding this comment.
Typo / formatting (parenthesis & spaces).
| "value": "0", | ||
| "receiver": "erd1dcad0dlle658mggthhpvaypjag2et25yk3c2r7p9gjqkgqpxtukqcqakt0", | ||
| "sender": "erd1dcad0dlle658mggthhpvaypjag2et25yk3c2r7p9gjqkgqpxtukqcqakt0", | ||
| "receiver": "erd1qqqqqqqqqqqqqpgqeunf87ar9nqeey5ssvpqwe74ehmztx74qtxqs63nmx", |
There was a problem hiding this comment.
data field is missing "YWRkQDAx"
| - `relayerSignature`, the signature of the relayer that proves the agreement of the relayer. | ||
|
|
||
| In terms of gas limit computation, let's consider the following example: relayed transaction with one inner transaction of type move balance, that also has a data field `test` of length 4. | ||
| That being said, relayed transactions v3 will look and behave very similar to a regular transaction, the only difference being the gas consumption from the relayer. So the consuming data field of the old relayed transactions versions was removed. |
There was a problem hiding this comment.
I think the phrase "So the consuming data field of the old relayed transactions versions was removed." is not very clear.
maybe rephrase to: It is no longer needed to specify the user transaction in the data field.
|
|
||
| We can simply create the inner transactions the same way we did above, by using the `mxpy tx new` command. The only difference is that we'll have to provide an additional argument called `--inner-transactions-outfile`, which represents the file where the inner transactions are saved to be later used by the relayer. To keep it simple, we'll send 1 EGLD from Alice to Bob, and Carol will be the relayer. To create the EGLD transfer transaction from Alice to Bob, we run the following command: | ||
| There are two options when creating the relayed transaction: | ||
| 1. Create the inner transaction separately. (Sender signature and relayer signature are added in different steps.) |
There was a problem hiding this comment.
maybe
- Create the relayed transaction
- Add the signatures (sender and relayer)
There was a problem hiding this comment.
Now it is only one transaction so the differentiation between an inner transaction and a relayed transaction seems unnecessary
| 1. Create the relayed transaction separately. (Sender signature and relayer signature are added by different entities.) | ||
| 2. Create the complete relayed transaction. (Both signatures are added by the same entity.) |
There was a problem hiding this comment.
A bit of parenthesis and full stop inconsistencies.
Instead of:
Create the relayed transaction separately. (Sender signature and relayer signature are added by different entities.)
Maybe better:
Create the relayed transaction separately (sender signature and relayer signature are added by different entities).
Description of the pull request (what is new / what has changed)
Did you test the changes locally ?
Which category (categories) does this pull request belong to?