evm_auth

@mount("ft4.evm_auth") operation evm_auth(account_id: byte_array, auth_descriptor_id: byte_array, signatures: list<signature?>)(source)

For an operation to be authorized by an EVM signer, a specific message must be retrieved using get_auth_message_template. That template will contain some of the following placeholders:

  • core.auth.ACCOUNT_ID_PLACEHOLDER

  • core.auth.AUTH_DESCRIPTOR_ID_PLACEHOLDER

  • core.auth.NONCE_PLACEHOLDER

  • core.auth.BLOCKCHAIN_RID_PLACEHOLDER

Those must be replaced with the corresponding value:

  • the ID of the account and auth descriptor that are currently being used to sign the operation auth message for the first two;

  • a valid nonce, as would be created by utils.derive_nonce with the current counter value of the auth descriptor being used; if multiple operations are authenticated with evm_auth using the same auth descriptor, the counter must increase by one on every subsequent operation;

  • the rid of the blockchain.

The message must be signed following a standard EIP-191 implementation by all signers defined in the auth descriptor used to authenticate, and the signatures must be passed to the signatures parameter in the same order as they can be found in the auth descriptor's signer field (inside args). If any signer did not need to sign (e.g. the auth descriptor is a multi-sig, and only some signatures are required), that signature must be left null.

The transaction will then contain

  • evm_auth

  • the operation that is being authorized

with nothing else inbetween them. Other operations may be added before and after these two.

Throws if the next operation is blacklisted or this is the last operation in the transaction

Parameters

account_id

The ID of the account that is calling the next operation

auth_descriptor_id

The ID of the auth descriptor that is authorizing the operation

signatures

The signatures of the operation's auth message

See also

core.auth._auth_handler

for more details on operation authorization