Sol.College

Full lesson

attestprotocol

A Unified Trust Framework

What it does

From the project README:

[](https://opensource.org/licenses/MIT) [](https://github.com/daccred/attestprotocol/issues)
Original
daccred/attestprotocol
SuperStack fork
Blockchains/attestprotocol @ c0c4529
Stars
203
Last push (original)
2026-09-11
Languages
TypeScript, Rust, MDX, Cairo, Shell, TeX
Detected stack
Anchorweb3.js
Categories
Infrastructure & Tooling
Licence
MIT
Homepage
https://attestprotocol.org

Architecture

166 source files. By extension: .ts ×115, .rs ×41, .move ×10.

Top-level directorySource files
packages61
contracts61
apps44

On-chain programs: contracts/solana/programs/attest

Dapp: deploying

This fork is queued for its own live dapp on Sol.College, with a Devnet/Mainnet switch. It appears here, at /dapps/attestprotocol/, once it is deployed and checked on devnet. Until then, run it locally with the commands below.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

daccred/attestprotocol · contracts/solana/programs/attest/src/instructions/attest.rs L37–60 @ c0c4529 · MIT · original
        init_if_needed,        payer = attester,        associated_token::mint = mint_account,        associated_token::authority = levy_receipent,    )]    pub levy_receipent_token_account: Account<'info, TokenAccount>,     /// The schema data account; must match the schema UID.    #[account(        has_one = deployer,    )]    pub schema_data: Account<'info, SchemaData>,     #[account(        init,        payer = attester,        space = Attestation::LEN,        seeds = [b"attestation", schema_data.key().as_ref(), recipient.key.as_ref(), attester.key.as_ref()],        bump    )]    pub attestation: Account<'info, Attestation>,     pub token_program: Program<'info, Token>,    pub associated_token_program: Program<'info, AssociatedToken>,
  1. Line 37 init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs.
  2. Line 46 has_one = deployer,: Checks that a stored pubkey field matches the passed account.
  3. Line 51 init,: Creates and pays for a new account. Space and payer must be specified.
  4. Line 54 seeds = [b"attestation", schema_data.key().as_ref(), recipient.key.as_ref(), attester.key.: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  5. Line 55 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
daccred/attestprotocol · contracts/solana/programs/attest/src/instructions/register_authority.rs L1–24 @ c0c4529 · MIT · original
use crate::events::NewAuthoritySignal;use crate::state::AuthorityRecord;use anchor_lang::prelude::*; #[derive(Accounts)]#[instruction()]pub struct RegisterAuthority<'info> {    #[account(        init,        payer = authority,        seeds = [b"authority", authority.key().as_ref()],        bump,        space = AuthorityRecord::LEN,    )]    pub authority_record: Account<'info, AuthorityRecord>,     #[account(mut, signer)]    pub authority: Signer<'info>,     pub system_program: Program<'info, System>,} /// Finds or registers a new authority.pub fn register_authority_handler(ctx: Context<RegisterAuthority>) -> Result<()> {
  1. Line 9 init,: Creates and pays for a new account. Space and payer must be specified.
  2. Line 11 seeds = [b"authority", authority.key().as_ref()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  3. Line 12 bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
  4. Line 18 pub authority: Signer<'info>,: Requires this account to have signed the transaction.
daccred/attestprotocol · contracts/solana/programs/attest/src/instructions/create_schema.rs L1–24 @ c0c4529 · MIT · original
use crate::errors::AttestError;use crate::events::SchemaCreated;use crate::state::{AuthorityRecord, Levy, SchemaData};use anchor_lang::prelude::*;// use authority_resolver::AuthorityRecord; #[derive(Accounts)]#[instruction(_schema_name: String)]pub struct CreateSchema<'info> {    #[account(mut)]    /// Deployer who creates the schema.    pub deployer: Signer<'info>,     #[account(        mut,        constraint = deployer.key() == authority_record.authority.key() @ AttestError::Unauthorized,    )]    pub authority_record: Account<'info, AuthorityRecord>,     /// Schema data stored at the derived PDA.    #[account(        init_if_needed,        seeds = [b"schema", deployer.key().as_ref(), _schema_name.as_bytes()],        bump,
  1. Line 12 pub deployer: Signer<'info>,: Requires this account to have signed the transaction.
  2. Line 22 init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs.
  3. Line 23 seeds = [b"schema", deployer.key().as_ref(), _schema_name.as_bytes()],: Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 24 bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
daccred/attestprotocol · contracts/solana/programs/attest/src/instructions/delegated_attest.rs L49–72 @ c0c4529 · MIT · original
    pub levy_receipent_token_account: Account<'info, TokenAccount>,     /// The schema data account; must match the schema UID.    #[account(        has_one = deployer,        // constraint = schema_data.to_account_info().owner == &schema_registry_program.key() @ AttestError::InvalidSchema,    )]    pub schema_data: Account<'info, SchemaData>,     #[account(        init,        payer = delegated_attester,        space = Attestation::LEN,        seeds = [b"attestation", schema_data.key().as_ref(), recipient.as_ref(), attester.as_ref()],        bump    )]    pub attestation: Account<'info, Attestation>,     // pub schema_registry_program: Program<'info, SchemaRegistry>,    pub token_program: Program<'info, Token>,    pub associated_token_program: Program<'info, AssociatedToken>,    pub system_program: Program<'info, System>,    pub ed25519_program: Program<'info, ED25519>,}
  1. Line 53 has_one = deployer,: Checks that a stored pubkey field matches the passed account.
  2. Line 59 init,: Creates and pays for a new account. Space and payer must be specified.
  3. Line 62 seeds = [b"attestation", schema_data.key().as_ref(), recipient.as_ref(), attester.as_ref(): Declares the PDA seeds. Anchor re-derives the address and rejects the account if it doesn't match.
  4. Line 63 bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run devpnpm run --recursive dev
.npm run buildpnpm run --recursive build
.npm run testpnpm run -r test
.npm run lintpnpm run -r lint
packages/corenpm run devtsup --watch
packages/corenpm run buildpnpm clean && tsup
packages/corenpm run testvitest
packages/stellar-sdknpm run devtsup --watch
packages/stellar-sdknpm run buildtsup
packages/stellar-sdknpm run testvitest
packages/stellar-sdknpm run linteslint "src/**/*.ts"
packages/sdknpm run buildtsup
packages/sdknpm run testvitest run --passWithNoTests
packages/clinpm run startts-node ./bin/run.ts
packages/clinpm run buildtsup
packages/clinpm run testjest

What you could build from it