# EVM Messages EVM Messages are free-form data to be signed using the vault’s private key. EVM Messages are transactions that can be generated with any message (text, binary, or JSON) and signed using the vault’s private key. Unlike regular transactions, EVM Messages are not broadcast to the blockchain. Instead, they are returned to the creator in a signed format and are intended for off-chain usage. Once the payload is signed, the `signatures` field is populated with a single signature. Fordefi supports two types of messages: - Personal Messages, as defined in [EIP-191](https://eips.ethereum.org/EIPS/eip-191). - Typed Data Messages, as defined in [EIP-712](https://eips.ethereum.org/EIPS/eip-712). When creating an EVM message transaction, it is important to specify the type of message being used. This information helps the platform understand how to handle and enhance the free-form message data. ## Examples Following is an example of a Personal Message create request. It contains a field called `raw_data`, that encodes in hex format the word `foo`. The request should be signed, as demonstrated [here](/developers/authentication#request-signing). ```json { "signer_type": "api_signer", "type": "evm_message", "details": { "type": "personal_message_type", "raw_data": "0x666f6f", "chain": "ethereum_mainnet" }, "vault_id": "f18e03f6-e114-4829-9f46-389b865924ea", "note": "Personal message, signing on the string 'foo'" } ``` Following is an example of a typed data message create request. It contains a field called `raw_data` that encodes in hex format the code that appears in the last snippet in this page. The request should be signed, as demonstrated [here](/developers/authentication#request-signing). ```json { "signer_type": "api_signer", "type": "evm_message", "details": { "type": "typed_message_type", "raw_data": "0x7b0a20202020227479706573223a207b0a202020202020202022454950373132446f6d61696e223a205b7b0a202020202020202020202020226e616d65223a20226e616d65222c0a2020202020202020202020202274797065223a2022737472696e67220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a202276657273696f6e222c0a2020202020202020202020202274797065223a2022737472696e67220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a2022636861696e4964222c0a2020202020202020202020202274797065223a202275696e74323536220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a2022766572696679696e67436f6e7472616374222c0a2020202020202020202020202274797065223a202261646472657373220a20202020202020207d5d2c0a2020202020202020225065726d6974223a205b7b0a202020202020202020202020226e616d65223a20226f776e6572222c0a2020202020202020202020202274797065223a202261646472657373220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a20227370656e646572222c0a2020202020202020202020202274797065223a202261646472657373220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a202276616c7565222c0a2020202020202020202020202274797065223a202275696e74323536220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a20226e6f6e6365222c0a2020202020202020202020202274797065223a202275696e74323536220a20202020202020207d2c207b0a202020202020202020202020226e616d65223a2022646561646c696e65222c0a2020202020202020202020202274797065223a202275696e74323536220a20202020202020207d5d0a202020207d2c0a20202020227072696d61727954797065223a20225065726d6974222c0a2020202022646f6d61696e223a207b0a2020202020202020226e616d65223a202255534420436f696e222c0a202020202020202022766572696679696e67436f6e7472616374223a2022307861306238363939316336323138623336633164313964346132653965623063653336303665623438222c0a202020202020202022636861696e4964223a20312c0a20202020202020202276657273696f6e223a202232220a202020207d2c0a20202020226d657373616765223a207b0a202020202020202022646561646c696e65223a20313636353038363139382c0a2020202020202020226e6f6e6365223a20302c0a2020202020202020227370656e646572223a2022307831313131313131323534666236633434626163306265643238353465373666393036343330393764222c0a2020202020202020226f776e6572223a2022307844414645413439324439633637333361653364353662374564314144423630363932633938426335222c0a20202020202020202276616c7565223a2022313135373932303839323337333136313935343233353730393835303038363837393037383533323639393834363635363430353634303339343537353834303037393133313239363339393335220a202020207d0a7d", "chain": "ethereum_mainnet" }, "vault_id": "f18e03f6-e114-4829-9f46-389b865924ea", "note": "Typed Data message, permit 1inch to spend USDC" } ``` ```json { "types": { "EIP712Domain": [{ "name": "name", "type": "string" }, { "name": "version", "type": "string" }, { "name": "chainId", "type": "uint256" }, { "name": "verifyingContract", "type": "address" }], "Permit": [{ "name": "owner", "type": "address" }, { "name": "spender", "type": "address" }, { "name": "value", "type": "uint256" }, { "name": "nonce", "type": "uint256" }, { "name": "deadline", "type": "uint256" }] }, "primaryType": "Permit", "domain": { "name": "USD Coin", "verifyingContract": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", "chainId": 1, "version": "2" }, "message": { "deadline": 1665086198, "nonce": 0, "spender": "0x1111111254fb6c44bac0bed2854e76f90643097d", "owner": "0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5", "value": "115792089237316195423570985008687907853269984665640564039457584007913129639935" } } ``` ## More EVM API examples To learn more about programmatically signing EVM messages with Fordefi, check out our [API Examples public repository](https://github.com/FordefiHQ/api-examples/tree/main/python/evm-message-signing).