@fiderail/spec 0.0.0-stage → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +51 -2
- package/dist/index.d.ts +21 -0
- package/dist/index.js +126 -0
- package/dist/manifest.d.ts +111 -0
- package/dist/manifest.js +388 -0
- package/package.json +49 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FideRail Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fiderail/spec
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Single Source of Truth (SSOT) manifest, locked 4-chain x 2-stablecoin registry, CAIP-2 chain normalizers, address validators, and stablecoin amount converters for [FideRail](https://fiderail.com).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @fiderail/spec
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import {
|
|
15
|
+
FIDERAIL_MANIFEST,
|
|
16
|
+
normalizeChainName,
|
|
17
|
+
isValidAddress,
|
|
18
|
+
getPrimaryAsset,
|
|
19
|
+
rawAmountToDecimal,
|
|
20
|
+
} from "@fiderail/spec";
|
|
21
|
+
|
|
22
|
+
const chain = normalizeChainName("eip155:8453"); // "base"
|
|
23
|
+
const asset = getPrimaryAsset(chain!); // { symbol: "USDC", decimals: 6, ... }
|
|
24
|
+
const valid = isValidAddress("base", "0x7284d41b5b852f2bd4c99bdf95043d84452d299c");
|
|
25
|
+
const usdc = rawAmountToDecimal("50000", asset.decimals); // 0.05
|
|
26
|
+
|
|
27
|
+
console.log(FIDERAIL_MANIFEST.project.currentRelease, valid, usdc);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Key Exports
|
|
31
|
+
|
|
32
|
+
- **Manifest & Registries**: `FIDERAIL_MANIFEST`, `CHAIN_REGISTRY`, `ALL_CHAIN_KEYS`, `EVM_CHAIN_KEYS`, `VERIFIED_X402_CHANNELS`, `DEFAULT_EUR_USD_RATE`
|
|
33
|
+
- **Chain & Address Validation**: `normalizeChainName`, `normalizeChainAddress`, `isValidAddress`, `isEvmChain`, `isVerifiedX402Channels`
|
|
34
|
+
- **Asset Lookup**: `getChainSpec`, `getActiveChains`, `getPrimaryAsset`, `getPrimaryAssetContract`, `getAssetSpec`
|
|
35
|
+
- **Amount Conversion**: `rawAmountToDecimal`, `decimalToRawAmount`, `toUsdAmount`
|
|
36
|
+
|
|
37
|
+
Supported network boundary (4 chains x 2 stablecoins): Base (`USDC`, `EURC`), Solana (`USDC`, `USDT`), Arbitrum (`USDC`, `USDT0`), and Polygon (`USDC`, `USDT`).
|
|
38
|
+
|
|
39
|
+
## Runtime Requirements
|
|
40
|
+
|
|
41
|
+
Runtime-agnostic ESM with **zero dependencies** and **zero `node:*` imports**. Works in Node.js, Bun, Deno, Cloudflare Workers, and browsers.
|
|
42
|
+
|
|
43
|
+
## Links
|
|
44
|
+
|
|
45
|
+
- Portal: [https://fiderail.com](https://fiderail.com)
|
|
46
|
+
- Documentation: [https://fiderail.com/docs](https://fiderail.com/docs)
|
|
47
|
+
- Source (GitLab): [https://gitlab.com/fiderail/fiderail](https://gitlab.com/fiderail/fiderail)
|
|
48
|
+
- Mirror (GitHub): [https://github.com/fiderail/fiderail](https://github.com/fiderail/fiderail)
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
[MIT](./LICENSE)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FIDERAIL_MANIFEST, type AssetSymbol, type ChainKey, type ChainSpec, type ChainVm, type ConstitutionalRedLine, type FiatPeg, type FideRailManifest, type McpToolSpec, type RailStatus, type RestEndpointSpec, type StablecoinAssetSpec } from "./manifest.js";
|
|
2
|
+
export { FIDERAIL_MANIFEST, type AssetSymbol, type ChainKey, type ChainSpec, type ChainVm, type ConstitutionalRedLine, type FiatPeg, type FideRailManifest, type McpToolSpec, type RailStatus, type RestEndpointSpec, type StablecoinAssetSpec, };
|
|
3
|
+
export declare const ALL_CHAIN_KEYS: readonly ChainKey[];
|
|
4
|
+
export declare const EVM_CHAIN_KEYS: readonly ChainKey[];
|
|
5
|
+
export declare const DEFAULT_EUR_USD_RATE = 1.08;
|
|
6
|
+
export declare const CHAIN_REGISTRY: Readonly<Record<ChainKey, ChainSpec>>;
|
|
7
|
+
export declare const VERIFIED_X402_CHANNELS: ReadonlySet<string>;
|
|
8
|
+
export declare function isVerifiedX402Channels(channels?: readonly string[]): boolean;
|
|
9
|
+
export declare function normalizeChainName(chain: unknown): ChainKey | null;
|
|
10
|
+
export declare function isEvmChain(chain: ChainKey): boolean;
|
|
11
|
+
export declare function normalizeChainAddress(chain: ChainKey, address: unknown): string;
|
|
12
|
+
export declare function isValidAddress(chainInput: unknown, address: unknown): boolean;
|
|
13
|
+
export declare function getChainSpec(chain: ChainKey): ChainSpec;
|
|
14
|
+
export declare function getActiveChains(): readonly ChainSpec[];
|
|
15
|
+
export declare function getPrimaryAsset(chain: ChainKey): StablecoinAssetSpec;
|
|
16
|
+
export declare function getPrimaryAssetContract(chain: ChainKey): string;
|
|
17
|
+
export declare function getAssetSpec(chain: ChainKey, contractOrSymbol: string | null | undefined): StablecoinAssetSpec | null;
|
|
18
|
+
export declare function rawAmountToDecimal(amountRaw: bigint | string | number, decimals?: number): number;
|
|
19
|
+
export declare function decimalToRawAmount(amount: number | string, decimals?: number): string;
|
|
20
|
+
export declare function toUsdAmount(amountDecimal: number, fiatPeg?: FiatPeg, eurUsdRate?: number): number;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { FIDERAIL_MANIFEST, } from "./manifest.js";
|
|
2
|
+
export { FIDERAIL_MANIFEST, };
|
|
3
|
+
export const ALL_CHAIN_KEYS = Object.freeze([
|
|
4
|
+
"base",
|
|
5
|
+
"solana",
|
|
6
|
+
"arbitrum",
|
|
7
|
+
"polygon",
|
|
8
|
+
]);
|
|
9
|
+
export const EVM_CHAIN_KEYS = Object.freeze(["base", "arbitrum", "polygon"]);
|
|
10
|
+
export const DEFAULT_EUR_USD_RATE = 1.08;
|
|
11
|
+
const EVM_ADDR_RE = /^0x[0-9a-fA-F]{40}$/;
|
|
12
|
+
const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
|
|
13
|
+
export const CHAIN_REGISTRY = Object.freeze(Object.fromEntries(FIDERAIL_MANIFEST.networkBoundary.chains.map((c) => [c.key, c])));
|
|
14
|
+
export const VERIFIED_X402_CHANNELS = new Set([
|
|
15
|
+
"base_x402_permit2",
|
|
16
|
+
"base_x402_eip3009",
|
|
17
|
+
"solana_x402_payai",
|
|
18
|
+
"solana_x402_cdp",
|
|
19
|
+
"solana_x402_round1",
|
|
20
|
+
"arbitrum_x402_allowlist",
|
|
21
|
+
"arbitrum_x402_permit2",
|
|
22
|
+
"polygon_x402_allowlist",
|
|
23
|
+
"polygon_x402_permit2",
|
|
24
|
+
]);
|
|
25
|
+
export function isVerifiedX402Channels(channels = []) {
|
|
26
|
+
return Array.isArray(channels) && channels.some((ch) => VERIFIED_X402_CHANNELS.has(ch));
|
|
27
|
+
}
|
|
28
|
+
export function normalizeChainName(chain) {
|
|
29
|
+
if (!chain || typeof chain !== "string")
|
|
30
|
+
return null;
|
|
31
|
+
const c = chain.trim().toLowerCase();
|
|
32
|
+
if (c === "base" || c === "base-mainnet" || c === "eip155:8453" || c === "8453") {
|
|
33
|
+
return "base";
|
|
34
|
+
}
|
|
35
|
+
if (c === "solana" ||
|
|
36
|
+
c === "solana-mainnet" ||
|
|
37
|
+
c === "solana-mainnet-beta" ||
|
|
38
|
+
c === "sol" ||
|
|
39
|
+
c === "solana:5eykt4usfv8p8njdtrepy1vzqkqzkvdp") {
|
|
40
|
+
return "solana";
|
|
41
|
+
}
|
|
42
|
+
if (c === "arbitrum" ||
|
|
43
|
+
c === "arbitrum-one" ||
|
|
44
|
+
c === "arb" ||
|
|
45
|
+
c === "eip155:42161" ||
|
|
46
|
+
c === "42161") {
|
|
47
|
+
return "arbitrum";
|
|
48
|
+
}
|
|
49
|
+
if (c === "polygon" ||
|
|
50
|
+
c === "polygon-mainnet" ||
|
|
51
|
+
c === "polygon-pos" ||
|
|
52
|
+
c === "matic" ||
|
|
53
|
+
c === "eip155:137" ||
|
|
54
|
+
c === "137") {
|
|
55
|
+
return "polygon";
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
export function isEvmChain(chain) {
|
|
60
|
+
return CHAIN_REGISTRY[chain].vm === "evm";
|
|
61
|
+
}
|
|
62
|
+
export function normalizeChainAddress(chain, address) {
|
|
63
|
+
if (!address || typeof address !== "string")
|
|
64
|
+
return "";
|
|
65
|
+
const trimmed = address.trim();
|
|
66
|
+
return isEvmChain(chain) ? trimmed.toLowerCase() : trimmed;
|
|
67
|
+
}
|
|
68
|
+
export function isValidAddress(chainInput, address) {
|
|
69
|
+
const chain = normalizeChainName(chainInput);
|
|
70
|
+
if (!chain || !address || typeof address !== "string")
|
|
71
|
+
return false;
|
|
72
|
+
const trimmed = address.trim();
|
|
73
|
+
if (isEvmChain(chain))
|
|
74
|
+
return EVM_ADDR_RE.test(trimmed);
|
|
75
|
+
return SOL_ADDR_RE.test(trimmed);
|
|
76
|
+
}
|
|
77
|
+
export function getChainSpec(chain) {
|
|
78
|
+
return CHAIN_REGISTRY[chain];
|
|
79
|
+
}
|
|
80
|
+
export function getActiveChains() {
|
|
81
|
+
return FIDERAIL_MANIFEST.networkBoundary.chains.filter((c) => c.status === "ACTIVE");
|
|
82
|
+
}
|
|
83
|
+
export function getPrimaryAsset(chain) {
|
|
84
|
+
const spec = CHAIN_REGISTRY[chain];
|
|
85
|
+
return spec.assets.find((a) => a.isPrimaryDefault) || spec.assets[0];
|
|
86
|
+
}
|
|
87
|
+
export function getPrimaryAssetContract(chain) {
|
|
88
|
+
return getPrimaryAsset(chain).contract;
|
|
89
|
+
}
|
|
90
|
+
export function getAssetSpec(chain, contractOrSymbol) {
|
|
91
|
+
if (!contractOrSymbol || typeof contractOrSymbol !== "string")
|
|
92
|
+
return null;
|
|
93
|
+
const spec = CHAIN_REGISTRY[chain];
|
|
94
|
+
const raw = contractOrSymbol.trim();
|
|
95
|
+
const upper = raw.toUpperCase().replace("USD₮0", "USDT0");
|
|
96
|
+
const normContract = isEvmChain(chain) ? raw.toLowerCase() : raw;
|
|
97
|
+
for (const asset of spec.assets) {
|
|
98
|
+
if (asset.symbol === upper)
|
|
99
|
+
return asset;
|
|
100
|
+
const assetContract = isEvmChain(chain) ? asset.contract.toLowerCase() : asset.contract;
|
|
101
|
+
if (assetContract === normContract)
|
|
102
|
+
return asset;
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
export function rawAmountToDecimal(amountRaw, decimals = 6) {
|
|
107
|
+
const rawBig = typeof amountRaw === "bigint" ? amountRaw : BigInt(String(amountRaw || "0"));
|
|
108
|
+
if (rawBig <= 0n)
|
|
109
|
+
return 0;
|
|
110
|
+
const scale = 10 ** decimals;
|
|
111
|
+
return Number((Number(rawBig) / scale).toFixed(decimals));
|
|
112
|
+
}
|
|
113
|
+
export function decimalToRawAmount(amount, decimals = 6) {
|
|
114
|
+
const num = Number(amount);
|
|
115
|
+
if (!Number.isFinite(num) || num <= 0)
|
|
116
|
+
return "0";
|
|
117
|
+
const scaled = Math.round(num * 10 ** decimals);
|
|
118
|
+
return BigInt(scaled).toString();
|
|
119
|
+
}
|
|
120
|
+
export function toUsdAmount(amountDecimal, fiatPeg = "USD", eurUsdRate = DEFAULT_EUR_USD_RATE) {
|
|
121
|
+
if (!Number.isFinite(amountDecimal) || amountDecimal <= 0)
|
|
122
|
+
return 0;
|
|
123
|
+
const rate = fiatPeg === "EUR" ? eurUsdRate : 1;
|
|
124
|
+
return Number((amountDecimal * rate).toFixed(6));
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export type ChainKey = "base" | "solana" | "arbitrum" | "polygon";
|
|
2
|
+
export type AssetSymbol = "USDC" | "EURC" | "USDT" | "USDT0";
|
|
3
|
+
export type ChainVm = "evm" | "svm";
|
|
4
|
+
export type FiatPeg = "USD" | "EUR";
|
|
5
|
+
export type RailStatus = "ACTIVE" | "VALIDATING" | "PAUSED" | "DEPRECATED";
|
|
6
|
+
export interface StablecoinAssetSpec {
|
|
7
|
+
readonly symbol: AssetSymbol;
|
|
8
|
+
readonly contract: string;
|
|
9
|
+
readonly decimals: number;
|
|
10
|
+
readonly fiatPeg: FiatPeg;
|
|
11
|
+
readonly isPrimaryDefault: boolean;
|
|
12
|
+
readonly status: RailStatus;
|
|
13
|
+
}
|
|
14
|
+
export interface ChainSpec {
|
|
15
|
+
readonly key: ChainKey;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly caip2: string;
|
|
18
|
+
readonly vm: ChainVm;
|
|
19
|
+
readonly chainId: number | null;
|
|
20
|
+
readonly status: RailStatus;
|
|
21
|
+
readonly indexingMode: string;
|
|
22
|
+
readonly assets: readonly StablecoinAssetSpec[];
|
|
23
|
+
}
|
|
24
|
+
export interface ConstitutionalRedLine {
|
|
25
|
+
readonly id: string;
|
|
26
|
+
readonly title: string;
|
|
27
|
+
readonly rule: string;
|
|
28
|
+
}
|
|
29
|
+
export interface RestEndpointSpec {
|
|
30
|
+
readonly method: "GET" | "POST";
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly summary: string;
|
|
33
|
+
readonly status: "ACTIVE";
|
|
34
|
+
}
|
|
35
|
+
export interface McpToolSpec {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly status: "ACTIVE";
|
|
38
|
+
}
|
|
39
|
+
export interface FideRailManifest {
|
|
40
|
+
readonly schemaVersion: string;
|
|
41
|
+
readonly updatedAt: string;
|
|
42
|
+
readonly project: {
|
|
43
|
+
readonly name: string;
|
|
44
|
+
readonly packageName: string;
|
|
45
|
+
readonly currentRelease: string;
|
|
46
|
+
readonly tagline: string;
|
|
47
|
+
readonly website: string;
|
|
48
|
+
readonly apiBaseUrl: string;
|
|
49
|
+
readonly repository: string;
|
|
50
|
+
readonly repositoryMirror: string;
|
|
51
|
+
readonly repositories: {
|
|
52
|
+
readonly gitlab: string;
|
|
53
|
+
readonly github: string;
|
|
54
|
+
};
|
|
55
|
+
readonly license: string;
|
|
56
|
+
readonly contacts: {
|
|
57
|
+
readonly general: string;
|
|
58
|
+
readonly security: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly constitutionalRedLines: readonly ConstitutionalRedLine[];
|
|
62
|
+
readonly architecture: Record<string, unknown>;
|
|
63
|
+
readonly networkBoundary: {
|
|
64
|
+
readonly maxChains: 4;
|
|
65
|
+
readonly maxAssetsPerChain: 2;
|
|
66
|
+
readonly maxTotalAssets: 8;
|
|
67
|
+
readonly chains: readonly ChainSpec[];
|
|
68
|
+
};
|
|
69
|
+
readonly scoring: {
|
|
70
|
+
readonly activeModel: {
|
|
71
|
+
readonly version: string;
|
|
72
|
+
readonly pluggableIntelligenceLayer: boolean;
|
|
73
|
+
readonly halfLifeDays: number;
|
|
74
|
+
readonly maturityCaps: {
|
|
75
|
+
readonly under24hMaxScore: number;
|
|
76
|
+
readonly under3dMaxScore: number;
|
|
77
|
+
readonly under7dMaxScore: number;
|
|
78
|
+
};
|
|
79
|
+
readonly payerWeights: {
|
|
80
|
+
readonly crossEcosystemBuyer: number;
|
|
81
|
+
readonly isolatedSingleTargetPayer: number;
|
|
82
|
+
};
|
|
83
|
+
readonly positiveWeights: {
|
|
84
|
+
readonly uniquePayerDiversityMax: number;
|
|
85
|
+
readonly organicVolumeMax: number;
|
|
86
|
+
readonly activityMax: number;
|
|
87
|
+
readonly lowHhiDispersionMax: number;
|
|
88
|
+
};
|
|
89
|
+
readonly penalties: Record<string, {
|
|
90
|
+
readonly delta: number;
|
|
91
|
+
readonly scoreCap?: number;
|
|
92
|
+
readonly description: string;
|
|
93
|
+
}>;
|
|
94
|
+
};
|
|
95
|
+
readonly legacyBaseline: {
|
|
96
|
+
readonly version: string;
|
|
97
|
+
readonly preservedForAbComparison: boolean;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
readonly pricing: {
|
|
101
|
+
readonly openSourceSdk: string;
|
|
102
|
+
readonly publicBeta: string;
|
|
103
|
+
readonly meteredOracleUsdc: number;
|
|
104
|
+
readonly meteredEndpoint: string;
|
|
105
|
+
};
|
|
106
|
+
readonly restEndpoints: readonly RestEndpointSpec[];
|
|
107
|
+
readonly mcpTools: readonly McpToolSpec[];
|
|
108
|
+
readonly canonicalDocs: readonly string[];
|
|
109
|
+
}
|
|
110
|
+
export declare const FIDERAIL_MANIFEST: FideRailManifest;
|
|
111
|
+
//# sourceMappingURL=manifest.d.ts.map
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
export const FIDERAIL_MANIFEST = Object.freeze({
|
|
2
|
+
schemaVersion: "1.0.0",
|
|
3
|
+
updatedAt: "2026-12-03",
|
|
4
|
+
project: {
|
|
5
|
+
name: "FideRail",
|
|
6
|
+
packageName: "fiderail",
|
|
7
|
+
currentRelease: "2.3.1",
|
|
8
|
+
tagline: "Non-Custodial Payment Control Plane & Cryptographic Trust Infrastructure for AI Agents",
|
|
9
|
+
website: "https://fiderail.com",
|
|
10
|
+
apiBaseUrl: "https://api.fiderail.com",
|
|
11
|
+
repository: "https://gitlab.com/fiderail/fiderail",
|
|
12
|
+
repositoryMirror: "https://github.com/fiderail/fiderail",
|
|
13
|
+
repositories: {
|
|
14
|
+
gitlab: "https://gitlab.com/fiderail/fiderail",
|
|
15
|
+
github: "https://github.com/fiderail/fiderail",
|
|
16
|
+
},
|
|
17
|
+
license: "MIT",
|
|
18
|
+
contacts: {
|
|
19
|
+
general: "founder@fiderail.com",
|
|
20
|
+
security: "security@fiderail.com",
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
constitutionalRedLines: [
|
|
24
|
+
{
|
|
25
|
+
id: "ZERO_CUSTODY",
|
|
26
|
+
title: "Non-Custodial / Zero Fund Touch",
|
|
27
|
+
rule: "Never hold, custody, or access user private keys, session keys, or funds; never operate a centralized custodial payment facilitator, lending book, or underwriting pool.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "ZERO_TOKEN",
|
|
31
|
+
title: "No Platform Token",
|
|
32
|
+
rule: "Never issue a platform coin, utility token, or governance token; all pricing and settlement rely strictly on fiat-pegged stablecoins.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "ZERO_HUMAN_ARBITRATION",
|
|
36
|
+
title: "Zero Human Intervention & Arbitration",
|
|
37
|
+
rule: "Maintainers never act as subjective dispute arbitrators or manually override scores/blacklists; all enforcement, penalties, and verification are deterministic or cryptographically proven.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "CRYPTOGRAPHIC_VERIFIABILITY",
|
|
41
|
+
title: "Cryptographic Verifiability",
|
|
42
|
+
rule: "Verify delegated capability mandates, salted delivery receipts (fiderail-sar-v2), and per-epoch Merkle stateRoot commitments using deterministic canonical encoding (RFC 8785 JCS) and Ed25519 signatures.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "CODE_IS_LAW",
|
|
46
|
+
title: "Code Is Law",
|
|
47
|
+
rule: "Open-source deterministic policy execution, versioned model parameters with reproducible hashes (modelHash), cryptographically signed capability mandates, and tamper-evident receipts.",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "LOCKED_FOUR_CHAINS_EIGHT_STABLECOINS",
|
|
51
|
+
title: "Locked 4 Chains x 2 Stablecoins Boundary",
|
|
52
|
+
rule: "Fixed network and asset boundary of 4 chains (Base, Solana, Arbitrum, Polygon) and 2 fiat-pegged stablecoins per chain (8 assets total). Volatile assets and additional chains are excluded.",
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
architecture: {
|
|
56
|
+
controlPlaneModel: "HYBRID_C",
|
|
57
|
+
corePipeline: [
|
|
58
|
+
"PaymentIntent",
|
|
59
|
+
"AttenuatedMandateVerification",
|
|
60
|
+
"RiskAndIdentityEvaluation",
|
|
61
|
+
"DeterministicVerdictAndAttestation",
|
|
62
|
+
],
|
|
63
|
+
paymentAdapters: [
|
|
64
|
+
{
|
|
65
|
+
id: "x402",
|
|
66
|
+
status: "ACTIVE",
|
|
67
|
+
description: "HTTP 402 payment challenges, buyer Guard-and-Pay, seller middleware, and x402#2299 Trust-Provider hook",
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "mcp-pay",
|
|
71
|
+
status: "ACTIVE",
|
|
72
|
+
description: "Paid MCP tool execution guard and delegated mandate verification",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: "a2a",
|
|
76
|
+
status: "ACTIVE",
|
|
77
|
+
description: "Agent-to-Agent task payment intent and verifiable delivery envelope",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "session-key",
|
|
81
|
+
status: "ACTIVE",
|
|
82
|
+
description: "Smart-account / ERC-7715 / Solana delegated session key policy guard",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
delegationModel: {
|
|
86
|
+
name: "Attenuated Capability Delegation Chain",
|
|
87
|
+
modes: ["SPECIFIED", "BOUNDED"],
|
|
88
|
+
properties: [
|
|
89
|
+
"Offline cryptographic verification in microseconds",
|
|
90
|
+
"Strict monotonic attenuation (sub-agent child mandates can only narrow limits, never expand)",
|
|
91
|
+
"Lifecycle state machine: ACTIVE -> SUSPENDED | REVOKED | EXPIRED",
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
cryptographicPrimitives: {
|
|
95
|
+
canonicalEncoding: "RFC 8785 JCS",
|
|
96
|
+
saltedReceiptFormat: "fiderail-sar-v2 (min 128-bit salt + taskId + parentReceiptHash)",
|
|
97
|
+
trustSnapshotCommitment: "Ed25519-signed deterministic Merkle stateRoot per recomputation epoch",
|
|
98
|
+
proofTypes: ["ed25519", "eip712"],
|
|
99
|
+
deliveryVerificationTiers: [
|
|
100
|
+
"L0_UNVERIFIED",
|
|
101
|
+
"L1_LIVENESS_PROBE",
|
|
102
|
+
"L2_SIGNED_SAR_TELEMETRY",
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
runtimeAndStorage: {
|
|
106
|
+
currentRuntime: {
|
|
107
|
+
language: "Node.js >= 22.13 + TypeScript (strict Monorepo) + Python >= 3.9 thin SDK",
|
|
108
|
+
cloudDb: "PostgreSQL 16 (monthly partitioned payments, NUMERIC(78,0), lossless SQLite migrator) + SQLite WAL adapter for dev/CI",
|
|
109
|
+
edgeCoreRuntime: "Runtime-agnostic pure core (@fiderail/spec, @fiderail/zk-types, @fiderail/core — zero Node deps) + RemoteTrustClient with TTL cache & outage degradation",
|
|
110
|
+
clientSdks: "TypeScript SDK (@fiderail/core, @fiderail/guard, @fiderail/seller) + spec-synced zero-dependency Python SDK (sdks/python)",
|
|
111
|
+
edgeLedger: "Concurrent-safe embedded SQLite (node:sqlite / Python sqlite3) with atomic reservations, mandate spend tracking, and TTL risk cache",
|
|
112
|
+
mcpTransports: ["stdio", "streamable-http"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
networkBoundary: {
|
|
117
|
+
maxChains: 4,
|
|
118
|
+
maxAssetsPerChain: 2,
|
|
119
|
+
maxTotalAssets: 8,
|
|
120
|
+
chains: [
|
|
121
|
+
{
|
|
122
|
+
key: "base",
|
|
123
|
+
name: "Base",
|
|
124
|
+
caip2: "eip155:8453",
|
|
125
|
+
vm: "evm",
|
|
126
|
+
chainId: 8453,
|
|
127
|
+
status: "ACTIVE",
|
|
128
|
+
indexingMode: "permit2_and_eip3009_classified",
|
|
129
|
+
assets: [
|
|
130
|
+
{
|
|
131
|
+
symbol: "USDC",
|
|
132
|
+
contract: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
133
|
+
decimals: 6,
|
|
134
|
+
fiatPeg: "USD",
|
|
135
|
+
isPrimaryDefault: true,
|
|
136
|
+
status: "ACTIVE",
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
symbol: "EURC",
|
|
140
|
+
contract: "0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42",
|
|
141
|
+
decimals: 6,
|
|
142
|
+
fiatPeg: "EUR",
|
|
143
|
+
isPrimaryDefault: false,
|
|
144
|
+
status: "ACTIVE",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
key: "solana",
|
|
150
|
+
name: "Solana",
|
|
151
|
+
caip2: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
|
|
152
|
+
vm: "svm",
|
|
153
|
+
chainId: null,
|
|
154
|
+
status: "ACTIVE",
|
|
155
|
+
indexingMode: "facilitator_incremental",
|
|
156
|
+
assets: [
|
|
157
|
+
{
|
|
158
|
+
symbol: "USDC",
|
|
159
|
+
contract: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
|
|
160
|
+
decimals: 6,
|
|
161
|
+
fiatPeg: "USD",
|
|
162
|
+
isPrimaryDefault: true,
|
|
163
|
+
status: "ACTIVE",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
symbol: "USDT",
|
|
167
|
+
contract: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
|
|
168
|
+
decimals: 6,
|
|
169
|
+
fiatPeg: "USD",
|
|
170
|
+
isPrimaryDefault: false,
|
|
171
|
+
status: "ACTIVE",
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: "arbitrum",
|
|
177
|
+
name: "Arbitrum",
|
|
178
|
+
caip2: "eip155:42161",
|
|
179
|
+
vm: "evm",
|
|
180
|
+
chainId: 42161,
|
|
181
|
+
status: "ACTIVE",
|
|
182
|
+
indexingMode: "allowlisted_x402_only",
|
|
183
|
+
assets: [
|
|
184
|
+
{
|
|
185
|
+
symbol: "USDC",
|
|
186
|
+
contract: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
187
|
+
decimals: 6,
|
|
188
|
+
fiatPeg: "USD",
|
|
189
|
+
isPrimaryDefault: true,
|
|
190
|
+
status: "ACTIVE",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
symbol: "USDT0",
|
|
194
|
+
contract: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",
|
|
195
|
+
decimals: 6,
|
|
196
|
+
fiatPeg: "USD",
|
|
197
|
+
isPrimaryDefault: false,
|
|
198
|
+
status: "ACTIVE",
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
key: "polygon",
|
|
204
|
+
name: "Polygon",
|
|
205
|
+
caip2: "eip155:137",
|
|
206
|
+
vm: "evm",
|
|
207
|
+
chainId: 137,
|
|
208
|
+
status: "ACTIVE",
|
|
209
|
+
indexingMode: "allowlisted_x402_only",
|
|
210
|
+
assets: [
|
|
211
|
+
{
|
|
212
|
+
symbol: "USDC",
|
|
213
|
+
contract: "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
|
|
214
|
+
decimals: 6,
|
|
215
|
+
fiatPeg: "USD",
|
|
216
|
+
isPrimaryDefault: true,
|
|
217
|
+
status: "ACTIVE",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
symbol: "USDT",
|
|
221
|
+
contract: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
|
|
222
|
+
decimals: 6,
|
|
223
|
+
fiatPeg: "USD",
|
|
224
|
+
isPrimaryDefault: false,
|
|
225
|
+
status: "ACTIVE",
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
},
|
|
231
|
+
scoring: {
|
|
232
|
+
activeModel: {
|
|
233
|
+
version: "trust-v2",
|
|
234
|
+
pluggableIntelligenceLayer: true,
|
|
235
|
+
halfLifeDays: 14,
|
|
236
|
+
maturityCaps: {
|
|
237
|
+
under24hMaxScore: 65,
|
|
238
|
+
under3dMaxScore: 80,
|
|
239
|
+
under7dMaxScore: 90,
|
|
240
|
+
},
|
|
241
|
+
payerWeights: {
|
|
242
|
+
crossEcosystemBuyer: 1.0,
|
|
243
|
+
isolatedSingleTargetPayer: 0.2,
|
|
244
|
+
},
|
|
245
|
+
positiveWeights: {
|
|
246
|
+
uniquePayerDiversityMax: 40,
|
|
247
|
+
organicVolumeMax: 30,
|
|
248
|
+
activityMax: 20,
|
|
249
|
+
lowHhiDispersionMax: 10,
|
|
250
|
+
},
|
|
251
|
+
penalties: {
|
|
252
|
+
RECIPROCAL_LOOP: {
|
|
253
|
+
delta: -30,
|
|
254
|
+
description: "Self-transfers, 2-hop (A <-> B), or 3-hop (A -> B -> C -> A) directed wash cycles",
|
|
255
|
+
},
|
|
256
|
+
SINGLE_PAYER_CONCENTRATED: {
|
|
257
|
+
delta: -25,
|
|
258
|
+
description: "Max(txHhi, volumeHhi) or top-1 payer tx/volume share > 80% across >= 5 transactions",
|
|
259
|
+
},
|
|
260
|
+
ISOLATED_PAYER_FARM: {
|
|
261
|
+
delta: -25,
|
|
262
|
+
scoreCap: 65,
|
|
263
|
+
description: "High-volume payee (>= 10 unique payers, >= 15 txs) where > 95% of payers never paid any other counterparty",
|
|
264
|
+
},
|
|
265
|
+
BEHAVIOR_DRIFT: {
|
|
266
|
+
delta: -20,
|
|
267
|
+
description: "Sudden exit-scam / anomaly spike: recent ticket median >= 10x historical median and >= $10 USD",
|
|
268
|
+
},
|
|
269
|
+
MICRO_PING_ONLY: {
|
|
270
|
+
delta: -10,
|
|
271
|
+
description: "Median ticket < $0.005 USD",
|
|
272
|
+
},
|
|
273
|
+
NON_X402_WHALE_FLOW: {
|
|
274
|
+
delta: -35,
|
|
275
|
+
scoreCap: 65,
|
|
276
|
+
description: "Generic EIP-3009 wallet with median ticket > $100 USD and no verified x402 facilitator channel",
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
legacyBaseline: {
|
|
281
|
+
version: "trust-v1",
|
|
282
|
+
preservedForAbComparison: true,
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
pricing: {
|
|
286
|
+
openSourceSdk: "MIT open-source protocol, local deterministic Edge Guard SDK (@fiderail/core, @fiderail/guard, @fiderail/seller, sdks/python), and self-hostable MCP/API stack — free forever",
|
|
287
|
+
publicBeta: "Free best-effort public hosted node (x402Enforce: false, per-IP rate limits, no SLA) covering REST API, Streamable HTTP MCP, x402 Endpoint Grader, and Open Bazaar self-submission",
|
|
288
|
+
meteredOracleUsdc: 0.002,
|
|
289
|
+
meteredEndpoint: "/v1/trust/{chain}/{address}",
|
|
290
|
+
},
|
|
291
|
+
restEndpoints: [
|
|
292
|
+
{
|
|
293
|
+
method: "GET",
|
|
294
|
+
path: "/healthz",
|
|
295
|
+
summary: "Live indexer telemetry, dataset freshness, and L1/L2 health summary",
|
|
296
|
+
status: "ACTIVE",
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
method: "GET",
|
|
300
|
+
path: "/v1/trust/{chain}/{address}",
|
|
301
|
+
summary: "Anti-sybil credit score, confidence, dual HHI metrics, dataCoverage, associatedCredit, Bazaar services, and liveness",
|
|
302
|
+
status: "ACTIVE",
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
method: "GET",
|
|
306
|
+
path: "/v1/history/{chain}/{address}",
|
|
307
|
+
summary: "Delta trust score history, risk flag transitions, and latest Merkle stateRoot commitment",
|
|
308
|
+
status: "ACTIVE",
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
method: "GET",
|
|
312
|
+
path: "/v1/agents",
|
|
313
|
+
summary: "Paginated cross-chain credit leaderboard with channel, tier, and sort filters",
|
|
314
|
+
status: "ACTIVE",
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
method: "GET",
|
|
318
|
+
path: "/v1/services",
|
|
319
|
+
summary: "Search CDP Bazaar, PayAI, and Open Bazaar services enriched with trust and liveness",
|
|
320
|
+
status: "ACTIVE",
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
method: "POST",
|
|
324
|
+
path: "/v1/preflight",
|
|
325
|
+
summary: "Simulate pre-flight payment firewall check (ALLOW / WARN / BLOCK)",
|
|
326
|
+
status: "ACTIVE",
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
method: "POST",
|
|
330
|
+
path: "/v1/diagnose",
|
|
331
|
+
summary: "Zero-payment x402 endpoint diagnostic grader & Open Bazaar self-submission",
|
|
332
|
+
status: "ACTIVE",
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
method: "POST",
|
|
336
|
+
path: "/v1/trust-provider/before-settle",
|
|
337
|
+
summary: "x402#2299 Trust-Provider onBeforeSettle behavioral risk hook",
|
|
338
|
+
status: "ACTIVE",
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
method: "POST",
|
|
342
|
+
path: "/v1/telemetry/delivery",
|
|
343
|
+
summary: "Report anonymous L2 post-payment delivery telemetry (fiderail-sar-v2 verified & deduplicated)",
|
|
344
|
+
status: "ACTIVE",
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
method: "POST",
|
|
348
|
+
path: "/mcp",
|
|
349
|
+
summary: "Remote Streamable HTTP MCP (JSON-RPC 2.0) endpoint exposing all FideRail trust, pre-flight firewall, and diagnostic tools",
|
|
350
|
+
status: "ACTIVE",
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
method: "GET",
|
|
354
|
+
path: "/.well-known/fiderail-keys.json",
|
|
355
|
+
summary: "Public Ed25519 verification keys and canonical signing format for Merkle stateRoot commitments",
|
|
356
|
+
status: "ACTIVE",
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
method: "GET",
|
|
360
|
+
path: "/.well-known/fiderail-manifest.json",
|
|
361
|
+
summary: "Machine-readable Single Source of Truth (SSOT) manifest for FideRail v2.3.1",
|
|
362
|
+
status: "ACTIVE",
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
method: "GET",
|
|
366
|
+
path: "/reports/1m-audit",
|
|
367
|
+
summary: "Self-hosted stratified 1M+ On-Chain Agent Payments Audit Report (HTML/Markdown)",
|
|
368
|
+
status: "ACTIVE",
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
mcpTools: [
|
|
372
|
+
{ name: "check_agent_trust", status: "ACTIVE" },
|
|
373
|
+
{ name: "preflight_payment_guard", status: "ACTIVE" },
|
|
374
|
+
{ name: "list_audited_agents", status: "ACTIVE" },
|
|
375
|
+
{ name: "discover_trusted_services", status: "ACTIVE" },
|
|
376
|
+
{ name: "guarded_x402_fetch", status: "ACTIVE" },
|
|
377
|
+
{ name: "diagnose_x402_endpoint", status: "ACTIVE" },
|
|
378
|
+
],
|
|
379
|
+
canonicalDocs: [
|
|
380
|
+
"README.md",
|
|
381
|
+
"SECURITY.md",
|
|
382
|
+
"docs/01-scope-and-boundaries.md",
|
|
383
|
+
"docs/02-architecture.md",
|
|
384
|
+
"docs/03-trust-model.md",
|
|
385
|
+
"docs/04-operations.md",
|
|
386
|
+
],
|
|
387
|
+
});
|
|
388
|
+
//# sourceMappingURL=manifest.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fiderail/spec",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.3.1",
|
|
4
|
+
"description": "FideRail Single Source of Truth (SSOT) manifest, 4-chain x 2-stablecoin registry, CAIP-2 and address validators (runtime-agnostic, zero dependencies).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE",
|
|
17
|
+
"dist",
|
|
18
|
+
"!dist/**/*.map",
|
|
19
|
+
"!dist/**/*.tsbuildinfo"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepublishOnly": "tsc -b"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://fiderail.com",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://gitlab.com/fiderail/fiderail.git",
|
|
31
|
+
"directory": "packages/spec"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://gitlab.com/fiderail/fiderail/-/issues"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"fiderail",
|
|
38
|
+
"ai-agent",
|
|
39
|
+
"payment-control-plane",
|
|
40
|
+
"ssot",
|
|
41
|
+
"caip-2",
|
|
42
|
+
"x402",
|
|
43
|
+
"base",
|
|
44
|
+
"solana",
|
|
45
|
+
"arbitrum",
|
|
46
|
+
"polygon",
|
|
47
|
+
"usdc",
|
|
48
|
+
"stablecoin"
|
|
49
|
+
],
|
|
50
|
+
"license": "MIT"
|
|
51
|
+
}
|