EVM chains like Ethereum, Polygon, Base etc support the following signature kinds:
Transaction: unsigned transaction.
Eip191: personal_sign message defined in EIP-191. Also available as Message (they are equivalent).
Eip712: typed structured data defined in EIP-712.
Eip7702: authorization tuple for type 4 set code transaction defined in EIP-7702.
Transaction
Signs an unsigned transaction. The transaction field accepts either a hex-encoded string or a JSON object.
| Field | Description | Type - Optional |
|---|
blockchainKind | Evm | String |
kind | Transaction | String |
transaction | The unsigned transaction formatted as JSON or a hex-encoded string. | String or EvmTransactionJson |
Hex string
{
"blockchainKind": "Evm",
"kind": "Transaction",
"transaction": "0x02e783aa36a71503850d40e49def82520894e5a2ebc128e262ab1e3bd02bffbe16911adfbffb0180c0"
}
Typescript example with Ethers
First install the Ethers JS. You can find the full documentation here.
Here a code sample to generate a signature via the Dfns TypeScript SDK:
import { parseUnits, Transaction } from 'ethers'
const walletId = 'wa-6lbfv-9esgj-xxxxxxxxxxxxxxxx'
const transaction = Transaction.from({
to: '0xa238b6008Bc2FBd9E386A5d4784511980cE504Cd',
value: '1',
gasLimit: '21000',
maxPriorityFeePerGas: parseUnits('5', 'gwei'),
maxFeePerGas: parseUnits('20', 'gwei'),
nonce: 3,
type: 2,
chainId: 11155111,
})
const res = await dfnsClient.wallets.generateSignature({
walletId,
body: { kind: 'Transaction', transaction: transaction.unsignedSerialized },
})
EvmTransactionJson
| Field | Description | Type - Optional |
|---|
type | Ethereum transaction type. 0 for legacy transaction; 2 for EIP-1559 transaction; 4 for EIP-7702 transaction. Default is 2 if undefined. | Integer (optional) |
to | The destination address or target contract. Leave undefined when the transaction is a contract deployment. | String (optional) |
value | The amount of native tokens to transfer in minimum denomination. | String (optional) |
data | ABI encoded function call data in hex format. Can also be the encoded smart contract data when the transaction is a contract deployment. | String (optional) |
nonce | The transaction number to guarantee idempotency. If omitted, it will be provided automatically. Note the same nonce can be submitted multiple times with a higher maxFeePerGas to “overwrite” existing transactions in the mempool. | Integer or String (optional) |
gasLimit | The maximum amount of gas that can be spent for executing the transaction. If omitted, it will be calculated automatically. | String (optional) |
gasPrice | The amount of per unit gas. Only valid for a type 0 legacy transaction. If omitted, it will be calculated automatically. | String (optional) |
maxFeePerGas | The maximum amount of per unit gas willing to be paid for the transaction. Valid for type 2 and type 4 transactions. If omitted, it will be calculated automatically. | String (optional) |
maxPriorityFeePerGas | The maximum amount of per unit gas to be included as a tip to the validator. Valid for type 2 and type 4 transactions. If omitted, it will be calculated automatically. | String (optional) |
authorizationList | A list that indicates what code the signer of each authorization desires to execute in the context of their EOA. Only valid for type 4 transaction. | Authorization (optional) |
Authorization
| Field | Description | Type - Optional |
|---|
chainId | Chain ID. | Integer |
address | The address of the contract the signer’s EOA will be delegated to. | String |
nonce | The current nonce of the signer EOA. | Integer |
signature | The signer signature. | String |
{
"blockchainKind": "Evm",
"kind": "Transaction",
"transaction": {
"to": "0x00fb58432ef9d418bf6688bcf0a226d2fcaa18e2",
"data": "0x40d097c3000000000000000000000000d2f77f85a50cdd650ca562f3a180284e1d5b4934",
"maxFeePerGas": "1626000000000",
"maxPriorityFeePerGas": "1332000000000"
}
}
EIP-191 personal_sign
Signs a personal_sign message as defined in EIP-191.
| Field | Description | Type - Optional |
|---|
blockchainKind | Evm | String |
kind | Eip191 | String |
message | Hex-encoded message. | String |
{
"blockchainKind": "Evm",
"kind": "Eip191",
"message": "0x49206c6f76652044666e73"
}
EIP-712 TypedData
Signs a typed structured data defined in EIP-712.
| Field | Description | Type - Optional |
|---|
blockchainKind | Evm | String |
kind | Eip712 | String |
types | Type definitions. | Map<String, TypedDataField[]> |
domain | Domain separator. | Eip712Domain |
message | Structured message to sign. | Object |
TypedDataField
| Field | Description | Type - Optional |
|---|
name | Field name. | String |
type | Field type. | String |
Eip712Domain
| Field | Description | Type - Optional |
|---|
name | Name of the signing domain. | String |
version | Current major version of the signing domain. | String |
chainId | Chain ID. | Integer |
verifyingContract | The address of the contract that will verify the signature. | String |
salt | 32-byte value as a last-resort domain separator. | String |
{
"blockchainKind": "Evm",
"kind": "Eip712",
"types": {
"Person": [
{ "name": "name", "type": "string" },
{ "name": "wallet", "type": "address" }
],
"Mail": [
{ "name": "from", "type": "Person" },
{ "name": "to", "type": "Person" },
{ "name": "contents", "type": "string" }
]
},
"domain": {
"name": "Ether Mail",
"version": "1",
"chainId": 1,
"verifyingContract": "0x1b352de7a926ebd1bf52194dab487c2cb0793a9b",
"salt": "0xf2d857f4a3edcb9b78b4d503bfe733db1e3f6cdc2b7971ee739626c97e86a558"
},
"message": {
"from": {
"name": "Chris",
"wallet": "0x00e3495cf6af59008f22ffaf32d4c92ac33dac47"
},
"to": {
"name": "Bob",
"wallet": "0xcc0ee1a1c5e788b61916c8f1c96c960f9a9d3db7"
},
"contents": "Hello, Bob!"
}
}
EIP-7702 Authorization
Signs an authorization tuple for type 4 set code transaction defined in EIP-7702.
| Field | Description | Type - Optional |
|---|
blockchainKind | Evm | String |
kind | Eip7702 | String |
chainId | Chain ID. | Integer |
address | The address of the contract the signer’s EOA will be delegated to. | String |
nonce | The current nonce of the signer EOA. | Integer |
{
"blockchainKind": "Evm",
"kind": "Eip7702",
"chainId": 1,
"address": "0xcea43594f38316f0e01c161d8dabde0a07a1f512",
"nonce": 0
}
Last modified on March 13, 2026