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

iflow-protocol

v0.7.0

Published

iFlow transport contract: event/command envelopes, canonical serialization, signature ports, version negotiation.

Downloads

1,225

Readme

iflow-protocol

Transport contract for iFlow: how a fact travels between Agent runtimes without anyone reinterpreting it.

Pre-1.0. Not frozen. Shapes will change before 1.0 and changes may be breaking. Pin an exact version if you build against it.

npm i iflow-protocol

What it does

Carries IFlowEvent and IFlowCommand envelopes, serializes them deterministically, and defines the ports a host implements to sign and verify them. It has no dependencies and imports nothing from Node, so it runs wherever your runtime does.

import { canonicalJson, signEvent, verifyEvent, validateEvent } from 'iflow-protocol'

Schema v2 puts visibility: 'local' | 'public' inside the signed Event. Local is the default at the Edge; publishing later is a new signed fact, never a server-side edit of history. Schema v1 remains readable for journal migration.

The package also keeps three authority steps structurally distinct:

import type {
  EncryptedIntentEnvelope,       // Human -> own Agent
  ConversationMessageEnvelope,  // signing Agent -> remote Agent
  PrivateBrowserViewEnvelope,    // own Agent -> one browser view key
} from 'iflow-protocol'

The service between them routes opaque ciphertext. None of these types makes Community a conversation store or an Agent signer.

The canonical form rejects floats

Deterministic serialization means sorting object keys and emitting compact JSON — but serde_json writes 1.0 where JSON.stringify writes 1. Rather than pick a lossy rule, the envelope simply may not carry non-integer numbers:

canonicalJson({ cost: 1.5 })   // throws CanonicalizationError
canonicalJson({ costMicros: 1_500_000 })  // fine

Money and measurements travel as integer micro-units. A one-byte disagreement between two implementations would surface as network-wide signature failures nobody could localise, so it is refused at the source instead.

What a signature covers

signableBytes(event) is the envelope minus the fields a receiver may legitimately add — journalOffset and observedAt — and minus the signature itself. So an event verifies exactly as it was written, and keeps verifying after another node accepts and orders it.

Two-party facts

A price is not observed, it is agreed, and one party's signed claim proves nothing alone. Rather than widen the envelope to multi-signature, an agreement is an ordered pair of ordinary signed events: the acceptance embeds the offer's id and its exact signature.

import { countersignPayloadFor, verifyCountersignedPair } from 'iflow-protocol'

Neither half can be forged without the other party's key, and a third party can check the pair with nothing but the two events and the two DIDs.

License

Apache-2.0