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 directory | Source files |
|---|---|
packages | 61 |
contracts | 61 |
apps | 44 |
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.
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>,- Line 37
init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs. - Line 46
has_one = deployer,: Checks that a stored pubkey field matches the passed account. - Line 51
init,: Creates and pays for a new account. Space and payer must be specified. - 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. - Line 55
bump: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
contracts/solana/programs/attest/src/instructions/register_authority.rs L1–24 @ c0c4529 · MIT · originaluse 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<()> {- Line 9
init,: Creates and pays for a new account. Space and payer must be specified. - 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. - Line 12
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve. - Line 18
pub authority: Signer<'info>,: Requires this account to have signed the transaction.
contracts/solana/programs/attest/src/instructions/create_schema.rs L1–24 @ c0c4529 · MIT · originaluse 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,- Line 12
pub deployer: Signer<'info>,: Requires this account to have signed the transaction. - Line 22
init_if_needed,: Creates the account only if it doesn't exist. Watch for re-initialisation bugs. - 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. - Line 24
bump,: Uses the bump seed, the extra byte that pushes the derived address off the ed25519 curve.
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>,}- Line 53
has_one = deployer,: Checks that a stored pubkey field matches the passed account. - Line 59
init,: Creates and pays for a new account. Space and payer must be specified. - 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. - 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.
| Directory | Command | Runs |
|---|---|---|
. | npm run dev | pnpm run --recursive dev |
. | npm run build | pnpm run --recursive build |
. | npm run test | pnpm run -r test |
. | npm run lint | pnpm run -r lint |
packages/core | npm run dev | tsup --watch |
packages/core | npm run build | pnpm clean && tsup |
packages/core | npm run test | vitest |
packages/stellar-sdk | npm run dev | tsup --watch |
packages/stellar-sdk | npm run build | tsup |
packages/stellar-sdk | npm run test | vitest |
packages/stellar-sdk | npm run lint | eslint "src/**/*.ts" |
packages/sdk | npm run build | tsup |
packages/sdk | npm run test | vitest run --passWithNoTests |
packages/cli | npm run start | ts-node ./bin/run.ts |
packages/cli | npm run build | tsup |
packages/cli | npm run test | jest |
What you could build from it
- Fork the SuperStack copy and extend it within the Infrastructure & Tooling gaps listed on the idea page.
- Learn the pattern first: Building and sending transactions from a client
- Learn the pattern first: Anchor account constraints