New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

@algovoi/delegation-ref

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algovoi/delegation-ref

Open, content-addressed delegation references for the AlgoVoi substrate (delegator + delegate + scope + integer-ms validity + prev_delegation_ref chain; tamper-evident cross-party authority; L1 frozen)

latest
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@algovoi/delegation-ref

Open, content-addressed delegation references for the AlgoVoi substrate. An agent delegates authority to another agent for a scope and a validity window; the delegationRef is the content hash of that delegation envelope, so any tamper (widening the scope, extending the expiry, swapping the delegate) changes the ref and is detectable offline. Delegations chain (A to B to C) via prev_delegation_ref, giving a tamper-evident delegation chain.

This is the inverse of an opaque delegation token (an arbitrary label that does not change when the delegation's content is altered). Additive over the frozen substrate (Apache-2.0); no new cryptography:

delegationRef = "sha256:" + SHA-256(JCS(RFC 8785)({
    delegate_id, delegator_id, not_after_ms, not_before_ms,
    prev_delegation_ref, scope }))

with integer-millisecond validity bounds. Byte-identical to the Python package algovoi-delegation-ref.

Install

npm install @algovoi/delegation-ref

Use

import { delegationRef, tamperDetected, verifyChain } from '@algovoi/delegation-ref';

const root = {
  delegator_id: 'did:web:org.example',
  delegate_id:  'did:web:agent-1.example',
  scope:        'payments:usdc:<=100',
  not_before_ms: 1716494400000,
  not_after_ms:  1716498000000,
  prev_delegation_ref: '',
};

const rootRef = delegationRef(root);            // "sha256:..."
tamperDetected(rootRef, { ...root, scope: 'payments:usdc:*' }); // true

// chain A to B to C: each link's prev_delegation_ref must equal the prior link's ref
const refs = verifyChain([root, next]);         // throws on a broken/forged link

Lite vs commercial

The lite tier is content-addressed, offline-recomputable, and unsigned. It proves a delegation envelope was not altered and that a delegation chain is internally linked. The cross-party scope-consistency proof (that the executed scope is a subset of the delegated scope at every hop of the chain, recomputable end to end) is the commercial AlgoVoi Orchestrator capability, available on request.

Adopters (pin then key)

Pin @algovoi/delegation-ref@0.1.0, keep the NOTICE, and anchor the canonical delegationRef construction. Send your import-by-hash evidence plus the NOTICE to chopmob@gmail.com for a free v0 verification key.

Specification

delegationRef is "sha256:" + SHA-256(JCS(RFC 8785)({delegate_id, delegator_id, not_after_ms, not_before_ms, prev_delegation_ref, scope})). Validity bounds are integer milliseconds; not_after_ms must exceed not_before_ms; prev_delegation_ref is "" (root) or a "sha256:"-prefixed 64-hex ref. A malformed bound (for example an RFC 3339 string) is rejected at validation, never minted into a clean-looking ref. Conformance vectors: conformance/delegation_ref_v1/vectors.json.

Keywords

jcs

FAQs

Package last updated on 25 Jun 2026

Related posts