@umarise/anchor
v1.1.4
Published
Umarise Core SDK. Hash-in, proof-out. Zero dependencies.
Downloads
848
Maintainers
Readme
@umarise/anchor
Anchor any file to Bitcoin with one API call. Hash-in, proof-out.
artifact → artifact.proofZero dependencies. Node.js 18+.
Install
npm install @umarise/anchorAnchor a file
import { UmariseCore, hashBytes } from '@umarise/anchor';
import { readFile } from 'fs/promises';
const core = new UmariseCore({ apiKey: process.env.UMARISE_API_KEY });
const bytes = await readFile('./release.tar.gz');
const hash = await hashBytes(bytes);
const origin = await core.attest(hash);
console.log(origin.origin_id); // doneVerify a file (no API key needed)
const core = new UmariseCore();
const bytes = await readFile('./release.tar.gz');
const hash = await hashBytes(bytes);
const result = await core.verify(hash);
if (result) {
console.log('Existed since:', result.captured_at);
}Verification is public. No account, no API key, no vendor dependency.
CLI
npx @umarise/cli anchor release.tar.gz
# → release.tar.gz.proofVerify offline:
npx @umarise/cli verify release.tar.gz.proof
# Hash Match ✓ | Bitcoin Block #881234 | 2026-03-05 | VALIDAPI
| Method | Auth | Description |
|---|---|---|
| health() | Public | API health check |
| resolve({ originId }) | Public | Lookup by origin ID |
| resolve({ hash }) | Public | Lookup by hash |
| verify(hash) | Public | Check if hash is anchored |
| proof(originId) | Public | Download .ots proof |
| attest(hash) | API Key | Create anchor |
hashBytes(data)
SHA-256 hash of a Buffer or Uint8Array. Bytes never leave your system.
import { hashBytes } from '@umarise/anchor';
const hash = await hashBytes(fileBuffer);
// "sha256:a1b2c3..."Error Handling
import { UmariseCoreError } from '@umarise/anchor';
try {
await core.attest(hash);
} catch (err) {
if (err instanceof UmariseCoreError) {
console.log(err.code); // 'RATE_LIMIT_EXCEEDED'
console.log(err.statusCode); // 429
}
}CI/CD
Use the GitHub Action for automated anchoring:
- uses: AnchoringTrust/anchor-action@v1
with:
file: build.tar.gz
env:
UMARISE_API_KEY: ${{ secrets.UMARISE_API_KEY }}Every build gets a .proof file. Verifiable offline, independent of Umarise.
Links
License
Unlicense (Public Domain)
