Skip to main content

What are Resolvers?

Resolvers are smart contracts that define custom validation rules for attestations. When you attach a resolver to a schema, every attestation must pass through the resolver’s validation logic before being created.
Schemas and attestations are permissionless by default. Resolvers are how you add access control, fees, or custom rules when you need them.

Why Use Resolvers?

By default, anyone can attest to any schema. This permissionless model is intentional — it enables open, composable attestations. But sometimes you need control: Resolvers let you:
  • Control access — Only allow specific addresses to attest
  • Collect fees — Require payment before attestation creation
  • Distribute rewards — Incentivize attestation with token rewards
  • Enforce rules — Implement custom business logic

Resolver Interface

All resolvers implement the same interface, making them pluggable and interchangeable:

Hook Functions

Critical vs Non-Critical: If onattest or onrevoke fails, the operation is aborted. If onresolve fails, the attestation still succeeds — it’s for side effects only.

Attestation Data

Resolvers receive complete attestation data for validation:

Resolver Types

Default Resolver

The simplest resolver — validates basic rules without economic requirements.
Use cases:
  • Development and testing
  • Schemas without special requirements
  • Base implementation for custom resolvers

Fee Collection Resolver

Requires payment before attestation creation.
Use cases:
  • Monetizing attestation services
  • Spam prevention through economic cost
  • Revenue generation for attestation providers

Token Reward Resolver

Distributes token rewards for attestation creation.
Use cases:
  • Incentivizing attestation creation
  • Community engagement programs
  • Protocol growth mechanics

Authority Resolver

Permission-based access control with verification.
Use cases:
  • Restricted attestation environments
  • Verified issuer programs
  • Credentialed attestation systems

Creating a Custom Resolver

Step 1: Implement the Interface

Step 2: Build the Contract

Step 3: Deploy to Stellar

Step 4: Attach to a Schema

Binding Resolvers to Schemas

When you create a schema, you can optionally attach a resolver:
Once a schema is created, its resolver cannot be changed. Choose your resolver carefully before deploying to production.

Error Handling

Resolvers use a standard error enum:

Security Considerations

Resolver bugs can lead to unauthorized attestations or denial of service. Test thoroughly before production deployment.

Best Practices

  1. Always require auth — Call require_auth() on the attester
  2. Validate all inputs — Don’t trust data from the protocol
  3. Handle failures gracefully — Return proper error codes
  4. Avoid state dependencies — Don’t rely on external state that can be manipulated
  5. Test edge cases — Expired attestations, revocations, etc.

Common Pitfalls

Testing Resolvers

Built-in Resolvers

The protocol provides pre-built resolvers you can use:

Next Steps

Authorities

Understand the trust layer for attestation issuers

Schemas

Define attestation structures with resolver bindings

Stellar Overview

Deep dive into Stellar contract architecture

GitHub

Browse resolver source code