revoke
Signature
Section titled “Signature”const { txHash } = await fidemark.revoke(uid);result = fidemark.revoke(uid) # {"tx_hash": "0x..."}txHash, err := client.Revoke(ctx, uid)Only the original attester can revoke. EAS enforces this at the protocol level: any other signer’s revoke transaction will revert.
Behavior
Section titled “Behavior”- Revocation is on-chain, even for attestations that were originally created off-chain.
- Revoked attestations are not deleted: they remain queryable, with
revoked: trueand arevokedAttimestamp. - Revocation is itself a transaction: about 85k gas, ~$0.002 on Base at typical fees ($2,300 ETH).
Errors
Section titled “Errors”| Code | Cause |
|---|---|
ATTESTATION_NOT_FOUND | No attestation exists for this UID. |
VALIDATION_REJECTED | The signer is not the original attester. |
INVALID_INPUT | No signer was configured on the Fidemark instance. |
Example
Section titled “Example”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; }}import osfrom fidemark import Fidemark, FidemarkError, get_network
fidemark = Fidemark( network=get_network("base-sepolia"), private_key=os.environ["PRIVATE_KEY"],)
try: fidemark.revoke(uid)except FidemarkError as err: if err.code == "VALIDATION_REJECTED": print("Only the original attester can revoke this UID.") else: raiseimport ( "context" "errors" "log" "os"
"github.com/fidemark/sdk-go/fidemark")
network, _ := fidemark.GetNetwork("base-sepolia")client, err := fidemark.New(fidemark.Config{ Network: network, PrivateKey: os.Getenv("PRIVATE_KEY"),})if err != nil { log.Fatal(err) }
if _, err := client.Revoke(context.Background(), uid); err != nil { var fe *fidemark.Error if errors.As(err, &fe) && fe.Code() == fidemark.ErrValidationRejected { log.Println("Only the original attester can revoke this UID.") } else { log.Fatal(err) }}