AttestationRecord stored permanently on the Stellar ledger. You cannot fake an attestation — the contract enforces that only the stream contract (set at initialization time) can call mint_attestation, which means every record is backed by a real token transfer that happened in the same transaction.
Contract Address
Testnet:CD22NZLAI53Y2LZB2GNLVITQXZWGZ3AQ6QKVKNUDKWABIIQIDEFSPQCG
Key Functions
function → ()
Initializes the attestation contract. Must be called once before any other function. The
stream_contract address set here is the only address ever permitted to call mint_attestation.Parameters:admin— Admin address for the contractstream_contract— The authorized stream contract address
function → u64
Creates a new
AttestationRecord and stores it permanently on the Stellar ledger. Returns the new attestation_id.This function can only be called by the stream contract. It is invoked automatically as part of the withdraw_approved or finalize_checkpoint execution path — never directly by end users. Both the token transfer and this call occur in the same Stellar transaction, guaranteeing atomicity.Parameters:caller— Must be the registered stream contract addresskind— Attestation type:Checkpoint,WorkSession, orLegacyReviewedstream_id— Stream that generated this attestationrequest_id— Work session / withdrawal request ID; empty string for checkpoint-type attestationscheckpoint_index— Zero-based checkpoint index;0for work-session and legacy typessender— Client’s Stellar addressrecipient— Worker’s Stellar addressamount_paid— Amount paid in stroopsasset— Token contract addresscategory— Work category inherited from the streamtitle— Stream title copied to the recordperiod_start_ledger— Start of the work period in ledger sequenceperiod_end_ledger— End of the work period in ledger sequenceactive_duration_seconds— Active working seconds measured during the session;0for checkpoint typesclient_confirmed—trueif the client explicitly approved;falsefor auto-releasedauto_released—trueif the deadline passed without client actionverifier— Verifier address forWorkSessionkind;Noneotherwisereport_hash— SHA-256 hash of the verification report;Noneotherwise
function → AttestationRecord
Returns a single
AttestationRecord by its ID. Extends the record’s TTL on every read.Parameters:attestation_id— The unique attestation identifier
function → Vec<u64>
Returns the list of attestation IDs associated with the given worker address, in the order they were minted. Used by the reputation contract to compute scores.Parameters:
recipient— Worker’s Stellar address
function → Vec<u64>
Returns the list of attestation IDs associated with the given client address, in the order they were minted.Parameters:
sender— Client’s Stellar address
function → bool
Returns
true if the attestation exists and has a positive amount_paid. A lightweight existence check that does not return the full record.Parameters:attestation_id— The attestation ID to check
AttestationRecord Fields
EveryAttestationRecord is stored in Soroban’s persistent storage and contains the full context of the verified work event.
u64
Unique auto-incrementing identifier assigned at mint time.
AttestationKind
The minting path that produced this record. See AttestationKind Values below.
u64
The ID of the stream this attestation belongs to.
String
The work session or withdrawal request ID. Empty string for
Checkpoint-kind attestations.u32
Zero-based checkpoint index for
Checkpoint-kind attestations. 0 for WorkSession and LegacyReviewed kinds.Address
The client’s Stellar address.
Address
The worker’s Stellar address — the subject of the attestation.
i128
Amount paid to the worker in stroops. Always greater than zero.
Address
Token contract address of the payment asset (USDC or XLM).
Category
Work category inherited from the parent stream:
Freelance, Salary, Bounty, Grant, AgentTask, or Subscription.String
Human-readable title copied from the stream at mint time.
u32
Stellar ledger sequence marking the start of the work period.
u32
Stellar ledger sequence marking the end of the work period.
u64
Active working seconds measured and submitted for the session.
0 for Checkpoint and LegacyReviewed kinds.u32
Stellar ledger sequence at which this attestation was minted. Used by the reputation contract for recency weighting.
bool
true when the client explicitly called approve_withdrawal or approve_checkpoint. false when the deadline elapsed and the request auto-released.bool
true when the withdrawal auto-released after the approval timeout without explicit client action.Option<Address>
The verifier address that signed off on the session. Present only for
WorkSession-kind attestations; None for other kinds.Option<BytesN<32>>
SHA-256 hash of the verification report uploaded to the dashboard. Present only for
WorkSession-kind attestations; None otherwise.AttestationKind Values
Thekind field describes how the attestation was created.
The
kind field tells you how much trust to place in an attestation. A WorkSession attestation has a cryptographic evidence hash and a named verifier attached. A LegacyReviewed attestation relies on the client’s manual review of the withdrawal request.Minting Event
Every successfulmint_attestation call emits an attestation_minted event on the Stellar ledger. You can subscribe to this event from any Stellar RPC endpoint to build real-time integrations.
Topics (indexed):
attestation_id— The new attestation IDstream_id— The parent stream IDcheckpoint_index— Zero-based checkpoint index (or0for work-session types)
recipient— Worker’s Stellar addressamount_paid— Amount paid in stroopskind—Checkpoint,WorkSession, orLegacyReviewedclient_confirmed— Whether the client explicitly approvedauto_released— Whether it was released after timeout
Authorization
Only the stream contract address registered duringinit may call mint_attestation. Any other caller receives an Unauthorized error (code 3). This design ensures that:
- Every attestation on the ledger corresponds to a real token payment.
- No third party can forge attestations or inflate a worker’s reputation.
- The stream contract’s atomicity guarantee extends to the attestation layer — payment and record creation are inseparable.