Skip to content

revoke

const { txHash } = await fidemark.revoke(uid);

Only the original attester can revoke. EAS enforces this at the protocol level: any other signer’s revoke transaction will revert.

  • Revocation is on-chain, even for attestations that were originally created off-chain.
  • Revoked attestations are not deleted: they remain queryable, with revoked: true and a revokedAt timestamp.
  • Revocation is itself a transaction: about 85k gas, ~$0.002 on Base at typical fees ($2,300 ETH).
CodeCause
ATTESTATION_NOT_FOUNDNo attestation exists for this UID.
VALIDATION_REJECTEDThe signer is not the original attester.
INVALID_INPUTNo signer was configured on the Fidemark instance.

Complete, copy-pasteable runnable. Revoke requires the original attester’s signer. See Configuration for every constructor option.

import { Fidemark, FidemarkError, getNetwork } from "@fidemark/sdk";
const fidemark = new Fidemark({
network: getNetwork("base-sepolia"),
privateKey: process.env.PRIVATE_KEY,
});
try {
await fidemark.revoke(uid);
} catch (err) {
if (err instanceof FidemarkError && err.code === "VALIDATION_REJECTED") {
console.error("Only the original attester can revoke this UID.");
} else {
throw err;
}
}