Overview
Tasteful, optional on-chain provenance for AbsoluteJS apps. Let users earn gasless, seed-is-asset collectibles with real editions, immutable origin ownership, and auditable application-controlled sale, trade, gift, and recovery transfers.
@absolutejs/onchainv0.1.2alphaOn-chainEarned, gasless, soulbound collectibles with real editions — provenance that cannot be faked, even by the app operator.
Optional on-chain provenance for AbsoluteJS apps: users earn gasless, soulbound (non-transferable) collectibles with real, literal editions. Items are deterministic functions of a seed, so the on-chain record is just the seed, and every mint requires an Attestation bound to an externally verifiable fact — no real fact, no token, even for the app operator. The core is provider-agnostic and ships a working local adapter with zero setup; real chains live in @absolutejs/onchain-adapters.
bun add @absolutejs/onchainTasteful, optional on-chain provenance for AbsoluteJS apps. Let users earn gasless, seed-is-asset collectibles with real editions, immutable origin ownership, and auditable application-controlled sale, trade, gift, and recovery transfers.
Provider-agnostic: swap adapters for any chain/wallet/randomness. Ships a working local adapter so it runs with zero setup; real chains live in @absolutejs/onchain-adapters.
The seed is the asset. Items are deterministic functions of a seed — tiny to store,
re-derivable forever by anyone. The on-chain record is just the seed.
Earned origin never changes. originOwner and the mint event survive every transfer.
Transferability is explicit. Badges stay soulbound; market items opt in at mint.
Gasless + walletless. Users never touch crypto (embedded wallet + paymaster).
Real editions, literal numbers. edition() returns "1 of 1" or "#3 of 50" —
never a probability. (A "≈ 1 in N" generator preview is not ownership.)
Un-forgeable. A mint requires an Attestation bound to an externally verifiable
fact (e.g. a real GitHub commit). No fact, no token — the operator can't conjure one.
Marketable assets use soulbound: false. After the application's off-chain wallet settles atomically, it calls transfer() with an idempotent settlement reference. Public provenance contains ownership and settlement references—not card or identity data.
Swap localAdapter() for baseAdapter({...}) (@absolutejs/onchain-base) for real, gasless, soulbound mints on Base — same claim API.
Implement @absolutejs/onchain/adapter-kit: WalletProvider, Attester (the integrity gate — verify the fact, then sign), MintProvider (uniqueness + serials), and optionally RandomnessProvider (VRF for true 1-of-1 rolls). Market-capable mint providers also implement transfer and provenance. See @absolutejs/onchain-adapters.
The local adapter's Attester does not verify facts (it's fakeable, for dev only). Real integrity comes from a chain adapter whose Attester re-checks the fact.
Items are deterministic functions of a seed — tiny to store and re-derivable forever by anyone. The on-chain record is just the seed.
Tokens are non-transferable by default, so ownership is earned rather than bought — no market, no speculation.
edition() returns literal strings like "1 of 1" or "#3 of 50" — never a probability. maxSupply: 1 mints a genuine 1-of-1.
claim() only mints against an Attestation tied to an externally verifiable fact, such as a real GitHub commit. There is intentionally no mint-without-earning path.
Embedded wallets and paymaster-sponsored transactions mean users never touch crypto to earn or hold their items.
The built-in localAdapter is a complete in-memory (optionally file-backed) implementation, so the whole flow runs with zero setup before you wire a real chain.
Outcomes
Tasteful, optional on-chain provenance for AbsoluteJS apps. Let users earn gasless, seed-is-asset collectibles with real editions, immutable origin ownership, and auditable application-controlled sale, trade, gift, and recovery transfers.
The seed is the asset. Items are deterministic functions of a seed — tiny to store,
Marketable assets use soulbound: false. After the application's off-chain wallet settles atomically, it calls transfer() with an idempotent settlement reference. Public provenance contains ownership and settlement references—not card or identity data.
Hardening checklist
Follow in order
Working example for Quick start (local adapter, no setup).
import { createOnchain, edition, localAdapter } from "@absolutejs/onchain";
const onchain = createOnchain(localAdapter({ file: "~/.myapp/ledger.json" }));
// the ONLY path to ownership: earn → attest(verifiable fact) → mint(soulbound, real serial)
const token = await onchain.claim("user-id", {
seed: "wild:acme/app@abc123", // the deterministic asset
fact: "github:commit:acme/app@abc123", // the real interaction it's earned from
archetype: "wild-creature",
maxSupply: 1 // ⇒ a literal 1-of-1
});
edition(token); // "1 of 1"
await onchain.inventory("user-id"); // what they've earnedClaim an earned, soulbound 1-of-1 with the built-in local adapter — no chain, wallet or config required.
import { createOnchain, edition, localAdapter } from '@absolutejs/onchain';
const onchain = createOnchain(localAdapter({ file: '~/.myapp/ledger.json' }));
// the ONLY path to ownership:
// earn -> attest(verifiable fact) -> mint(soulbound, real serial)
const token = await onchain.claim('user-id', {
archetype: 'wild-creature',
fact: 'github:commit:acme/app@abc123', // the real interaction it's earned from
maxSupply: 1, // a literal 1-of-1
seed: 'wild:acme/app@abc123' // the deterministic asset
});
edition(token); // "1 of 1"
await onchain.inventory('user-id'); // what they've earnedSwap localAdapter for baseAdapter to mint for real on Base — the claim API is identical.
import { createOnchain, edition } from '@absolutejs/onchain';
import { baseAdapter } from '@absolutejs/onchain-base';
const onchain = createOnchain(
baseAdapter({
attesterPrivateKey: process.env.ATTESTER_KEY,
contract: process.env.SOULBOUND_CONTRACT,
githubToken: process.env.GITHUB_TOKEN,
paymasterUrl: process.env.PAYMASTER_URL,
rpcUrl: process.env.BASE_RPC_URL
})
);
// same claim API — now gasless, soulbound mints on Base,
// and the fact is verified against GitHub before attesting
const token = await onchain.claim('user-id', {
archetype: 'wild-creature',
fact: 'github:commit:acme/app@abc123',
maxSupply: 50,
seed: 'wild:acme/app@abc123'
});
edition(token); // "#3 of 50"Real chains plug into createOnchain by implementing the adapter contract from @absolutejs/onchain/adapter-kit: WalletProvider, Attester, MintProvider and optionally RandomnessProvider. The core ships a local adapter for dev; these adapters run the same claim API against a live network.
Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.
Current package surface
Import surface · click to copy