How to sign a Stamped Mandate with user keys and agent keys
A is a user’s signed authorisation for a set of scoped actions. A Stamped Mandate is delivered over the API as a PINT (header x-sumvin-pint-token).Once you’ve constructed a PINT payload, it needs to be signed before it can be exchanged for a JWT. The Sumvin ecosystem supports two signer types, each using different cryptographic curves and verification methods.
When an AI agent signs a Stamped Mandate on the user’s behalf, it uses a P-256 key that has been registered as an authorised signer on the user’s Safe smart account. Verification happens on-chain via EIP-1271 — the SIS calls isValidSignature on the Safe contract to confirm the agent key is authorised.
import { p256 } from "@noble/curves/p256";// Agent's P-256 private keyconst agentPrivateKey = new Uint8Array(/* ... */);// Hash the EIP-712 typed data (same hash as user signing)const typedDataHash = hashTypedData({ domain, types, primaryType: "PurchaseIntent", message });// Sign with P-256const sig = p256.sign(typedDataHash.slice(2), agentPrivateKey);const signature = "0x" + sig.toDERHex();
When exchanging an agent-signed PINT, the SIS detects the agent key automatically — no need to specify signer_type in the request:
Agent signing requires the P-256 key to be registered on the user’s Safe contract. If the key is not an authorised signer, the EIP-1271 verification will fail with error code PINT-401-002.