AbsoluteJS

Onchain

@absolutejs/onchainv0.1.2alphaOn-chain

Earned, 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.

#Installation

BASH
bun add @absolutejs/onchain

#Capabilities

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.

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.

Principles (the whole point)

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.

Show 6 more

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.

Quick start (local adapter, no setup)

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.

Adapter contract

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.

Seed-is-asset provenance

Items are deterministic functions of a seed — tiny to store and re-derivable forever by anyone. The on-chain record is just the seed.

Soulbound by default

Tokens are non-transferable by default, so ownership is earned rather than bought — no market, no speculation.

Real, literal editions

edition() returns literal strings like "1 of 1" or "#3 of 50" — never a probability. maxSupply: 1 mints a genuine 1-of-1.

Un-forgeable attestations

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.

Gasless and walletless

Embedded wallets and paymaster-sponsored transactions mean users never touch crypto to earn or hold their items.

Zero-setup local adapter

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

What you can build

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.

Principles (the whole point)

The seed is the asset. Items are deterministic functions of a seed — tiny to store,

Quick start (local adapter, no setup)

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

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/onchain version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
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.
2
Adapter contract
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.

#Quick start (local adapter, no setup)

Partial snippet

Working example for Quick start (local adapter, no setup).

TS
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 earned

#Quick Start

Partial snippet

Claim an earned, soulbound 1-of-1 with the built-in local adapter — no chain, wallet or config required.

TS
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 earned

#Swap in a Real Chain

Partial snippet

Swap localAdapter for baseAdapter to mint for real on Base — the claim API is identical.

TS
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"

#Chain Adapters

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.

@absolutejs/onchain-basev0.0.3Base (L2) adapter: gasless, soulbound, seed-is-asset minting with un-forgeable attestations. Its Attester only signs when the earned fact (e.g. github:commit:owner/repo@sha) is verified against GitHub, so the app operator cannot conjure a token.
Alpha — local adapter is dev-only
Pre-0.1 alpha. The local adapter is for dev only: its Attester does not verify facts, so it is fakeable by design. Real integrity comes from a chain adapter (such as @absolutejs/onchain-base) whose Attester re-checks the fact before signing.
Provider-agnostic adapter kit
Custom chains, wallets and randomness sources implement the @absolutejs/onchain/adapter-kit contract: WalletProvider, Attester (the integrity gate), MintProvider (uniqueness + serials) and optionally RandomnessProvider (VRF for true 1-of-1 rolls).

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

18 symbols
createOnchainexportPermalink
TS
createOnchain
Exported from @absolutejs/onchain

Current package surface

What ships today

@absolutejs/onchainv0.1.2 · betaOn-chainnpmSource
4entry points33symbols

Import surface · click to copy