This is the full developer documentation for Altar # Altar documentation > Altar records deposits across many blockchains and turns them into points. Everything here is checked against the code. For participants Learn what a sacrifice is, how a campaign runs, and how your points are calculated. Then [check the numbers yourself](/participants/verify-it-yourself/). For campaign creators Set up a campaign, understand every setting, and see what the admin tools do. For developers Use the public API. Learn how to sign requests, export data, and reuse the typed schemas. For operators Run your own Altar instance. # Admin tools > What campaign admins can do after a campaign exists. Admins work in the admin page of a campaign: `/#/sacrifice//admin`. Every admin action is a request signed with your wallet. Read routes use one **admin-read** signature for the campaign. Each change uses its own signature that names exactly what changes. See [Authentication and signing](/developers/authentication-and-signing/). Altar checks that the signer holds an admin role for the campaign. A signature for another campaign, or of another kind, does not work. ## What you can do [Section titled “What you can do”](#what-you-can-do) | Tool | What it does | Route | | ------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | Project details | Change the name, description, terms, schedule, and points curve. | `POST /admin/project/update` | | Networks | Add, update, or remove a network of the campaign. | `POST /admin/network` | | Tokens and markets | Add, update, or remove a token and its price source. | `POST /admin/token` | | Admins | Grant or revoke the admin role. Altar refuses to remove the last admin. | `POST /admin/admin` | | Price overrides | See the price corrections of the campaign. | `POST /admin/price-overrides` | | Deposit corrections | Ignore, change, or add a deposit. Each one needs a signed request. | `POST /admin/sacrifice-mutations` (read), `POST /admin/sacrifice-mutation/upsert` (write) | | Deposit details | Read the block, transaction, token, and log behind a deposit. | `POST /admin/sacrifice-details` | | Referrals | List all referrals of the campaign. | `POST /admin/referrals` | | User reports | Read the reports users submitted, and mark one ignored. | `POST /admin/reports`, `POST /admin/report/toggle-ignored` | | Address readiness | See whether each network has the addresses it needs. | `POST /admin/project` | | Address pool upload | Upload a range of deposit addresses and publish its Merkle root. | `POST /admin/address-pool/begin`, `chunk`, `commit` | | Latest block | Ask a network collector for its latest block. | `POST /admin/latest-block` | | Downloads | Get the distribution, breakdown, and audit exports. | `GET /{projectId}/download` | | Derivation wizard | A page that helps you derive root addresses (`/#/sacrifice//admin/derive`). | Not an API route. | Price overrides and deposit corrections are public. Users can read them in the response of `POST /stats/sacrifices`. See [Onchain, calculated, and corrected](/participants/onchain-vs-calculated/). ## Instance admin [Section titled “Instance admin”](#instance-admin) A separate dashboard at `/#/instance` is for the people who run the Altar instance. It shows all campaigns, recent deposits, identity labels, and the funding cycle. Its routes sign in with the `instanceLogin` message, not a campaign signature, and Altar accepts only addresses on its instance admin list. See the `Instance admin` group in the [API reference](/api/signed/). # Campaign settings > Every campaign setting, what it does, its format, and its default. The tables are generated from the real configuration schema. A campaign is one configuration object. These tables are generated when the docs are built. The list of settings comes from the real configuration schema in `sacrifice-utils`, and the defaults come from the built-in default curve. A test fails when the schema gains a setting that these tables do not describe. Large numbers are written as decimal strings. A rate “scaled by 10^18” means that `1000000000000000000` is 1.0, which is 100%. So `62500000000000000` is 6.25%. ### Identity and terms | Setting | What it does | Format | | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | | `projectId` | The campaign identifier. It appears in API paths and in the campaign URL. | Text, 1 or more characters. | | `projectName` | The name people see. | Text. | | `projectDescription` | A longer description for the campaign page. | Text. | | `projectTagline` | A one-line summary. | Text, or empty. | | `projectWebsite` | Link to your own website. | URL, or empty. | | `projectLogo` | Link to the campaign logo image. | URL, or empty. | | `projectBanner` | Link to the banner image. | URL, or empty. | | `projectAccentColor` | The main color of the campaign page. | Color text, or empty. | | `projectAccentColorVariant` | A second color that goes with the accent color. | Color text, or empty. | | `projectDisclaimerShort` | The short terms text. A depositor signs it when they sign in: the login signature includes this exact text, so changing it later changes what a login signature must contain. | Text, or empty. | | `projectDisclaimerLong` | The full terms text shown to depositors. | Text. | | `projectSocialLinks` | Links to your social accounts. | List of platform name and URL pairs. | | `projectTags` | Labels that help people find the campaign. | List of text. | ### Schedule | Setting | What it does | Format | | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | | `startTime` | When the campaign starts. Deposit steps and the bonus windows count from here. Deposits before this time earn points only when the campaign counts early deposits. | Whole seconds since the Unix epoch, as a decimal string. | | `inflectionTime` | When decay begins. Deposits before this time earn the full base rate. It must not be earlier than the start time. | Whole seconds since the Unix epoch, as a decimal string. | | `endTime` | When the campaign ends. A deposit after this time earns no points, and the app stops accepting new address requests. It must not be earlier than the inflection time. Empty means no end. | Whole seconds since the Unix epoch, as a decimal string. Or empty. | ### Points curve | Setting | What it does | Format | Default | | ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------- | | `decayRateSingleStep` | How much the points rate falls in each step after the inflection time. Each step multiplies the points per dollar by 1 divided by (1 plus this rate). | Whole number scaled by 10^18. 62500000000000000 means 6.25% per step. | 6.25% per step | | `decaySingleStepDelaySeconds` | The length of one step. The points calculation refuses a value below one hour (3600 seconds). | Whole seconds, as a decimal string. | 24 hours | | `volumeBonusRate` | Stored with the campaign and shown in the app. The current points calculation does not read it: the volume bonus uses a fixed curve (see How points are calculated). | Whole number scaled by 10^18. | 3x (stored, not used in the calculation) | | `volumeBonusCutoff` | How many steps after the start the volume bonus window lasts. A deposit made before start time plus this many steps is in the volume window. | Whole number of steps. | 54 steps | | `flatBonusRate` | The flat bonus, as a share of the credit points of a deposit in the flat window. 100% adds the same number of points again. | Whole number scaled by 10^18. 1000000000000000000 means 100%. | 100% | | `flatBonusCutoff` | How many steps after the start the flat bonus window ends. The flat window runs from the volume cutoff to this cutoff. | Whole number of steps. | 59 steps | | `usdToPointBaseRate` | Points per US dollar, before decay and bonuses. | Whole number scaled by 10^18. 10000000000000000000000 means 10,000 points per dollar. | 10000 points per dollar | | `referralRate` | The referral rate. It is stored and shown, but the current points calculation does not award referral points. | Whole number scaled by 10^18, or empty. | 10% (stored, not paid) | | `countEarlySacrifices` | Whether deposits made before the start time earn points. When off, they earn nothing. | Yes or no. | Yes | | `useInflectionStepOne` | Whether the moment of inflection already counts as decay step 1. When off, the first step period after inflection is step 0. | Yes or no. | No | | `priceValidFromTimestamp` | Prices saved before this time are treated as out of date and are fetched again. | ISO date and time, or empty. | None | ### Genesis (fixed at creation) | Setting | What it does | Format | | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | | `incrementMode` | Who hands out deposit-address indices: the onchain registry (\`onchain\`) or the server counter (\`offchain\`). Set at creation. It cannot change. | \`onchain\` or \`offchain\`. | | `registryAddress` | The registry contract address. Required for \`onchain\`. Must be empty for \`offchain\`. | EVM address, or empty. | | `registryProjectKey` | The campaign key in the registry. Required for \`onchain\`. Must be empty for \`offchain\`. | 32-byte hex string, or empty. | ## Networks and tokens [Section titled “Networks and tokens”](#networks-and-tokens) A campaign also holds a list of **networks** and a list of **price sources**. Each network has a network family, a chain identifier, a name, and a **root address**. It can have a lower and an upper address range (`lowerRange`, `upperRange`), and a `disabled` flag. Networks that derive a distinct address per index (Bitcoin-style, Cardano, Monero, Solana) also take a **publication mode**: `backend-live` (the server derives addresses on request) or `published-pool` (the admin uploads a range of addresses in advance and publishes its Merkle root). Solana always uses `published-pool`. Each price source names one token and how to price it: | `source` | Meaning | | --------- | ----------------------------------------------------------------------------------------- | | `stable` | A fixed price of one US dollar. | | `ccxt` | An exchange market, read through an open-source exchange library. A `market` is required. | | `dex` | A decentralized exchange pool. A `market` is required. | | `zero` | The token is on purpose ignored: it has no value. | | `pending` | The token waits for a price source. Altar skips it for now. | The configuration also keeps a list of exchange addresses (`cexAddresses`). A deposit whose points address is on this list earns no points, and the deposit lists mark it with `isCexAddress`. The full machine-readable shape is in the [API reference](/api/signed/), under `POST /admin/campaign/import`. # Composer walkthrough > Create a campaign with the campaign composer, step by step. The **composer** is the page where you create a campaign. You build the whole configuration in your browser, sign it with your wallet, and send it to Altar. Altar creates the campaign in one step. The composer is at `https://altar.fund/#/compose`. ## How creation works [Section titled “How creation works”](#how-creation-works) 1. The browser builds a complete campaign configuration from your choices. 2. Your wallet signs it with a typed-data signature (EIP-712). The kind is `campaignImport`. The signature covers the exact text of the configuration plus a timestamp. 3. The browser sends the signed configuration to `POST /admin/campaign/import`. 4. Altar checks the configuration, recovers your address from the signature, and creates the campaign. **The address that signs becomes the sole admin of the new campaign.** 5. The whole write happens in one all-or-nothing database transaction: the campaign, your admin role, every network, and every token price source. Choose the signing wallet with care. It does not need an existing role and it does not need funds. It is the only wallet that can manage the campaign afterward, until it grants admin roles to others. ## Before you start [Section titled “Before you start”](#before-you-start) Have these ready: * A **campaign identifier**: short and unique. It becomes part of the campaign address and the database key. Altar refuses a duplicate with HTTP 409. * The name, description, and the short and long terms texts. * The **start time**, the **inflection time**, and optionally the **end time**. See [Campaign lifecycle](/participants/campaign-lifecycle/). * The networks the campaign accepts, and a **public root address** for each. Deposit addresses are derived from it. It is a public value: you never enter a seed phrase or a private key. A wrong root address gives users deposit addresses you cannot sweep, so check each one twice. * The tokens you accept, each with a price source. ## Step 1: choose a starting mode [Section titled “Step 1: choose a starting mode”](#step-1-choose-a-starting-mode) The “Start from” menu offers four modes: * **A preset.** A ready-made template. Altar ships these: | Preset | What it gives you | Networks | | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | **Empty campaign** `empty` | A blank campaign with the default points curve and no networks or tokens. Add chains and tokens after creating. | None | | **Single-chain PulseChain** `pulsechain-single` | A PulseChain-only campaign with the default points curve. Supply the PulseChain root address, then add tokens. | PulseChain | | **Major EVM chains** `evm-majors` | A multi-chain campaign across the major Ethereum-compatible networks with the default points curve. Supply each chain root address, then add tokens. | Ethereum, Base, BNB Smart Chain, Polygon, Arbitrum One, Optimism | | **Blue-chip multi-chain** `blue-chips` | A multi-chain campaign seeded with major-cap tokens from the curated catalog. Supply each chain root address before importing. | evm:1, evm:10, evm:56, evm:137, bip32:0, bip32:2, bip32:145, cardano:1852, evm:369 | * **Clone an existing campaign.** Copies the configuration of a campaign that already exists. * **Import a file.** Loads a configuration you exported earlier (a JSON file). * **From scratch.** You pick chains and token groups with filters, and the composer resolves them against the token catalog. ## Step 2: identity and schedule [Section titled “Step 2: identity and schedule”](#step-2-identity-and-schedule) Fill in the identity fields (identifier, name, description, website, logo, tagline, banner, colors, terms texts, tags, social links) and the schedule. The composer also asks whether to **count deposits made before the start time**. When off, those deposits earn nothing. See [Early deposits](/participants/early-deposits/). The composer starts with the default points curve. You change the curve after creation, in the admin page. See [Campaign settings](/creators/campaign-settings/). ## Step 3: root addresses [Section titled “Step 3: root addresses”](#step-3-root-addresses) Each network needs a root address. The format depends on the network family: * Ethereum-compatible chains: one address. * Bitcoin-style chains: the extended public key for the network. * Cardano: the account extended public key. * XRP and Stellar: one root account address. Users are told apart by a memo. ## Step 4: review [Section titled “Step 4: review”](#step-4-review) Check the identifier, the networks and their root addresses, and every token’s price source. A token with no working price source is never priced, so its deposits do not earn points. The composer checks the configuration before it asks for your signature. It lists every problem it finds. The checks include: * The inflection time is not before the start time. The end time is not before the inflection time. * No network appears twice, and every network has a root address. * Every token price source points to a network of the campaign, and none is listed twice. * A price source other than `stable` names a market. * For an onchain campaign, a valid registry address and a 32-byte registry key. ## Step 5: sign and create [Section titled “Step 5: sign and create”](#step-5-sign-and-create) Click **Create campaign** and approve the signature request. On success the app opens the admin view of the new campaign. If it fails, you see the reason. Common reasons are an identifier that already exists (409), a configuration error (400), or a declined signature. After creation, the campaign appears in `GET /projects`. At the time its runbook was written, the collector read its list of campaigns once at startup, so an operator restarted the collector before it began to index a new campaign. Ask your operator whether this still applies. ## Export and import [Section titled “Export and import”](#export-and-import) You can export a campaign configuration as a JSON file and import it into another Altar instance. The `POST /admin/campaign/export` route returns the configuration, and the `POST /admin/campaign/import` route creates a campaign from it. # Onchain ID registry > The ownerless contract that can hand out deposit-address indices and store address-range commitments. A campaign picks one of two ways to hand out **deposit-address indices** when it is created. The choice is `incrementMode` and it cannot change later. | Mode | Who counts | | ---------- | --------------------------------------------------------------- | | `offchain` | The Altar server keeps a counter for each campaign and network. | | `onchain` | A contract called **ProjectIdRegistry** keeps the counter. | ## The registry contract [Section titled “The registry contract”](#the-registry-contract) `ProjectIdRegistry` is one contract for each chain. The deployment on PulseChain (chain 369) is at `0xb8781c9cd7b6f41e05c7b11d0e86b22909a1d6cd`. The trusted forwarder is the unmodified OpenZeppelin `ERC2771Forwarder` at `0x68f82bf601260731c7c33f3fa022121c45149365`. Both are verified on Sourcify with an exact match of the creation and the runtime bytecode (verified on 2026-06-16). The repository file `docs/registry-verification.md` holds the compiler settings, the constructor arguments, and the commands to reproduce the check. The registry has **no owner**. The contract stores counters and destination addresses as keys. It stores no deposit addresses. ### Rules of the contract [Section titled “Rules of the contract”](#rules-of-the-contract) * **Create a project.** Anyone can call `createProject(name, admin)`. The project key is `keccak256(abi.encode(creator, name))`. The creator address is part of the key, so nobody can claim another account’s name. * **Enable networks.** The project admin calls `enableNetwork` for each network. The first index on a network is 1. * **Register.** Anyone can get an index for a destination address. `registerSelf` registers the caller. `registerWithVoucher` takes a voucher that the destination signed, and anyone can submit it. The Altar server can relay a voucher and pay the gas (`POST /address/register-voucher`). You can also submit your own voucher. * **Assignments are permanent.** An address that has an index always gets the same index back. Nobody can change or remove an assignment, project admins included. * **Finalize.** The admin calls `finalize(start, end)` once. It records an advisory schedule and gives up the admin’s power to change counters: after it, the admin can no longer enable or disable networks. The schedule does not stop issuance. * **Publish anchors.** The admin can still call `publishAnchor(count, root)` after finalizing. It stores the Merkle root of the next contiguous range of deposit addresses. Anchors can be added. They cannot be changed or removed. The voucher message uses the typed data `RegisterVoucher(bytes32 projectKey, bytes32 networkKey, address destination, uint256 deadline)`. Its domain is the registry contract (name `ProjectIdRegistry`, version `1`), not the Altar domain. ### What the registry does not do [Section titled “What the registry does not do”](#what-the-registry-does-not-do) * It does not check deposits. Deposits are read from each chain by the collectors. * It does not hold or move funds. * Its `status` view (`Setup`, `Pending`, `Running`, `Ended`) is advisory and never blocks issuance. ## In the campaign configuration [Section titled “In the campaign configuration”](#in-the-campaign-configuration) An `onchain` campaign must set `registryAddress` (a valid EVM address) and `registryProjectKey` (the 32-byte key). An `offchain` campaign must leave both empty. Altar checks this before it creates the campaign. ## Published address ranges [Section titled “Published address ranges”](#published-address-ranges) For networks that derive one address per index, an admin can upload a range of addresses ahead of time and publish its Merkle root. Anyone can then read the root with `GET /{projectId}/address-sets` and ask for a proof with `GET /{projectId}/address-proof/...`. See [Verify it yourself](/participants/verify-it-yourself/). # API overview > Base URL, versioning, formats, limits, and where to find the machine-readable description of the Altar API. The Altar API is an HTTP API that returns JSON. Everything you see in the app comes from it. | | | | ---------------------------- | --------------------------------------------------------------- | | Base URL | `https://altar.fund/api/v1` | | Reference | [Routes you can try](/api/) and [Signed routes](/api/signed/) | | Machine-readable description | [`/openapi.json`](/openapi.json) (OpenAPI 3.1) | | Text for language models | [`/llms.txt`](/llms.txt) and [`/llms-full.txt`](/llms-full.txt) | ## The description is generated from the code [Section titled “The description is generated from the code”](#the-description-is-generated-from-the-code) The OpenAPI document is generated from the server’s route table and its Zod schemas every time these docs are built. A test compares the routes Express serves with the routes in the document. It fails when a route is missing from the document, or when the document lists a route the server no longer has. So the reference cannot silently drift from the server. ## Versioning [Section titled “Versioning”](#versioning) The version is part of the path: `/api/v1`. There is one version today. ## Authentication [Section titled “Authentication”](#authentication) Most read routes need no authentication. Routes that change data, and routes that read private data, need a **typed-data signature (EIP-712)** in the request. There are no API keys and no session tokens. Read [Authentication and signing](/developers/authentication-and-signing/). ## Requests and responses [Section titled “Requests and responses”](#requests-and-responses) * Send JSON with `content-type: application/json`. * **Large integers in a request** use an object: `{ "__type__": "bigint", "value": "123" }`. This applies to timestamps and chain identifiers inside signed bodies. * **Large numbers in a response** are decimal strings. Points, prices, and amounts are whole numbers scaled by a power of ten. Prices and points are scaled by 10^18. * **Errors** return an HTTP status and a body `{ "error": "message" }`. Common statuses: 400 (bad request), 401 (expired timestamp or bad signature), 403 (not allowed), 404 (not found), 409 (conflict), 429 (too many requests). * **Pagination.** List routes take `limit` (1 to 1000, default 100) and `offset` (default 0), and return the page information in the body. * **Points versions.** Routes that read points take an optional `version`. Without it, they use the latest version. See [Verify it yourself](/participants/verify-it-yourself/). ## Limits [Section titled “Limits”](#limits) I found these limits in the application code. Other layers in front of the API can add their own limits. | Limit | Value | | --------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `POST /stats/sacrifices` without an `address` | 5 requests per 10 seconds for each client address. The limit is held in the memory of the server process. | | `POST /address/register-voucher` | 5 requests per 10 seconds for each client address, and 3 per minute for each destination address. | | Request body size | 100 KB. The three address-pool upload routes allow 5 MB. | | Signature age | A signed timestamp must be at most 60 minutes old and at most 5 minutes in the future. | | Page size | 1000 rows. | ## Caching and cross-origin use [Section titled “Caching and cross-origin use”](#caching-and-cross-origin-use) * The API sends `Cache-Control: no-store` on its responses, except where a route sets its own. Published address-set artifacts are cached for one year, because they never change. * The server allows cross-origin requests from any origin unless an operator limits them with a list of allowed origins. ## Try it [Section titled “Try it”](#try-it) ```bash curl https://altar.fund/api/v1/health curl https://altar.fund/api/v1/projects ``` ## Using TypeScript? [Section titled “Using TypeScript?”](#using-typescript) The request and response schemas live in the `sacrifice-utils` package of the Altar repository. See [Using sacrifice-utils](/developers/using-sacrifice-utils/). # Authentication and signing > Every typed-data message the Altar API accepts, generated from the server code, with viem examples. Altar has no API keys and no session tokens. A route that needs to know who you are asks for a **typed-data signature (EIP-712)** made by your wallet. The server recovers your address from the signature and checks it. Every signed message carries a `timestamp`, so a signature expires. ## The rules [Section titled “The rules”](#the-rules) * **The timestamp is in milliseconds** since the Unix epoch. It must be at most 60 minutes old and at most 5 minutes in the future. Older signatures fail with HTTP 401. * **The domain is fixed.** All messages use the same domain, shown below. The chain identifier in it is only part of the signature domain. It does not depend on the chains a campaign tracks, and you do not need to switch your wallet network. * **Each message is bound to what it authorizes.** A login signature is bound to one campaign. An admin-read signature is bound to one campaign and one purpose. Each admin change signs its own typed data. A signature of one kind is not accepted for another. * **The request body repeats the data.** You send the `signature` and an `inputs` object. The server rebuilds the message from `inputs` (and from stored campaign data where needed) and checks the signature against it. * **Large integers** in a body use the form `{ "__type__": "bigint", "value": "123" }`. ## The kinds of signature [Section titled “The kinds of signature”](#the-kinds-of-signature) | Kind | Use | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `login` | Proves you own a points address in one campaign. The message includes the campaign identifier and the campaign short terms text, so the login of one campaign is no good in another. Used to read your private data and to list your addresses. | | `adminRead` | One signature per campaign that opens every admin **read** route of that campaign. Reads and writes use different typed data, so a leaked login never works on an admin route. | | `instanceLogin` | The same idea for instance admins. It binds no campaign. | | `addressGeneration` | Asks for your deposit address on one network. | | `referralSubmission` | Referrals. The message names the **action** (`submit` or `disconnect`), so a signature for one cannot be replayed for the other. | | `report` | A report about a deposit. | | Admin changes | `projectCreation`, `campaignImport`, `projectUpdate`, `networkManagement`, `tokenManagement`, `adminManagement`, `sacrificeMutation`, `reportToggle`, `addressPoolUpload`. Each signs exactly what it changes. | One more signature, `RegisterVoucher`, belongs to the onchain registry and uses the registry contract as its domain. See [Onchain ID registry](/creators/onchain-id-registry/). ## Every message [Section titled “Every message”](#every-message) This section is generated when the docs are built. It is read from the OpenAPI document, which is generated from the signers in `@provex/eip712-utils`. If the code changes a message, this section changes with it. All messages use this domain: ``` { "name": "ProveX", "version": "1", "chainId": 1, "verifyingContract": "0x0000000000000000000000000000000000000000" } ``` ### `projectCreation` (primary type `ProjectCreation`) | Field | Solidity type | | ----------------------------- | ------------- | | `projectId` | `string` | | `timestamp` | `uint256` | | `projectName` | `string` | | `projectDescription` | `string` | | `projectWebsite` | `string` | | `projectLogo` | `string` | | `projectTagline` | `string` | | `projectAccentColor` | `string` | | `projectAccentColorVariant` | `string` | | `projectBanner` | `string` | | `projectDisclaimerShort` | `string` | | `projectDisclaimerLong` | `string` | | `projectSocialLinks` | `string` | | `projectTags` | `string` | | `startTime` | `uint256` | | `inflectionTime` | `uint256` | | `endTime` | `uint256` | | `disabled` | `bool` | | `decayRateSingleStep` | `uint256` | | `decaySingleStepDelaySeconds` | `uint256` | | `volumeBonusRate` | `uint256` | | `usdToPointBaseRate` | `uint256` | | `volumeBonusCutoff` | `uint256` | | `flatBonusCutoff` | `uint256` | | `flatBonusRate` | `uint256` | | `referralRate` | `uint256` | | `countEarlySacrifices` | `bool` | | `useInflectionStepOne` | `bool` | | `priceValidFromTimestamp` | `string` | | `incrementMode` | `string` | | `registryAddress` | `string` | Used by: `POST /projects` ### `addressGeneration` (primary type `AddressGeneration`) | Field | Solidity type | | ------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `timestamp` | `uint256` | Used by: `POST /address` ### `login` (primary type `Validate`) | Field | Solidity type | | ------------ | ------------- | | `purpose` | `string` | | `projectId` | `string` | | `timestamp` | `uint256` | | `termsOfUse` | `string` | Used by: `POST /address/all` ### `referralSubmission` (primary type `ReferralSubmission`) | Field | Solidity type | | ----------------- | ------------- | | `projectId` | `string` | | `referrerAddress` | `string` | | `action` | `string` | | `timestamp` | `uint256` | Used by: `POST /referral`, `POST /referral/disconnect` ### `report` (primary type `Report`) | Field | Solidity type | | ----------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `blockHash` | `string` | | `tokenAddress` | `string` | | `transactionHash` | `string` | | `logIndex` | `uint32` | | `logType` | `string` | | `timestamp` | `uint256` | | `message` | `string` | Used by: `POST /reports` ### `adminRead` (primary type `AdminRead`) | Field | Solidity type | | ----------- | ------------- | | `purpose` | `string` | | `projectId` | `string` | | `timestamp` | `uint256` | Used by: `POST /admin/projects`, `POST /admin/project`, `POST /admin/campaign/export`, `POST /admin/latest-block`, `POST /admin/referrals`, `POST /admin/sacrifice-mutations`, `POST /admin/price-overrides`, `POST /admin/sacrifice-details`, `POST /admin/reports` ### `campaignImport` (primary type `CampaignImport`) | Field | Solidity type | | ----------- | ------------- | | `config` | `string` | | `timestamp` | `uint256` | Used by: `POST /admin/campaign/import` ### `networkManagement` (primary type `NetworkManagement`) | Field | Solidity type | | ------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `action` | `string` | | `timestamp` | `uint256` | | `rootAddress` | `string` | | `networkName` | `string` | | `lowestBlock` | `uint256` | | `lowerRange` | `uint256` | | `upperRange` | `uint256` | | `rpcUrls` | `string` | Used by: `POST /admin/network` ### `projectUpdate` (primary type `ProjectUpdate`) | Field | Solidity type | | ----------------------------- | ------------- | | `projectId` | `string` | | `timestamp` | `uint256` | | `projectName` | `string` | | `projectWebsite` | `string` | | `projectDescription` | `string` | | `projectLogo` | `string` | | `projectTagline` | `string` | | `projectAccentColor` | `string` | | `projectAccentColorVariant` | `string` | | `projectBanner` | `string` | | `projectDisclaimerShort` | `string` | | `projectDisclaimerLong` | `string` | | `projectSocialLinks` | `string` | | `projectTags` | `string` | | `startTime` | `uint256` | | `inflectionTime` | `uint256` | | `endTime` | `uint256` | | `decaySingleStepDelaySeconds` | `uint256` | | `volumeBonusCutoff` | `uint256` | | `flatBonusCutoff` | `uint256` | | `decayRateSingleStep` | `uint256` | | `usdToPointBaseRate` | `uint256` | | `flatBonusRate` | `uint256` | | `referralRate` | `uint256` | | `countEarlySacrifices` | `bool` | | `useInflectionStepOne` | `bool` | Used by: `POST /admin/project/update` ### `tokenManagement` (primary type `TokenManagement`) | Field | Solidity type | | -------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `action` | `string` | | `timestamp` | `uint256` | | `tokenAddress` | `string` | | `source` | `string` | | `market` | `string` | | `searchable` | `string` | Used by: `POST /admin/token` ### `adminManagement` (primary type `AdminManagement`) | Field | Solidity type | | ----------- | ------------- | | `projectId` | `string` | | `address` | `string` | | `action` | `string` | | `timestamp` | `uint256` | Used by: `POST /admin/admin` ### `sacrificeMutation` (primary type `SacrificeMutation`) | Field | Solidity type | | -------------------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `blockHash` | `string` | | `transactionHash` | `string` | | `tokenAddress` | `string` | | `logIndex` | `uint32` | | `logType` | `string` | | `action` | `string` | | `timestamp` | `uint256` | | `amount` | `string` | | `pointsDestinationAddress` | `string` | | `userAddressListIndex` | `string` | | `source` | `string` | | `market` | `string` | | `sacrificeTimestamp` | `string` | | `blockNumber` | `string` | | `blockStatus` | `string` | | `tokenSymbol` | `string` | | `tokenName` | `string` | | `tokenDecimals` | `string` | | `price` | `string` | | `reason` | `string` | Used by: `POST /admin/sacrifice-mutation/upsert` ### `reportToggle` (primary type `ReportToggle`) | Field | Solidity type | | ----------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `blockHash` | `string` | | `tokenAddress` | `string` | | `transactionHash` | `string` | | `logIndex` | `uint32` | | `logType` | `string` | | `signerAddress` | `string` | | `ignored` | `bool` | | `timestamp` | `uint256` | Used by: `POST /admin/report/toggle-ignored` ### `addressPoolUpload` (primary type `AddressPoolUpload`) | Field | Solidity type | | ------------- | ------------- | | `projectId` | `string` | | `networkType` | `string` | | `chainId` | `uint256` | | `rangeStart` | `uint256` | | `count` | `uint256` | | `merkleRoot` | `bytes32` | | `timestamp` | `uint256` | Used by: `POST /admin/address-pool/begin` ### `instanceLogin` (primary type `InstanceLogin`) | Field | Solidity type | | ----------- | ------------- | | `purpose` | `string` | | `timestamp` | `uint256` | Used by: `POST /admin/instance/whoami`, `POST /admin/instance/labels`, `POST /admin/instance/labels/add`, `POST /admin/instance/labels/remove`, `POST /admin/instance/activity`, `POST /admin/instance/campaigns`, `POST /admin/instance/identities`, `POST /admin/instance/cycle-status`, `GET /admin/instance/activity/stream` ## Examples with viem [Section titled “Examples with viem”](#examples-with-viem) The code below is the real file `src/lib/signing-examples.ts` of the docs package. Its tests run each example and check the result with the server-side signer objects. You only need [viem](https://viem.sh). In a browser, replace `account` with the wallet client of the user. signing-examples.ts ```ts /** * Signing examples shown on the "Authentication and signing" page. * * This file is the source of the code samples on that page (the page imports it as raw text), * and `signing-examples.test.ts` runs it. The tests check that each message recovers to the * signer with the real server-side signer objects, so a sample that drifts from the server * fails the build of the docs tests instead of misleading a reader. * * Only `viem` is needed to sign. Replace `account` with a wallet client in a browser. */ import type { Account, Hex } from 'viem' /** The domain every Altar typed-data message uses. */ export const ALTAR_DOMAIN = { name: 'ProveX', version: '1', chainId: 1, verifyingContract: '0x0000000000000000000000000000000000000000', } as const /** Send large integers to the API in this object form. */ export const toApiBigint = (value: bigint) => ({ __type__: 'bigint', value: value.toString() }) /** Timestamps are milliseconds since the Unix epoch. Signatures expire 60 minutes after this time. */ export const nowAsTimestamp = (): bigint => BigInt(Date.now()) /** The value the login message carries in its `purpose` field. */ export const LOGIN_PURPOSE = 'sacrifice_address_login' /** The value the admin-read message carries in its `purpose` field. */ export const ADMIN_READ_PURPOSE = 'altar_admin_read' /** * Sign in to one campaign. The login message is bound to the campaign: it includes the * campaign identifier and the campaign short terms text (`projectDisclaimerShort`, empty * when the campaign has none). The server rebuilds the same message to check it. */ export const signLogin = async (options: { account: Account projectId: string termsOfUse: string timestamp: bigint }): Promise => options.account.signTypedData!({ domain: ALTAR_DOMAIN, types: { Validate: [ { name: 'purpose', type: 'string' }, { name: 'projectId', type: 'string' }, { name: 'timestamp', type: 'uint256' }, { name: 'termsOfUse', type: 'string' }, ], }, primaryType: 'Validate', message: { purpose: LOGIN_PURPOSE, projectId: options.projectId, timestamp: options.timestamp, termsOfUse: options.termsOfUse, }, }) /** Request body for `POST /address/all` and other login-signed routes that take `projectId`. */ export const buildLoginRequestBody = (options: { signature: Hex; projectId: string; timestamp: bigint }) => ({ signature: options.signature, projectId: options.projectId, inputs: { timestamp: toApiBigint(options.timestamp) }, }) /** * One admin-read signature opens every admin READ route of one campaign. Reads and writes * use different typed data, so a login signature never works on an admin route. */ export const signAdminRead = async (options: { account: Account projectId: string timestamp: bigint }): Promise => options.account.signTypedData!({ domain: ALTAR_DOMAIN, types: { AdminRead: [ { name: 'purpose', type: 'string' }, { name: 'projectId', type: 'string' }, { name: 'timestamp', type: 'uint256' }, ], }, primaryType: 'AdminRead', message: { purpose: ADMIN_READ_PURPOSE, projectId: options.projectId, timestamp: options.timestamp, }, }) /** What a referral signature authorizes. The action is signed, so it cannot be swapped. */ export type ReferralAction = 'submit' | 'disconnect' /** * Sign a referral. `submit` links you to a referrer. `disconnect` ends the link. * A signature made for one action fails on the other route. */ export const signReferral = async (options: { account: Account projectId: string referrerAddress: string action: ReferralAction timestamp: bigint }): Promise => options.account.signTypedData!({ domain: ALTAR_DOMAIN, types: { ReferralSubmission: [ { name: 'projectId', type: 'string' }, { name: 'referrerAddress', type: 'string' }, { name: 'action', type: 'string' }, { name: 'timestamp', type: 'uint256' }, ], }, primaryType: 'ReferralSubmission', message: { projectId: options.projectId, // The server lowercases the referrer address before it checks the signature. // Sign the lowercase form, or the signature will not verify. referrerAddress: options.referrerAddress.toLowerCase(), action: options.action, timestamp: options.timestamp, }, }) /** Request body for `POST /referral` and `POST /referral/disconnect`. */ export const buildReferralRequestBody = (options: { signature: Hex projectId: string referrerAddress: string timestamp: bigint }) => ({ signature: options.signature, inputs: { projectId: options.projectId, referrerAddress: options.referrerAddress, timestamp: toApiBigint(options.timestamp), }, }) /** Sign the request for your deposit address on one network (`POST /address`). */ export const signAddressRequest = async (options: { account: Account projectId: string networkType: string chainId: bigint timestamp: bigint }): Promise => options.account.signTypedData!({ domain: ALTAR_DOMAIN, types: { AddressGeneration: [ { name: 'projectId', type: 'string' }, { name: 'networkType', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'timestamp', type: 'uint256' }, ], }, primaryType: 'AddressGeneration', message: { projectId: options.projectId, networkType: options.networkType, chainId: options.chainId, timestamp: options.timestamp, }, }) ``` ### Read your own addresses [Section titled “Read your own addresses”](#read-your-own-addresses) ```ts import { privateKeyToAccount } from 'viem/accounts' import { buildLoginRequestBody, nowAsTimestamp, signLogin } from './signing-examples' const account = privateKeyToAccount('0x...') // or a wallet client const projectId = 'provex' const timestamp = nowAsTimestamp() // termsOfUse is the campaign's projectDisclaimerShort from GET /projects ("" when it has none). const signature = await signLogin({ account, projectId, termsOfUse: '...', timestamp }) const response = await fetch('https://altar.fund/api/v1/address/all', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(buildLoginRequestBody({ signature, projectId, timestamp })), }) console.log(await response.json()) ``` ### Read as a campaign admin [Section titled “Read as a campaign admin”](#read-as-a-campaign-admin) ```ts import { signAdminRead } from './signing-examples' import { toApiBigint, nowAsTimestamp } from './signing-examples' const timestamp = nowAsTimestamp() const signature = await signAdminRead({ account, projectId: 'provex', timestamp }) // POST /admin/project, /admin/referrals, /admin/price-overrides, and the other admin reads const response = await fetch('https://altar.fund/api/v1/admin/project', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ signature, projectId: 'provex', inputs: { timestamp: toApiBigint(timestamp) } }), }) ``` ### Submit or end a referral [Section titled “Submit or end a referral”](#submit-or-end-a-referral) Sign the referrer address in lowercase. The server lowercases it before it checks the signature. ```ts import { buildReferralRequestBody, signReferral } from './signing-examples' const signature = await signReferral({ account, projectId: 'provex', referrerAddress, action: 'submit', timestamp }) await fetch('https://altar.fund/api/v1/referral', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(buildReferralRequestBody({ signature, projectId: 'provex', referrerAddress, timestamp })), }) // To end it: sign with action: 'disconnect' and POST to /referral/disconnect. ``` Referrals are recorded, but Altar does not award referral points at present. See [How points are calculated](/participants/how-points-are-calculated/). ### Other messages [Section titled “Other messages”](#other-messages) For every other kind, copy the types from the section above and pass them to `signTypedData` the same way. The [signed routes reference](/api/signed/) shows the body of each route. ## Errors you may see [Section titled “Errors you may see”](#errors-you-may-see) | Status | Meaning | | ------ | ------------------------------------------------------------------------------------------------------------------------------------ | | 400 | The body is malformed, or the signature or timestamp has the wrong format. | | 401 | The timestamp is too old, or the signature does not verify. A message built from the wrong campaign, kind, or terms text fails here. | | 403 | The signature is valid, but the signer holds no admin role. | # Data exports > The three exports of a campaign, their JSON shape, and their CSV columns. `GET /{projectId}/download` returns one of three exports. The route is public and needs no signature. Choose the export with the `type` query parameter. Add `version` to read an older points version. ```bash curl 'https://altar.fund/api/v1/provex/download?type=distribution' curl 'https://altar.fund/api/v1/provex/download?type=breakdown&version=2026-11-12T10' curl 'https://altar.fund/api/v1/provex/download?type=audit' ``` The response is **JSON**. The app turns the three exports into comma-separated values (CSV) files in your browser, and shows the download buttons to campaign admins. If you call the API yourself, you can build the same files from the JSON. | `type` | JSON response | App file name | | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- | | `distribution` (default) | `{ addresses: [{ address, points }], version, contentsHash }` | `distribution___.csv` | | `breakdown` | `{ pointBreakdown: [...], version, statistics }` | `breakdown__.csv` | | `audit` | `{ projectInfo, pointsVersion, generatedAt, networks, blocks, transactions, sacrifices, priceSources, supportedTokens, sacrificeMutations, priceOverrides, statistics }` | `audit__