Clarifies that msg.sender is CALLER and tx.origin is ORIGIN. (#2720)

* Clarifies that `msg.sender` is `CALLER` and `tx.origin` is `ORIGIN`.

* Adds clarification where attached ETH comes from.
This commit is contained in:
Micah Zoltu 2020-06-13 14:35:41 +08:00 committed by GitHub
parent a79579647f
commit ee50a7381a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,8 +30,8 @@ As of `FORK_BLOCK_NUMBER` an [EIP-2718](./eip-2718.md) transaction with a `Trans
* `[2, nonce, to, value, data, chainId, senderV, senderR, senderS, gasLimit, gasPrice, gasPayerV, gasPayerR, gasPayerS]`
* `[3, nonce, to, value, data, senderV, senderR, senderS, gasLimit, gasPrice, gasPayerV, gasPayerR, gasPayerS]`
`senderV, senderR, senderS` is a signature of an RLP array of the items preceding the sender signature items. The address recovered from this signature is the address of `msg.sender` for the transaction and the address whose `nonce` is used.
`gasPayerV, gasPayerR, gasPayerS` is a signature of an RLP array of the items preceding the gas payer signature items. The address recovered from this signature is the address of `tx.origin` for the transaction, and the address whose ETH balance the gas costs for the transaction are deducted from.
`senderV, senderR, senderS` is a signature of an RLP array of the items preceding the sender signature items. The address recovered from this signature is the address returned by the `CALLER` opcode (0x33, aka `msg.sender`) for the first level of the transaction, and the address whose `nonce` is used, and the address whose ETH is deducted if any value is attached to the transaction.
`gasPayerV, gasPayerR, gasPayerS` is a signature of an RLP array of the items preceding the gas payer signature items. The address recovered from this signature is the address returned by the `ORIGIN` opcode (0x32, aka `tx.origin`) for the transaction, and the address whose ETH balance the gas costs for the transaction are deducted from.
Both signatures for this transaction type have a `v` value that is either `0` or `1` and represents the parity of the `y` value of the ECDSA signing process.