This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
Consensus protocol upgrade to get the sending account of an inline action #7028
Labels
CONSENSUS
Introduces a change that may modify consensus protocol rules on an existing blockchain.
Background
A contract may wish to simply notify another contract of some event (but not via
require_recipient
). Inline actions are a good way of doing this. However, if the sender does not wish to allow the receiver to bill the sender for any RAM, it must keep theauthorization
vector of the inline action empty. But this creates a spoofing problem. Another contract (or just a signed transaction) can send that action while pretending to be from some other contract.If a contract could use an intrinsic to get the account that an inline action was sent from, it could know with certainty whether the message was authentic without relying on the authorization system that opens up the issue of RAM billing for the sender.
Consensus protocol upgrade feature
This protocol feature (codename:
GET_SENDER
) allows contracts to determine which account is the sender of an inline action.New intrinsic
get_sender
A new intrinsic
account_name get_sender()
should be added to thesystem_api
. The C intrinsic for the WebAssembly side would have a signature such asuint64_t get_sender()
where the return type is theuint64_t
raw representation of the account name of the sender of the inline action. If the current action is not an inline action (for example the top-level actions of a transaction), thenget_sender
will return 0.The text was updated successfully, but these errors were encountered: