permit2-router-witness

Generate and validate EIP-712 Permit2 witness signatures for Balancer V3 router swaps.

Updated Nov 5, 2025
One-click install
npx skills add https://github.com/cyotee/crane --skill permit2-router-witness
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: permit2-router-witness
Source: https://github.com/cyotee/crane/tree/main/.claude/skills/permit2-router-witness
Command: npx skills add https://github.com/cyotee/crane --skill permit2-router-witness

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate and validate Permit2 witness signatures for Balancer V3 router swaps to enable secure signed trades.

Core Features & Use Cases

  • Canonical witness retrieval: Reads and uses the router-provided witness type string and hash.
  • Typed-data signing: Enforces EIP-712 signing for witness payloads, preventing unsafe signing methods.
  • Nonce/deadline handling: Generates fresh nonces and enforces strict expiry to prevent replay.

Quick Start

Configure and call the signed swap path using the router's Permit2 witness to authorize a Balancer V3 trade.

Frequently Asked Questions about permit2-router-witness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Permit2 witness signatures for Balancer V3 router swaps?

To generate Permit2 witness signatures for Balancer V3 router swaps, construct EIP-712 typed-data payloads, sign them, and submit the signed messages to Permit2 with proper nonce and deadline handling.

Why does my Permit2 witness signature fail for Balancer V3 swaps?

Permit2 witness signatures fail when using unsafe signing methods instead of EIP-712, or when the witness type string and hash do not match the router-provided constants. Enforcing strict typed-data signing resolves this.

How does EIP-712 typed-data signing work with Permit2 witnesses?

EIP-712 typed-data signing with Permit2 witnesses works by encoding the Balancer V3 router swap details into a structured payload, which is then signed to authorize secure trades without transferring token approvals directly.

Do I need to handle nonces and deadlines for Permit2 witness signatures?

Yes, you must handle nonces and deadlines for Permit2 witness signatures by generating fresh nonces from the Permit2 nonce bitmap and enforcing strict expiry times to prevent replay attacks.

Can I use Permit2 witnesses for Balancer V3 swaps in DeFi backend code?

Yes, you can use Permit2 witnesses for Balancer V3 swaps in DeFi backend or frontend code by reading router constants, generating typed-data payloads, and ensuring token approvals are set to Permit2.