verifyChain
Signature
Section titled “Signature”const chain = await fidemark.verifyChain(uid);// [root, ..., leaf], oldest-firstchain = fidemark.verify_chain(uid)# [root, ..., leaf], oldest-firstchain, err := client.VerifyChain(ctx, uid)// []*Attestation, oldest-first (root, ..., leaf)Each attestation has a refUID field: the UID of a parent attestation it references. verifyChain follows that chain:
- Fetches the attestation at
uid. - If
refUIDis not the zero hash, fetches the parent. - Repeats up to depth 32 (cycle-safe).
- Returns the chain root -> … -> leaf.
When chains stop early
Section titled “When chains stop early”The walker exits early (keeping whatever it’s gathered) when:
- The next link’s UID isn’t found.
- The next link’s schema isn’t a Fidemark schema (the chain has “exited” Fidemark and references a foreign EAS attestation;
refUIDis still readable but not decoded). - A cycle is detected.
Use case: composable provenance
Section titled “Use case: composable provenance”A common composition:
- Human authors an article -> attest Human Proof for
original-> UIDH1. - AI translates it -> attest AI Proof for
translatedwithrefUID = H1-> UIDA1. - A reviewer signs off -> attest Human Proof for
reviewwithrefUID = A1-> UIDH2.
Then walking the chain from H2 returns [H1, A1, H2]: the full provenance trail in one query.
For more chain shapes (AI output endorsed by a verified human, multi-party endorsement, off-chain promotion, …) see Guides -> Workflow examples.
Creating chained attestations
Section titled “Creating chained attestations”Complete, copy-pasteable runnable. Pass refUID to the human or AI attest call. See Configuration for every constructor option.
import { Fidemark, getNetwork } from "@fidemark/sdk";
const fidemark = new Fidemark({ network: getNetwork("base-sepolia"), privateKey: process.env.PRIVATE_KEY,});
const child = await fidemark.attestHuman({ content: review, contentType: "text/review", refUID: parentUID,});import osfrom fidemark import AttestHumanInput, Fidemark, get_network
fidemark = Fidemark( network=get_network("base-sepolia"), private_key=os.environ["PRIVATE_KEY"],)
child = fidemark.attest_human(AttestHumanInput( content=review, content_type="text/review", ref_uid=parent_uid,))import ( "context" "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) }
child, err := client.AttestHuman(context.Background(), fidemark.AttestHumanInput{ Content: []byte(review), ContentType: "text/review", RefUID: parentUID,})The SDK passes refUID through to EAS’s native refUID field. EAS doesn’t enforce that the parent exists: verification consumers should call the chain walker to confirm the chain is well-formed.