npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@integraledger/lcp-kernel

v0.10.1

Published

ATR assembly and hashing — the smallest thing every other LCP package agrees on.

Downloads

168

Readme

@integraledger/lcp-kernel

ATR assembly and hashing — the smallest thing every other package agrees on.

An ATR (Agreed Terms Record) is one canonical JSON document naming the terms, the parties, and the commercial slots of a transaction. Its SHA-256 is the ATR hash: the fingerprint a settlement carries and a verifier recomputes.

Zero runtime dependencies, by design and by enforced rule. Everything downstream is free to depend on this; it depends on nothing.

npm install @integraledger/lcp-kernel

The base of the tree: no dependencies at all, and every other package here is built on it. The next layer up is @integraledger/lcp-binding-core, which adds the carrier codec and the rail port.

Use

import { assemble, hashAtr, isAtrHash } from "@integraledger/lcp-kernel";

const { atrFile, atrHash } = await assemble([
  { slot: "terms", ref: "lcp:sha256:0xaaaa…" },
  { slot: "id", value: "0x3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f" },
  { slot: "parties", value: { seller: "did:web:seller.example", buyer: "did:web:buyer.example" } },
]);

isAtrHash(atrHash);                  // true
await hashAtr(atrFile) === atrHash;  // true

A component carries exactly one of value (inline) or ref (an lcp:sha256: content reference). Both, or neither, is a typed refusal rather than a guess.

Why the bytes are hashed as handed

hashAtr hashes the exact bytes it is given. It does not re-assemble, re-order, or canonicalize them.

This is the opposite of the rule for a verification report, which is canonicalized with RFC 8785 — and conflating the two is the mistake worth naming. A report has many independent producers that must converge on identical bytes, so it needs a canonical form. An ATR has exactly one producer, and the received bytes are the fingerprint. Canonicalizing them at verification time would mean the verifier hashes something the payer never signed.

normalizeTerms is offered for authoring surfaces to stabilize a terms document before it is fingerprinted — CRLF to LF, trailing newlines collapsed to one, NFC. It never runs inside assemble.

Refusals are typed and loud

Every guard has its own reason, because "the record is malformed" is not an actionable message:

| Refusal | Cause | |---|---| | assemble/reserved-slot | lcp is engine-stamped, not a caller's component | | assemble/numeric-slot | Integer-like slot names reorder under JSON serialization | | assemble/duplicate-slot | The same slot supplied twice | | assemble/component-shape | Not exactly one of value | ref | | assemble/bad-ref | A ref that is not a well-formed lcp:sha256: reference |

The numeric-slot rule is subtler than it looks: JavaScript serializes integer-like keys first regardless of insertion order, so a slot named "1" would jump ahead of the engine-stamped lcp field and change the bytes. It is refused rather than silently reordered.

The assembled envelope is prototype-free, so a component named __proto__ becomes an ordinary key instead of vanishing from JSON.stringify and mutating a prototype on the way past.

Requirement ids

This package's source and its messages cite short ids — ATA-3, RCS-5, CMP-6 and their kin. They are not LCP clause numbers. LCP is cited by section (§8.3.1, §C.2); anything shaped XXX-n comes from Integra's functional specification of what a complete agent transaction requires, the fourteen families below. Nothing in this package's behaviour depends on them, and where an id and an LCP section disagree the section governs.

| | | | | |---|---|---|---| | IDN identity | ASP authority to spend | ATA authority to accept terms | TRM the terms record | | RCS recourse | PAY payment and settlement | WLD the transactional weld | OFR offer integrity | | FRC fraud, risk, and compliance | OPS commercial operations | DSC discovery and reputation | ORC orchestration | | CMP composition | PRS persistence and verification infrastructure | | |


Requires Node >= 24. Part of the Legal Context Protocol open layer — see the documentation and the package index. Apache-2.0.