Agent skill

Eip712 Signing

by ccashwell in ccashwell/evm-cortex

A skill your agent uses when implementing EIP-712 typed structured data signing.

MITAuto-check passedMarketing & SEO

Install Eip712 Signing

skills CLI
$ npx skills add ccashwell/evm-cortex --skill eip712-signing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ccashwell/evm-cortex eip712-signing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ccashwell/evm-cortex.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/eip712-signing .claude/skills/eip712-signing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
eip712-signing
GitHub stars
131
Token cost
~1.6k tokens
SKILL.md length
158 words
Files
1
Skills in repo
89
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing EIP-712 typed structured data signing.

  • Implementing EIP-712 typed structured data signing
  • SKILL.md covers Overview, Domain Separator, Chain ID Handling for Forks and Type Hash and Encoding, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Schema markup

What it does

Eip712 Signing is an agent skill from ccashwell/evm-cortex. Use when implementing EIP-712 typed structured data signing. Covers domain separator, type hashing, encoding rules, DOMAINSEPARATOR caching, chain ID fork handling, permit (EIP-2612), and gasless transaction patterns.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Marketing & SEO, covering Schema markup and Caching. The repository describes itself as: Ethereum protocol engineering squad for AI coding assistants. The licence is MIT.

When your agent uses it

  • Implementing EIP-712 typed structured data signing
  • Tasks that involve Schema markup
  • Tasks that involve Caching

Example prompts

  • “/eip712-signing”

What it can do on your machine

Read from SKILL.md and the folder at commit f8f3301. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are solidity and typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Eip712 Signing loads about 1.6k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 158 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ccashwell/evm-cortex at commit f8f3301, republished under its MIT licence (© ccashwell). 158 words, ~1,631 tokens.

Download SKILL.mdSave it as .claude/skills/eip712-signing/SKILL.md (or your agent's skills folder).
name
eip712-signing
description
Use when implementing EIP-712 typed structured data signing. Covers domain separator, type hashing, encoding rules, DOMAIN_SEPARATOR caching, chain ID fork handling, permit (EIP-2612), and gasless transaction patterns.

EIP-712 Typed Structured Data Signing

Overview

EIP-712 provides human-readable signing for structured data. Users see what they're signing in their wallet instead of opaque hex. Used by EIP-2612 (Permit), governance voting, meta-transactions, and order books.

Domain Separator

solidity
bytes32 constant DOMAIN_TYPEHASH = keccak256(
    "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
);

function _buildDomainSeparator() internal view returns (bytes32) {
    return keccak256(abi.encode(
        DOMAIN_TYPEHASH,
        keccak256(bytes("MyProtocol")),
        keccak256(bytes("1")),
        block.chainid,
        address(this)
    ));
}

Chain ID Handling for Forks

Cache the domain separator at construction but recompute if chain ID changes (fork protection):

solidity
bytes32 private immutable _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;

bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;

constructor(string memory name, string memory version) {
    _hashedName = keccak256(bytes(name));
    _hashedVersion = keccak256(bytes(version));
    _cachedChainId = block.chainid;
    _cachedThis = address(this);
    _cachedDomainSeparator = _buildDomainSeparator();
}

function DOMAIN_SEPARATOR() public view returns (bytes32) {
    if (block.chainid == _cachedChainId && address(this) == _cachedThis) {
        return _cachedDomainSeparator;
    }
    return _buildDomainSeparator();
}

OpenZeppelin's EIP712 base contract handles all of this automatically.

Type Hash and Encoding

solidity
bytes32 constant PERMIT_TYPEHASH = keccak256(
    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
);

function _hashPermit(
    address owner, address spender, uint256 value, uint256 nonce, uint256 deadline
) internal pure returns (bytes32) {
    return keccak256(abi.encode(
        PERMIT_TYPEHASH, owner, spender, value, nonce, deadline
    ));
}

Full Signing Flow

solidity
function _hashTypedDataV4(bytes32 structHash) internal view returns (bytes32) {
    return keccak256(abi.encodePacked(
        "\x19\x01",
        DOMAIN_SEPARATOR(),
        structHash
    ));
}

Complete EIP-2612 Permit Implementation

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import {Nonces} from "@openzeppelin/contracts/utils/Nonces.sol";

contract PermitToken is ERC20, EIP712, Nonces {
    bytes32 private constant PERMIT_TYPEHASH = keccak256(
        "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
    );

    constructor() ERC20("Permit Token", "PMT") EIP712("Permit Token", "1") {
        _mint(msg.sender, 1_000_000e18);
    }

    function permit(
        address owner, address spender, uint256 value,
        uint256 deadline, uint8 v, bytes32 r, bytes32 s
    ) external {
        require(block.timestamp <= deadline, "Permit expired");

        bytes32 structHash = keccak256(abi.encode(
            PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline
        ));
        bytes32 digest = _hashTypedDataV4(structHash);
        address signer = ECDSA.recover(digest, v, r, s);
        require(signer == owner, "Invalid signature");

        _approve(owner, spender, value);
    }
}

Offchain Signing (ethers.js / viem)

typescript
import { createWalletClient, custom } from 'viem';

const domain = {
  name: 'MyProtocol',
  version: '1',
  chainId: 1,
  verifyingContract: '0xContractAddress...' as const,
};

const types = {
  Order: [
    { name: 'maker', type: 'address' },
    { name: 'token', type: 'address' },
    { name: 'amount', type: 'uint256' },
    { name: 'nonce', type: 'uint256' },
    { name: 'deadline', type: 'uint256' },
  ],
};

const message = {
  maker: '0xAlice...',
  token: '0xToken...',
  amount: 1000000000000000000n,
  nonce: 0n,
  deadline: 1700000000n,
};

const signature = await walletClient.signTypedData({ domain, types, primaryType: 'Order', message });

Nested Structs

For structs containing other structs, the type string includes all referenced types in alphabetical order:

solidity
bytes32 constant ORDER_TYPEHASH = keccak256(
    "Order(address maker,Asset asset,uint256 deadline)"
    "Asset(address token,uint256 amount)"
);

bytes32 constant ASSET_TYPEHASH = keccak256(
    "Asset(address token,uint256 amount)"
);

function _hashOrder(Order memory order) internal pure returns (bytes32) {
    return keccak256(abi.encode(
        ORDER_TYPEHASH,
        order.maker,
        _hashAsset(order.asset),
        order.deadline
    ));
}

function _hashAsset(Asset memory asset) internal pure returns (bytes32) {
    return keccak256(abi.encode(ASSET_TYPEHASH, asset.token, asset.amount));
}

Foundry Testing

solidity
function test_permit() public {
    uint256 ownerKey = 0xA11CE;
    address owner = vm.addr(ownerKey);
    _mint(owner, 1e18);

    bytes32 digest = token.DOMAIN_SEPARATOR();
    bytes32 structHash = keccak256(abi.encode(
        PERMIT_TYPEHASH, owner, spender, 1e18, 0, block.timestamp + 1 hours
    ));
    bytes32 hash = keccak256(abi.encodePacked("\x19\x01", digest, structHash));

    (uint8 v, bytes32 r, bytes32 s) = vm.sign(ownerKey, hash);
    token.permit(owner, spender, 1e18, block.timestamp + 1 hours, v, r, s);

    assertEq(token.allowance(owner, spender), 1e18);
}

Security Checklist

  • Always check deadline >= block.timestamp
  • Use auto-incrementing nonces to prevent replay attacks
  • Cache DOMAIN_SEPARATOR but recompute on chain ID change
  • Include verifyingContract in domain to prevent cross-contract replay
  • Validate recovered signer is not address(0) (invalid signature)
  • Use OpenZeppelin's EIP712 base for correct implementation
  • Hash dynamic types (bytes, string) with keccak256 before encoding
  • Arrays are encoded as keccak256(abi.encodePacked(element1, element2, ...))

© ccashwell, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/eip712-signing of ccashwell/evm-cortex.

Open the folder on GitHubat commit f8f3301

Compare with similar skills

Eip712 Signing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Eip712 Signing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Eip712 Signing this skillccashwell/evm-cortex131—~1.6kAutomated safety check: PassMIT
Website Searchthedaviddias/Front-End-Checklist74k—~556Automated safety check: PassMIT
SEO GeoReScienceLab/opc-skills1.8k4 repos~2.1kAutomated safety check: PassApache-2.0
GEO-First SEO Audit Toolzubair-trabzada/geo-seo-claude11k—~2.8kAutomated safety check: NotesMIT
SEO Optimizerailabs-393/ai-labs-claude-skills4541 repos~3.2kAutomated safety check: PassMIT
Portaljs Add Dcatdatopian/portaljs2.4k1 repos~1.8kAutomated safety check: PassMIT

Similar skills

  • Website Search

    thedaviddias/Front-End-Checklist

    A skill your agent uses when applies to sites with internal site search functionality.

    74k GitHub stars~556 tokensUpdated 3 days ago
    Marketing & SEOAuto-check passed
  • SEO Geo

    ReScienceLab/opc-skills

    SEO & GEO (Generative Engine Optimization) for websites. An agent skill from ReScienceLab/opc-skills.

    1.8k GitHub starsUsed in 4 repos~2.1k tokens
    Marketing & SEOAuto-check passed
  • GEO-First SEO Audit Tool

    zubair-trabzada/geo-seo-claude

    Audits a website for AI search visibility across ChatGPT, Claude, Perplexity and Google AI Overviews while checking traditional SEO, schema and E-E-A-T content quality.

    11k GitHub stars~2.8k tokensUpdated yesterday
    Marketing & SEOAuto-check: notes
  • SEO Optimizer

    ailabs-393/ai-labs-claude-skills

    This skill should be used when analyzing HTML/CSS websites for SEO optimization, fixing SEO issues, generating SEO reports, or implementing SEO best practices.

    454 GitHub starsUsed in 1 repo~3.2k tokens
    Marketing & SEOAuto-check passed
  • Portaljs Add Dcat

    datopian/portaljs

    Make a PortalJS portal harvestable by national/EU/US open-data portals — emit standards-compliant DCAT catalog feeds (DCAT 2/3, DCAT-AP, DCAT-US, national profiles) in JSON-LD, Turtle, and RDF/XML…

    2.4k GitHub starsUsed in 1 repo~1.8k tokens
    Marketing & SEOAuto-check passed
  • Schema Markup

    freekmurze/dotfiles

    When the user wants to add, fix, or optimize schema markup and structured data on their site.

    1k GitHub starsUsed in 15 repos~1.2k tokens
    Marketing & SEOAuto-check passed

More from ccashwell/evm-cortex

All 89 skills in this repo
  • Xray Pre Audit

    ccashwell/evm-cortex

    A skill your agent uses when preparing for a security audit, performing reconnaissance on a new codebase, or creating a protocol overview.

    131 GitHub stars~25k tokensUpdated 10 days ago
    Auto-check passed
  • Aave Integration

    ccashwell/evm-cortex

    A skill your agent uses when integrating with Aave V3 for lending, borrowing, flash loans, or building on top of Aave markets.

    131 GitHub stars~1.3k tokensUpdated 10 days ago
    Auto-check passed
  • Access Control Patterns

    ccashwell/evm-cortex

    Access control design patterns for Solidity protocols. An agent skill from ccashwell/evm-cortex.

    131 GitHub stars~1.8k tokensUpdated 10 days ago
    Auto-check passed
  • Anvil Patterns

    ccashwell/evm-cortex

    A skill your agent uses when running a local Ethereum node with Anvil.

    131 GitHub stars~1.3k tokensUpdated 10 days ago
    Auto-check passed
  • Audit Breadth Scan

    ccashwell/evm-cortex

    A skill your agent uses when performing systematic breadth-first review of all contracts during a security audit.

    131 GitHub stars~1.4k tokensUpdated 10 days ago
    Auto-check passed
  • Audit Depth Analysis

    ccashwell/evm-cortex

    A skill your agent uses when performing deep analysis of specific findings or high-risk areas during a security audit.

    131 GitHub stars~1.6k tokensUpdated 10 days ago
    Auto-check passed

Questions about Eip712 Signing

What does Eip712 Signing do?

A skill your agent uses when implementing EIP-712 typed structured data signing. Eip712 Signing is an agent skill from ccashwell/evm-cortex. Use when implementing EIP-712 typed structured data signing.

When should I use Eip712 Signing?

Eip712 Signing fits situations like: implementing EIP-712 typed structured data signing; tasks that involve Schema markup; tasks that involve Caching.

How do I install Eip712 Signing in Claude Code?

Run `npx skills add ccashwell/evm-cortex --skill eip712-signing -a claude-code`. Or copy the skill folder (skills/eip712-signing in ccashwell/evm-cortex) into .claude/skills/eip712-signing in your project. Claude Code loads it when a task matches its description.

How do I install Eip712 Signing in Codex?

Run `npx skills add ccashwell/evm-cortex --skill eip712-signing -a codex`. Or copy the skill folder (skills/eip712-signing in ccashwell/evm-cortex) into .agents/skills/eip712-signing in your project. Codex loads it when a task matches its description.

Can I use Eip712 Signing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ccashwell/evm-cortex --skill eip712-signing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/eip712-signing, .gemini/skills/eip712-signing, .github/skills/eip712-signing and .opencode/skills/eip712-signing in your project.

What does Eip712 Signing need to run?

SKILL.md names no scripts, command-line tools or credentials: Eip712 Signing is instructions for the agent only.

Does Eip712 Signing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Eip712 Signing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Eip712 Signing use?

Eip712 Signing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Eip712 Signing use?

About 1.6k tokens (SKILL.md is roughly 6.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Eip712 Signing?

Skills that share tags, products or a category with Eip712 Signing: Website Search (thedaviddias/Front-End-Checklist, 74k stars), SEO Geo (ReScienceLab/opc-skills, 1.8k stars), GEO-First SEO Audit Tool (zubair-trabzada/geo-seo-claude, 11k stars) and SEO Optimizer (ailabs-393/ai-labs-claude-skills, 454 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Eip712 Signing?

ccashwell (a GitHub user) maintains it in ccashwell/evm-cortex, which has 131 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on September 30, 2026.

Source: ccashwell/evm-cortex on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.