@atlasauth/pca-verified-core

中文文档
0.4.3发布于 2026/10/28MITTypeScriptCommonJS近 30 天下载 3176

The decision logic of the PCA verifier (capability-chain walk and attenuation, threshold distinct-role count, replay guard, check/verdict combinator, suite and PQ-pin binding rules), written and machine-proved in Dafny and compiled to JavaScript.

原始使用文档

@atlasauth/pca-verified-core

The decision logic of the Proof-Carrying Authority (PCA) verifier, written in Dafny, machine-proved for all inputs (no bounds on chain length, share count or operation sequence), and compiled to JavaScript.

It does not do cryptography. You (the glue) evaluate signatures, hashes and parsing with your primitives and hand the results (booleans, small enums, integers, opaque messages, lazy pure closures) to this package, which decides:

areafunctionproved (see docs/pca/security/verified-core.md)
capability chaindecideChainorder + first failure, depth bound (16), append-only caveats (attenuation), soundness + completeness
thresholddecideThresholdone key per role / one role per key, count of distinct roles, ok iff count >= t, t in {1,2,3}
replay guardreplayPre, replayNonceStage, replayDecide, VerifiedReplayStoreModeldeny order, accept implies every precondition and store answer, nonce replay freedom, strictly increasing counters
check foldCoreState, VerdictState, enforceRequired, withDeniedFallbackallow iff no check failed, first reason wins, reasons append-only, required checks all pass
per-check rulesaudienceStatus, validityDecision, grantRefBoundStatus, counterStatus, suitePolicy, pqBinding, leafDecision, thresholdRule, reversibilityDecision, ...audience fail-closed, expiry/skew window, suite policy, F-2 PQ binding, F-1 hook-enforced t
import { decideChain, decideThreshold, CoreState, validityDecision } from '@atlasauth/pca-verified-core';

validityDecision(true, iat, exp, now); // 'pass' | 'expired' | 'future' | ...

No Dafny runtime type appears in the API. The generated JavaScript is committed in generated/pca_core.js; regenerate and re-verify with formal/dafny/build.sh, and check that the committed file is byte-identical to a fresh compile with formal/dafny/build.sh --check (script check:generated). Requires Dafny 4.11.0 (z3 4.12.1), run on a cloud box if not local.

The only runtime dependency is bignumber.js (Dafny's integer representation).

版本与发布记录

@atlasauth/pca-verified-core 共发布 5 个版本,首次发布于 2026/10/12;过去 12 个月发布了 5 个版本。

版本发布日期距今
0.4.3latest2026/10/2811 天前
0.4.22026/10/2612 天前
0.4.12026/10/1226 天前
0.4.02026/10/1226 天前
0.0.0-stage2026/10/1226 天前

关于 @atlasauth/pca-verified-core 的常见问题

@atlasauth/pca-verified-core 是什么?

The decision logic of the PCA verifier (capability-chain walk and attenuation, threshold distinct-role count, replay guard, check/verdict combinator, suite and PQ-pin binding rules), written and machine-proved in Dafny and compiled to JavaScript.

如何安装 @atlasauth/pca-verified-core?

在项目目录运行 npm install @atlasauth/pca-verified-core,或使用 pnpm add / yarn add / bun add。

@atlasauth/pca-verified-core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@atlasauth/pca-verified-core 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@atlasauth/pca-verified-core 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@atlasauth/pca-verified-core 可以商用吗?

@atlasauth/pca-verified-core 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@atlasauth/pca-verified-core 的下载量有多少?

根据 npm 官方下载统计,@atlasauth/pca-verified-core 在 2026/10/07 – 2026/11/05 这 30 天内被下载 3,176 次,日均约 106 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@atlasauth/pca-verified-core 还在维护吗?

最新版本 0.4.3 发布于 2026/10/28(11 天前);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/10/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。