@labacacia/nps-sdk 1.0.0-alpha.1 → 1.0.0-alpha.13

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.
Files changed (452) hide show
  1. package/CHANGELOG.cn.md +181 -0
  2. package/CHANGELOG.md +234 -0
  3. package/LICENSE +0 -0
  4. package/NOTICE +0 -0
  5. package/README.cn.md +163 -0
  6. package/README.md +16 -6
  7. package/dist/core/anchor-cache.d.ts +0 -0
  8. package/dist/core/anchor-cache.d.ts.map +0 -0
  9. package/dist/core/anchor-cache.js +0 -0
  10. package/dist/core/anchor-cache.js.map +0 -0
  11. package/dist/core/cache.d.ts +0 -0
  12. package/dist/core/cache.d.ts.map +0 -0
  13. package/dist/core/cache.js +0 -0
  14. package/dist/core/cache.js.map +0 -0
  15. package/dist/core/canonical-json.d.ts +0 -0
  16. package/dist/core/canonical-json.d.ts.map +0 -0
  17. package/dist/core/canonical-json.js +0 -0
  18. package/dist/core/canonical-json.js.map +0 -0
  19. package/dist/core/codec.d.ts +0 -0
  20. package/dist/core/codec.d.ts.map +0 -0
  21. package/dist/core/codec.js +0 -0
  22. package/dist/core/codec.js.map +0 -0
  23. package/dist/core/codecs/index.d.ts +0 -0
  24. package/dist/core/codecs/index.d.ts.map +0 -0
  25. package/dist/core/codecs/index.js +0 -0
  26. package/dist/core/codecs/index.js.map +0 -0
  27. package/dist/core/codecs/ncp-codec.d.ts +0 -0
  28. package/dist/core/codecs/ncp-codec.d.ts.map +0 -0
  29. package/dist/core/codecs/ncp-codec.js +0 -0
  30. package/dist/core/codecs/ncp-codec.js.map +0 -0
  31. package/dist/core/codecs/tier1-json-codec.d.ts +0 -0
  32. package/dist/core/codecs/tier1-json-codec.d.ts.map +0 -0
  33. package/dist/core/codecs/tier1-json-codec.js +0 -0
  34. package/dist/core/codecs/tier1-json-codec.js.map +0 -0
  35. package/dist/core/codecs/tier2-msgpack-codec.d.ts +0 -0
  36. package/dist/core/codecs/tier2-msgpack-codec.d.ts.map +0 -0
  37. package/dist/core/codecs/tier2-msgpack-codec.js +0 -0
  38. package/dist/core/codecs/tier2-msgpack-codec.js.map +0 -0
  39. package/dist/core/crypto-provider.d.ts +0 -0
  40. package/dist/core/crypto-provider.d.ts.map +0 -0
  41. package/dist/core/crypto-provider.js +0 -0
  42. package/dist/core/crypto-provider.js.map +0 -0
  43. package/dist/core/exceptions.d.ts +0 -0
  44. package/dist/core/exceptions.d.ts.map +0 -0
  45. package/dist/core/exceptions.js +0 -0
  46. package/dist/core/exceptions.js.map +0 -0
  47. package/dist/core/frame-header.d.ts +1 -0
  48. package/dist/core/frame-header.d.ts.map +1 -1
  49. package/dist/core/frame-header.js +1 -0
  50. package/dist/core/frame-header.js.map +1 -1
  51. package/dist/core/frame-registry.d.ts +0 -0
  52. package/dist/core/frame-registry.d.ts.map +1 -1
  53. package/dist/core/frame-registry.js +1 -0
  54. package/dist/core/frame-registry.js.map +1 -1
  55. package/dist/core/frames.d.ts +3 -0
  56. package/dist/core/frames.d.ts.map +1 -1
  57. package/dist/core/frames.js +3 -0
  58. package/dist/core/frames.js.map +1 -1
  59. package/dist/core/index.d.ts +6 -4
  60. package/dist/core/index.d.ts.map +1 -1
  61. package/dist/core/index.js +17 -5
  62. package/dist/core/index.js.map +1 -1
  63. package/dist/core/registry.d.ts +0 -0
  64. package/dist/core/registry.d.ts.map +0 -0
  65. package/dist/core/registry.js +0 -0
  66. package/dist/core/registry.js.map +0 -0
  67. package/dist/core/status-codes.d.ts +20 -0
  68. package/dist/core/status-codes.d.ts.map +1 -1
  69. package/dist/core/status-codes.js +51 -0
  70. package/dist/core/status-codes.js.map +1 -1
  71. package/dist/index.d.ts +1 -1
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/index.js.map +1 -1
  75. package/dist/ncp/frames/anchor-frame.d.ts +0 -0
  76. package/dist/ncp/frames/anchor-frame.d.ts.map +0 -0
  77. package/dist/ncp/frames/anchor-frame.js +0 -0
  78. package/dist/ncp/frames/anchor-frame.js.map +0 -0
  79. package/dist/ncp/frames/caps-frame.d.ts +0 -0
  80. package/dist/ncp/frames/caps-frame.d.ts.map +0 -0
  81. package/dist/ncp/frames/caps-frame.js +0 -0
  82. package/dist/ncp/frames/caps-frame.js.map +0 -0
  83. package/dist/ncp/frames/diff-frame.d.ts +0 -0
  84. package/dist/ncp/frames/diff-frame.d.ts.map +0 -0
  85. package/dist/ncp/frames/diff-frame.js +0 -0
  86. package/dist/ncp/frames/diff-frame.js.map +0 -0
  87. package/dist/ncp/frames/error-frame.d.ts +0 -0
  88. package/dist/ncp/frames/error-frame.d.ts.map +0 -0
  89. package/dist/ncp/frames/error-frame.js +0 -0
  90. package/dist/ncp/frames/error-frame.js.map +0 -0
  91. package/dist/ncp/frames/hello-frame.d.ts +0 -0
  92. package/dist/ncp/frames/hello-frame.d.ts.map +0 -0
  93. package/dist/ncp/frames/hello-frame.js +0 -0
  94. package/dist/ncp/frames/hello-frame.js.map +0 -0
  95. package/dist/ncp/frames/stream-frame.d.ts +0 -0
  96. package/dist/ncp/frames/stream-frame.d.ts.map +0 -0
  97. package/dist/ncp/frames/stream-frame.js +0 -0
  98. package/dist/ncp/frames/stream-frame.js.map +0 -0
  99. package/dist/ncp/frames.d.ts +25 -0
  100. package/dist/ncp/frames.d.ts.map +1 -1
  101. package/dist/ncp/frames.js +61 -0
  102. package/dist/ncp/frames.js.map +1 -1
  103. package/dist/ncp/handshake.d.ts +0 -0
  104. package/dist/ncp/handshake.d.ts.map +0 -0
  105. package/dist/ncp/handshake.js +0 -0
  106. package/dist/ncp/handshake.js.map +0 -0
  107. package/dist/ncp/index.d.ts +1 -0
  108. package/dist/ncp/index.d.ts.map +1 -1
  109. package/dist/ncp/index.js +1 -0
  110. package/dist/ncp/index.js.map +1 -1
  111. package/dist/ncp/ncp-error-codes.d.ts +5 -0
  112. package/dist/ncp/ncp-error-codes.d.ts.map +1 -1
  113. package/dist/ncp/ncp-error-codes.js +27 -0
  114. package/dist/ncp/ncp-error-codes.js.map +1 -1
  115. package/dist/ncp/ncp-patch-format.d.ts +0 -0
  116. package/dist/ncp/ncp-patch-format.d.ts.map +0 -0
  117. package/dist/ncp/ncp-patch-format.js +0 -0
  118. package/dist/ncp/ncp-patch-format.js.map +0 -0
  119. package/dist/ncp/preamble.d.ts +47 -0
  120. package/dist/ncp/preamble.d.ts.map +1 -0
  121. package/dist/ncp/preamble.js +74 -0
  122. package/dist/ncp/preamble.js.map +1 -0
  123. package/dist/ncp/registry.d.ts +0 -0
  124. package/dist/ncp/registry.d.ts.map +1 -1
  125. package/dist/ncp/registry.js +2 -1
  126. package/dist/ncp/registry.js.map +1 -1
  127. package/dist/ncp/stream-manager.d.ts +0 -0
  128. package/dist/ncp/stream-manager.d.ts.map +0 -0
  129. package/dist/ncp/stream-manager.js +0 -0
  130. package/dist/ncp/stream-manager.js.map +0 -0
  131. package/dist/ndp/dns-txt.d.ts +35 -0
  132. package/dist/ndp/dns-txt.d.ts.map +1 -0
  133. package/dist/ndp/dns-txt.js +67 -0
  134. package/dist/ndp/dns-txt.js.map +1 -0
  135. package/dist/ndp/frames.d.ts +34 -9
  136. package/dist/ndp/frames.d.ts.map +1 -1
  137. package/dist/ndp/frames.js +54 -15
  138. package/dist/ndp/frames.js.map +1 -1
  139. package/dist/ndp/index.d.ts +3 -0
  140. package/dist/ndp/index.d.ts.map +1 -1
  141. package/dist/ndp/index.js +3 -0
  142. package/dist/ndp/index.js.map +1 -1
  143. package/dist/ndp/ndp-error-codes.d.ts +25 -0
  144. package/dist/ndp/ndp-error-codes.d.ts.map +1 -0
  145. package/dist/ndp/ndp-error-codes.js +48 -0
  146. package/dist/ndp/ndp-error-codes.js.map +1 -0
  147. package/dist/ndp/ndp-registry.d.ts +2 -0
  148. package/dist/ndp/ndp-registry.d.ts.map +1 -1
  149. package/dist/ndp/ndp-registry.js +25 -0
  150. package/dist/ndp/ndp-registry.js.map +1 -1
  151. package/dist/ndp/registry.d.ts +0 -0
  152. package/dist/ndp/registry.d.ts.map +0 -0
  153. package/dist/ndp/registry.js +0 -0
  154. package/dist/ndp/registry.js.map +0 -0
  155. package/dist/ndp/security.d.ts +8 -0
  156. package/dist/ndp/security.d.ts.map +1 -0
  157. package/dist/ndp/security.js +9 -0
  158. package/dist/ndp/security.js.map +1 -0
  159. package/dist/ndp/validator.d.ts +0 -0
  160. package/dist/ndp/validator.d.ts.map +0 -0
  161. package/dist/ndp/validator.js +0 -0
  162. package/dist/ndp/validator.js.map +0 -0
  163. package/dist/nip/acme/client.d.ts +31 -0
  164. package/dist/nip/acme/client.d.ts.map +1 -0
  165. package/dist/nip/acme/client.js +136 -0
  166. package/dist/nip/acme/client.js.map +1 -0
  167. package/dist/nip/acme/index.d.ts +6 -0
  168. package/dist/nip/acme/index.d.ts.map +1 -0
  169. package/dist/nip/acme/index.js +8 -0
  170. package/dist/nip/acme/index.js.map +1 -0
  171. package/dist/nip/acme/jws.d.ts +31 -0
  172. package/dist/nip/acme/jws.d.ts.map +1 -0
  173. package/dist/nip/acme/jws.js +76 -0
  174. package/dist/nip/acme/jws.js.map +1 -0
  175. package/dist/nip/acme/messages.d.ts +71 -0
  176. package/dist/nip/acme/messages.d.ts.map +1 -0
  177. package/dist/nip/acme/messages.js +4 -0
  178. package/dist/nip/acme/messages.js.map +1 -0
  179. package/dist/nip/acme/server.d.ts +41 -0
  180. package/dist/nip/acme/server.d.ts.map +1 -0
  181. package/dist/nip/acme/server.js +458 -0
  182. package/dist/nip/acme/server.js.map +1 -0
  183. package/dist/nip/acme/wire.d.ts +19 -0
  184. package/dist/nip/acme/wire.d.ts.map +1 -0
  185. package/dist/nip/acme/wire.js +21 -0
  186. package/dist/nip/acme/wire.js.map +1 -0
  187. package/dist/nip/assurance-level.d.ts +19 -0
  188. package/dist/nip/assurance-level.d.ts.map +1 -0
  189. package/dist/nip/assurance-level.js +38 -0
  190. package/dist/nip/assurance-level.js.map +1 -0
  191. package/dist/nip/cert-format.d.ts +5 -0
  192. package/dist/nip/cert-format.d.ts.map +1 -0
  193. package/dist/nip/cert-format.js +6 -0
  194. package/dist/nip/cert-format.js.map +1 -0
  195. package/dist/nip/error-codes.d.ts +44 -0
  196. package/dist/nip/error-codes.d.ts.map +1 -0
  197. package/dist/nip/error-codes.js +97 -0
  198. package/dist/nip/error-codes.js.map +1 -0
  199. package/dist/nip/frames.d.ts +19 -1
  200. package/dist/nip/frames.d.ts.map +1 -1
  201. package/dist/nip/frames.js +39 -4
  202. package/dist/nip/frames.js.map +1 -1
  203. package/dist/nip/identity.d.ts +0 -0
  204. package/dist/nip/identity.d.ts.map +0 -0
  205. package/dist/nip/identity.js +0 -0
  206. package/dist/nip/identity.js.map +0 -0
  207. package/dist/nip/index.d.ts +7 -0
  208. package/dist/nip/index.d.ts.map +1 -1
  209. package/dist/nip/index.js +9 -0
  210. package/dist/nip/index.js.map +1 -1
  211. package/dist/nip/registry.d.ts +0 -0
  212. package/dist/nip/registry.d.ts.map +0 -0
  213. package/dist/nip/registry.js +0 -0
  214. package/dist/nip/registry.js.map +0 -0
  215. package/dist/nip/reputation-client.d.ts +116 -0
  216. package/dist/nip/reputation-client.d.ts.map +1 -0
  217. package/dist/nip/reputation-client.js +261 -0
  218. package/dist/nip/reputation-client.js.map +1 -0
  219. package/dist/nip/verifier.d.ts +23 -0
  220. package/dist/nip/verifier.d.ts.map +1 -0
  221. package/dist/nip/verifier.js +90 -0
  222. package/dist/nip/verifier.js.map +1 -0
  223. package/dist/nip/x509/builder.d.ts +35 -0
  224. package/dist/nip/x509/builder.d.ts.map +1 -0
  225. package/dist/nip/x509/builder.js +59 -0
  226. package/dist/nip/x509/builder.js.map +1 -0
  227. package/dist/nip/x509/index.d.ts +4 -0
  228. package/dist/nip/x509/index.d.ts.map +1 -0
  229. package/dist/nip/x509/index.js +6 -0
  230. package/dist/nip/x509/index.js.map +1 -0
  231. package/dist/nip/x509/oids.d.ts +16 -0
  232. package/dist/nip/x509/oids.d.ts.map +1 -0
  233. package/dist/nip/x509/oids.js +22 -0
  234. package/dist/nip/x509/oids.js.map +1 -0
  235. package/dist/nip/x509/verifier.d.ts +26 -0
  236. package/dist/nip/x509/verifier.d.ts.map +1 -0
  237. package/dist/nip/x509/verifier.js +171 -0
  238. package/dist/nip/x509/verifier.js.map +1 -0
  239. package/dist/nop/client.d.ts +0 -0
  240. package/dist/nop/client.d.ts.map +0 -0
  241. package/dist/nop/client.js +0 -0
  242. package/dist/nop/client.js.map +1 -1
  243. package/dist/nop/dag-validator.d.ts +15 -0
  244. package/dist/nop/dag-validator.d.ts.map +1 -0
  245. package/dist/nop/dag-validator.js +91 -0
  246. package/dist/nop/dag-validator.js.map +1 -0
  247. package/dist/nop/frames.d.ts +8 -3
  248. package/dist/nop/frames.d.ts.map +1 -1
  249. package/dist/nop/frames.js +21 -6
  250. package/dist/nop/frames.js.map +1 -1
  251. package/dist/nop/index.d.ts +3 -0
  252. package/dist/nop/index.d.ts.map +1 -1
  253. package/dist/nop/index.js +3 -0
  254. package/dist/nop/index.js.map +1 -1
  255. package/dist/nop/models.d.ts +13 -2
  256. package/dist/nop/models.d.ts.map +1 -1
  257. package/dist/nop/models.js +9 -0
  258. package/dist/nop/models.js.map +1 -1
  259. package/dist/nop/nop-error-codes.d.ts +31 -0
  260. package/dist/nop/nop-error-codes.d.ts.map +1 -0
  261. package/dist/nop/nop-error-codes.js +61 -0
  262. package/dist/nop/nop-error-codes.js.map +1 -0
  263. package/dist/nop/nop-types.d.ts +0 -0
  264. package/dist/nop/nop-types.d.ts.map +0 -0
  265. package/dist/nop/nop-types.js +0 -0
  266. package/dist/nop/nop-types.js.map +0 -0
  267. package/dist/nop/orchestrator.d.ts +66 -0
  268. package/dist/nop/orchestrator.d.ts.map +1 -0
  269. package/dist/nop/orchestrator.js +229 -0
  270. package/dist/nop/orchestrator.js.map +1 -0
  271. package/dist/nop/registry.d.ts +0 -0
  272. package/dist/nop/registry.d.ts.map +0 -0
  273. package/dist/nop/registry.js +0 -0
  274. package/dist/nop/registry.js.map +0 -0
  275. package/dist/nwp/anchor-client.d.ts +109 -0
  276. package/dist/nwp/anchor-client.d.ts.map +1 -0
  277. package/dist/nwp/anchor-client.js +279 -0
  278. package/dist/nwp/anchor-client.js.map +1 -0
  279. package/dist/nwp/anchor-server.d.ts +127 -0
  280. package/dist/nwp/anchor-server.d.ts.map +1 -0
  281. package/dist/nwp/anchor-server.js +649 -0
  282. package/dist/nwp/anchor-server.js.map +1 -0
  283. package/dist/nwp/bridge.d.ts +24 -0
  284. package/dist/nwp/bridge.d.ts.map +1 -0
  285. package/dist/nwp/bridge.js +26 -0
  286. package/dist/nwp/bridge.js.map +1 -0
  287. package/dist/nwp/cgn.d.ts +19 -0
  288. package/dist/nwp/cgn.d.ts.map +1 -0
  289. package/dist/nwp/cgn.js +29 -0
  290. package/dist/nwp/cgn.js.map +1 -0
  291. package/dist/nwp/client.d.ts +10 -3
  292. package/dist/nwp/client.d.ts.map +1 -1
  293. package/dist/nwp/client.js +58 -7
  294. package/dist/nwp/client.js.map +1 -1
  295. package/dist/nwp/frames.d.ts +56 -2
  296. package/dist/nwp/frames.d.ts.map +1 -1
  297. package/dist/nwp/frames.js +86 -4
  298. package/dist/nwp/frames.js.map +1 -1
  299. package/dist/nwp/http-headers.d.ts +24 -0
  300. package/dist/nwp/http-headers.d.ts.map +1 -0
  301. package/dist/nwp/http-headers.js +29 -0
  302. package/dist/nwp/http-headers.js.map +1 -0
  303. package/dist/nwp/index.d.ts +9 -0
  304. package/dist/nwp/index.d.ts.map +1 -1
  305. package/dist/nwp/index.js +9 -0
  306. package/dist/nwp/index.js.map +1 -1
  307. package/dist/nwp/manifest.d.ts +75 -0
  308. package/dist/nwp/manifest.d.ts.map +1 -0
  309. package/dist/nwp/manifest.js +5 -0
  310. package/dist/nwp/manifest.js.map +1 -0
  311. package/dist/nwp/memory-node-server.d.ts +70 -0
  312. package/dist/nwp/memory-node-server.d.ts.map +1 -0
  313. package/dist/nwp/memory-node-server.js +315 -0
  314. package/dist/nwp/memory-node-server.js.map +1 -0
  315. package/dist/nwp/nwp-error-codes.d.ts +48 -0
  316. package/dist/nwp/nwp-error-codes.d.ts.map +1 -0
  317. package/dist/nwp/nwp-error-codes.js +108 -0
  318. package/dist/nwp/nwp-error-codes.js.map +1 -0
  319. package/dist/nwp/registry.d.ts +0 -0
  320. package/dist/nwp/registry.d.ts.map +0 -0
  321. package/dist/nwp/registry.js +0 -0
  322. package/dist/nwp/registry.js.map +0 -0
  323. package/dist/nwp/reputation.d.ts +37 -0
  324. package/dist/nwp/reputation.d.ts.map +1 -0
  325. package/dist/nwp/reputation.js +118 -0
  326. package/dist/nwp/reputation.js.map +1 -0
  327. package/dist/setup.d.ts +0 -0
  328. package/dist/setup.d.ts.map +0 -0
  329. package/dist/setup.js +0 -0
  330. package/dist/setup.js.map +0 -0
  331. package/doc/nps-sdk.core.cn.md +321 -0
  332. package/doc/nps-sdk.core.md +326 -0
  333. package/doc/nps-sdk.ncp.cn.md +270 -0
  334. package/doc/nps-sdk.ncp.md +276 -0
  335. package/doc/nps-sdk.ndp.cn.md +267 -0
  336. package/doc/nps-sdk.ndp.md +273 -0
  337. package/doc/nps-sdk.nip.cn.md +265 -0
  338. package/doc/nps-sdk.nip.md +272 -0
  339. package/doc/nps-sdk.nop.cn.md +329 -0
  340. package/doc/nps-sdk.nop.md +332 -0
  341. package/doc/nps-sdk.nwp.cn.md +288 -0
  342. package/doc/nps-sdk.nwp.md +295 -0
  343. package/doc/overview.cn.md +149 -0
  344. package/doc/overview.md +153 -0
  345. package/package.json +33 -4
  346. package/CONTRIBUTING.md +0 -33
  347. package/dist/codec-CmHeovTV.d.cts +0 -120
  348. package/dist/codec-CmHeovTV.d.ts +0 -120
  349. package/dist/core/index.cjs +0 -371
  350. package/dist/core/index.cjs.map +0 -1
  351. package/dist/core/index.d.cts +0 -41
  352. package/dist/frames-B3qLdl_g.d.cts +0 -77
  353. package/dist/frames-Ff7-ZPUl.d.ts +0 -77
  354. package/dist/index.cjs +0 -1556
  355. package/dist/index.cjs.map +0 -1
  356. package/dist/index.d.cts +0 -21
  357. package/dist/ncp/index.cjs +0 -188
  358. package/dist/ncp/index.cjs.map +0 -1
  359. package/dist/ncp/index.d.cts +0 -6
  360. package/dist/ndp/index.cjs +0 -252
  361. package/dist/ndp/index.cjs.map +0 -1
  362. package/dist/ndp/index.d.cts +0 -86
  363. package/dist/nip/index.cjs +0 -214
  364. package/dist/nip/index.cjs.map +0 -1
  365. package/dist/nip/index.d.cts +0 -65
  366. package/dist/nop/index.cjs +0 -762
  367. package/dist/nop/index.cjs.map +0 -1
  368. package/dist/nop/index.d.cts +0 -155
  369. package/dist/nwp/index.cjs +0 -658
  370. package/dist/nwp/index.cjs.map +0 -1
  371. package/dist/nwp/index.d.cts +0 -65
  372. package/nip-ca-server/Dockerfile +0 -27
  373. package/nip-ca-server/README.md +0 -45
  374. package/nip-ca-server/db/001_init.sql +0 -25
  375. package/nip-ca-server/docker-compose.yml +0 -29
  376. package/nip-ca-server/package.json +0 -23
  377. package/nip-ca-server/src/ca.ts +0 -155
  378. package/nip-ca-server/src/db.ts +0 -104
  379. package/nip-ca-server/src/index.ts +0 -157
  380. package/nip-ca-server/tsconfig.json +0 -13
  381. package/src/core/anchor-cache.ts +0 -129
  382. package/src/core/cache.ts +0 -93
  383. package/src/core/canonical-json.ts +0 -50
  384. package/src/core/codec.ts +0 -158
  385. package/src/core/codecs/index.ts +0 -5
  386. package/src/core/codecs/ncp-codec.ts +0 -170
  387. package/src/core/codecs/tier1-json-codec.ts +0 -33
  388. package/src/core/codecs/tier2-msgpack-codec.ts +0 -30
  389. package/src/core/crypto-provider.ts +0 -47
  390. package/src/core/exceptions.ts +0 -57
  391. package/src/core/frame-header.ts +0 -282
  392. package/src/core/frame-registry.ts +0 -91
  393. package/src/core/frames.ts +0 -183
  394. package/src/core/index.ts +0 -10
  395. package/src/core/registry.ts +0 -28
  396. package/src/core/status-codes.ts +0 -46
  397. package/src/index.ts +0 -10
  398. package/src/ncp/frames/anchor-frame.ts +0 -87
  399. package/src/ncp/frames/caps-frame.ts +0 -59
  400. package/src/ncp/frames/diff-frame.ts +0 -69
  401. package/src/ncp/frames/error-frame.ts +0 -26
  402. package/src/ncp/frames/hello-frame.ts +0 -50
  403. package/src/ncp/frames/stream-frame.ts +0 -35
  404. package/src/ncp/frames.ts +0 -199
  405. package/src/ncp/handshake.ts +0 -95
  406. package/src/ncp/index.ts +0 -12
  407. package/src/ncp/ncp-error-codes.ts +0 -34
  408. package/src/ncp/ncp-patch-format.ts +0 -16
  409. package/src/ncp/registry.ts +0 -14
  410. package/src/ncp/stream-manager.ts +0 -212
  411. package/src/ndp/frames.ts +0 -124
  412. package/src/ndp/index.ts +0 -7
  413. package/src/ndp/ndp-registry.ts +0 -82
  414. package/src/ndp/registry.ts +0 -12
  415. package/src/ndp/validator.ts +0 -64
  416. package/src/nip/frames.ts +0 -106
  417. package/src/nip/identity.ts +0 -113
  418. package/src/nip/index.ts +0 -6
  419. package/src/nip/registry.ts +0 -12
  420. package/src/nop/client.ts +0 -103
  421. package/src/nop/frames.ts +0 -181
  422. package/src/nop/index.ts +0 -7
  423. package/src/nop/models.ts +0 -79
  424. package/src/nop/nop-types.ts +0 -208
  425. package/src/nop/registry.ts +0 -13
  426. package/src/nwp/client.ts +0 -114
  427. package/src/nwp/frames.ts +0 -116
  428. package/src/nwp/index.ts +0 -6
  429. package/src/nwp/registry.ts +0 -11
  430. package/src/setup.ts +0 -32
  431. package/tests/core/anchor-cache.test.ts +0 -242
  432. package/tests/core/codec.test.ts +0 -205
  433. package/tests/core/frame-registry.test.ts +0 -46
  434. package/tests/core.test.ts +0 -327
  435. package/tests/ncp/diff-binary-bitset.test.ts +0 -107
  436. package/tests/ncp/e2e-enc-reject.test.ts +0 -93
  437. package/tests/ncp/err-error-frame.test.ts +0 -152
  438. package/tests/ncp/frames.test.ts +0 -359
  439. package/tests/ncp/framing.test.ts +0 -233
  440. package/tests/ncp/hello-frame.test.ts +0 -122
  441. package/tests/ncp/inline-anchor.test.ts +0 -88
  442. package/tests/ncp/security.test.ts +0 -184
  443. package/tests/ncp/stream-window.test.ts +0 -167
  444. package/tests/ncp/stream.test.ts +0 -242
  445. package/tests/ncp/version-negotiation.test.ts +0 -123
  446. package/tests/ndp.test.ts +0 -271
  447. package/tests/nip.test.ts +0 -184
  448. package/tests/nop.test.ts +0 -344
  449. package/tests/nwp.test.ts +0 -237
  450. package/tsconfig.json +0 -20
  451. package/tsup.config.ts +0 -20
  452. package/vitest.config.ts +0 -10
@@ -0,0 +1,265 @@
1
+ [English Version](./nps-sdk.nip.md) | 中文版
2
+
3
+ # `@labacacia/nps-sdk/nip` — 类与方法参考
4
+
5
+ > 规范:[NPS-3 NIP v0.9](https://github.com/labacacia/NPS-Release/blob/main/spec/NPS-3-NIP.md)
6
+
7
+ NIP 是 NPS 的 TLS/PKI。本模块暴露三个身份帧
8
+ (`IdentFrame`、`TrustFrame`、`RevokeFrame`)、元数据接口,
9
+ 以及拥有 Ed25519 密钥对(可选 AES-256-GCM + PBKDF2-SHA256 密钥文件加密)的
10
+ `NipIdentity` 辅助类。
11
+
12
+ ---
13
+
14
+ ## 目录
15
+
16
+ - [`IdentMetadata`](#identmetadata)
17
+ - [`IdentFrame` (0x20)](#identframe-0x20)
18
+ - [`TrustFrame` (0x21)](#trustframe-0x21)
19
+ - [`RevokeFrame` (0x22)](#revokeframe-0x22)
20
+ - [`NipIdentity`](#nipidentity)
21
+ - [规范化 JSON 与签名格式](#规范化-json-与签名格式)
22
+ - [`NipErrorCodes`](#niperrorecodes)
23
+
24
+ ---
25
+
26
+ ## `IdentMetadata`
27
+
28
+ ```typescript
29
+ interface IdentMetadata {
30
+ issuer: string;
31
+ issuedAt: string;
32
+ expiresAt?: string;
33
+ capabilities?: readonly string[];
34
+ scopes?: readonly string[];
35
+ }
36
+ ```
37
+
38
+ 附在 `IdentFrame.metadata`。由 `unsignedDict()` 产生的签名 payload
39
+ **排除**此字段 —— 元数据是运行时可变的,不属于 agent 身份本身。
40
+
41
+ ---
42
+
43
+ ## `IdentFrame` (0x20)
44
+
45
+ Agent 身份证书。作为任何认证 session 的开场帧发送。
46
+
47
+ ```typescript
48
+ class IdentFrame {
49
+ readonly frameType: FrameType.IDENT;
50
+ readonly preferredTier: EncodingTier.MSGPACK;
51
+
52
+ constructor(
53
+ public readonly nid: string, // urn:nps:agent:{authority}:{name}
54
+ public readonly pubKey: string, // "ed25519:{hex}"
55
+ public readonly metadata: IdentMetadata,
56
+ public readonly signature: string, // "ed25519:{base64}"
57
+ );
58
+
59
+ unsignedDict(): Record<string, unknown>; // { nid, pub_key, metadata } — 签名 payload
60
+ toDict(): Record<string, unknown>; // unsignedDict + signature
61
+
62
+ static fromDict(data: Record<string, unknown>): IdentFrame;
63
+ }
64
+ ```
65
+
66
+ `unsignedDict()` 是规范签名 payload —— 它省略 `signature` 字段。
67
+ 与 `NipIdentity.sign()` 配对使用以产生自签名 `signature`。
68
+
69
+ ---
70
+
71
+ ## `TrustFrame` (0x21)
72
+
73
+ 跨 CA 信任证书。
74
+
75
+ ```typescript
76
+ class TrustFrame {
77
+ readonly frameType: FrameType.TRUST;
78
+ readonly preferredTier: EncodingTier.MSGPACK;
79
+
80
+ constructor(
81
+ public readonly issuerNid: string,
82
+ public readonly subjectNid: string,
83
+ public readonly scopes: readonly string[],
84
+ public readonly expiresAt: string, // ISO 8601 UTC
85
+ public readonly signature: string, // "ed25519:{base64}"
86
+ );
87
+
88
+ toDict(): Record<string, unknown>;
89
+ static fromDict(data: Record<string, unknown>): TrustFrame;
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## `RevokeFrame` (0x22)
96
+
97
+ 证书吊销。
98
+
99
+ ```typescript
100
+ class RevokeFrame {
101
+ readonly frameType: FrameType.REVOKE;
102
+ readonly preferredTier: EncodingTier.MSGPACK;
103
+
104
+ constructor(
105
+ public readonly nid: string,
106
+ public readonly reason?: string, // 如 "key_compromise"
107
+ public readonly revokedAt?: string, // ISO 8601 UTC
108
+ );
109
+
110
+ toDict(): Record<string, unknown>;
111
+ static fromDict(data: Record<string, unknown>): RevokeFrame;
112
+ }
113
+ ```
114
+
115
+ 由签发 CA 签名。验证者**必须**拒绝其 `nid` 被有效 `RevokeFrame` 覆盖的
116
+ 任何 `IdentFrame`。
117
+
118
+ ---
119
+
120
+ ## `NipIdentity`
121
+
122
+ Ed25519 密钥对管理器,可选加密密钥文件持久化。基于
123
+ `@noble/ed25519` + `node:crypto`。
124
+
125
+ ```typescript
126
+ class NipIdentity {
127
+ // 工厂
128
+ static generate(): NipIdentity;
129
+ static fromPrivateKey(privKey: Uint8Array): NipIdentity;
130
+ static load(path: string, passphrase: string): NipIdentity;
131
+
132
+ // 持久化
133
+ save(path: string, passphrase: string): void;
134
+
135
+ // 签名
136
+ sign(payload: Record<string, unknown>): string; // "ed25519:{base64}"
137
+ verify(payload: Record<string, unknown>, signature: string): boolean;
138
+
139
+ // 公钥访问
140
+ readonly pubKey: Uint8Array; // 32 字节
141
+ readonly pubKeyString: string; // "ed25519:{hex}"
142
+ }
143
+ ```
144
+
145
+ ### 密钥文件格式
146
+
147
+ `save` / `load` 写入一个版本化的 JSON 信封,包含:
148
+
149
+ ```
150
+ {
151
+ version: 1,
152
+ salt: hex(16 B),
153
+ iv: hex(12 B),
154
+ ciphertext: hex( AES-GCM(privateKey) || authTag(16 B) ),
155
+ pubKey: hex(32 B)
156
+ }
157
+ ```
158
+
159
+ 密钥派生:**PBKDF2-SHA256**,600 000 次迭代。
160
+ 加密:**AES-256-GCM** —— 16 字节认证 tag 追加到 `ciphertext` 字段内的
161
+ 密文后。
162
+
163
+ ### `generate()`
164
+
165
+ 生成新的 Ed25519 密钥对。不接触磁盘。
166
+
167
+ ### `fromPrivateKey(priv)`
168
+
169
+ 包装已有的 32 字节 Ed25519 私钥(派生匹配的公钥)。
170
+
171
+ ### `load(path, passphrase)`
172
+
173
+ 读取并解密先前保存的密钥文件。若 JSON 信封格式错误、auth tag
174
+ 无效,或 passphrase 错误,则抛异常。
175
+
176
+ ### `save(path, passphrase)`
177
+
178
+ 加密并写入密钥对到 `path`。文件已存在时被覆盖 —— 先备份。
179
+
180
+ ### `sign(payload)` / `verify(payload, signature)`
181
+
182
+ 规范化 `payload`(键排序、紧凑分隔符),运行 Ed25519,发出
183
+ `"ed25519:{base64}"`。`verify` 任何失败时返回 `false` —— 从不抛异常。
184
+
185
+ ---
186
+
187
+ ## 规范化 JSON 与签名格式
188
+
189
+ SDK 以如下方式规范化签名 payload:
190
+
191
+ ```js
192
+ JSON.stringify(payload, Object.keys(payload).sort());
193
+ ```
194
+
195
+ - 每一层键按字典序排序。
196
+ - `undefined` 键由 `JSON.stringify` 隐式丢弃。
197
+ - token 之间无空白。
198
+ - 输出 UTF-8 字节馈入 Ed25519 原语。
199
+
200
+ 对 `IdentFrame`,将 `unsignedDict()` 作为 payload —— 它已省略 `signature`。
201
+
202
+ ---
203
+
204
+ ## 端到端示例
205
+
206
+ ```typescript
207
+ import {
208
+ IdentFrame, IdentMetadata, NipIdentity,
209
+ } from "@labacacia/nps-sdk/nip";
210
+
211
+ // 1) 一次性:创建密钥对并持久化
212
+ const id = NipIdentity.generate();
213
+ id.save("./agent.key", "correct horse battery");
214
+
215
+ // 2) 构造并签名 IdentFrame
216
+ const meta: IdentMetadata = {
217
+ issuer: "urn:nps:ca:example.com:root",
218
+ issuedAt: new Date().toISOString(),
219
+ expiresAt: new Date(Date.now() + 30 * 86400_000).toISOString(),
220
+ capabilities: ["nwp:query", "nop:delegate"],
221
+ };
222
+
223
+ const unsigned = new IdentFrame(
224
+ "urn:nps:agent:example.com:agent-001",
225
+ id.pubKeyString,
226
+ meta,
227
+ "placeholder",
228
+ );
229
+
230
+ const signature = id.sign(unsigned.unsignedDict());
231
+ const signed = new IdentFrame(unsigned.nid, unsigned.pubKey, meta, signature);
232
+
233
+ // 3) 任何持有相同密钥对(或等价 pubKey)的一方均可验证
234
+ const ok = id.verify(signed.unsignedDict(), signed.signature);
235
+ // → true
236
+ ```
237
+
238
+ ---
239
+
240
+ ## `NipErrorCodes`
241
+
242
+ NIP wire 错误码字符串常量。从 `@labacacia/nps-sdk/nip` 导入。
243
+
244
+ ```typescript
245
+ import { NipErrorCodes } from "@labacacia/nps-sdk/nip";
246
+ ```
247
+
248
+ | 常量 | Wire 值 | 起始版本 |
249
+ |------|---------|----------|
250
+ | `NipErrorCodes.IDENT_SIG_INVALID` | `"NIP-IDENT-SIG-INVALID"` | alpha.4 |
251
+ | `NipErrorCodes.IDENT_NID_MISMATCH` | `"NIP-IDENT-NID-MISMATCH"` | alpha.4 |
252
+ | `NipErrorCodes.IDENT_EXPIRED` | `"NIP-IDENT-EXPIRED"` | alpha.4 |
253
+ | `NipErrorCodes.IDENT_REVOKED` | `"NIP-IDENT-REVOKED"` | alpha.4 |
254
+ | `NipErrorCodes.TRUST_CHAIN_BROKEN` | `"NIP-TRUST-CHAIN-BROKEN"` | alpha.4 |
255
+ | `NipErrorCodes.TRUST_SCOPE_VIOLATION` | `"NIP-TRUST-SCOPE-VIOLATION"` | alpha.4 |
256
+ | `NipErrorCodes.ACME_CHALLENGE_FAILED` | `"NIP-ACME-CHALLENGE-FAILED"` | alpha.4 |
257
+ | `NipErrorCodes.ACME_ORDER_EXPIRED` | `"NIP-ACME-ORDER-EXPIRED"` | alpha.4 |
258
+ | `NipErrorCodes.X509_CERT_INVALID` | `"NIP-X509-CERT-INVALID"` | alpha.4 |
259
+ | `NipErrorCodes.X509_CHAIN_UNTRUSTED` | `"NIP-X509-CHAIN-UNTRUSTED"` | alpha.4 |
260
+ | `NipErrorCodes.REPUTATION_LOG_UNREACHABLE` | `"NIP-REPUTATION-LOG-UNREACHABLE"` | alpha.4 |
261
+ | `NipErrorCodes.REPUTATION_GOSSIP_FORK` | `"NIP-REPUTATION-GOSSIP-FORK"` | **alpha.5** |
262
+ | `NipErrorCodes.REPUTATION_GOSSIP_SIG_INVALID` | `"NIP-REPUTATION-GOSSIP-SIG-INVALID"` | **alpha.5** |
263
+
264
+ `REPUTATION_GOSSIP_FORK`:跨节点 STH 一致性检查失败时返回。
265
+ `REPUTATION_GOSSIP_SIG_INVALID`:gossip 交换中对端 STH 签名验证失败时返回。
@@ -0,0 +1,272 @@
1
+ English | [中文版](./nps-sdk.nip.cn.md)
2
+
3
+ # `@labacacia/nps-sdk/nip` — Class and Method Reference
4
+
5
+ > Spec: [NPS-3 NIP v0.9](https://github.com/labacacia/NPS-Release/blob/main/spec/NPS-3-NIP.md)
6
+
7
+ NIP is the TLS/PKI of NPS. This module exposes the three identity frames
8
+ (`IdentFrame`, `TrustFrame`, `RevokeFrame`), the metadata interface, and
9
+ the `NipIdentity` helper that owns an Ed25519 keypair with optional
10
+ AES-256-GCM + PBKDF2-SHA256 key-file encryption.
11
+
12
+ ---
13
+
14
+ ## Table of contents
15
+
16
+ - [`IdentMetadata`](#identmetadata)
17
+ - [`IdentFrame` (0x20)](#identframe-0x20)
18
+ - [`TrustFrame` (0x21)](#trustframe-0x21)
19
+ - [`RevokeFrame` (0x22)](#revokeframe-0x22)
20
+ - [`NipIdentity`](#nipidentity)
21
+ - [Canonical JSON & signing format](#canonical-json--signing-format)
22
+ - [`NipErrorCodes`](#niperrorecodes)
23
+
24
+ ---
25
+
26
+ ## `IdentMetadata`
27
+
28
+ ```typescript
29
+ interface IdentMetadata {
30
+ issuer: string;
31
+ issuedAt: string;
32
+ expiresAt?: string;
33
+ capabilities?: readonly string[];
34
+ scopes?: readonly string[];
35
+ }
36
+ ```
37
+
38
+ Attached to `IdentFrame.metadata`. Excluded from the signed payload
39
+ produced by `unsignedDict()` — metadata is runtime-mutable and not part
40
+ of the agent's identity.
41
+
42
+ ---
43
+
44
+ ## `IdentFrame` (0x20)
45
+
46
+ Agent identity certificate. Sent as the opening frame on any
47
+ authenticated session.
48
+
49
+ ```typescript
50
+ class IdentFrame {
51
+ readonly frameType: FrameType.IDENT;
52
+ readonly preferredTier: EncodingTier.MSGPACK;
53
+
54
+ constructor(
55
+ public readonly nid: string, // urn:nps:agent:{authority}:{name}
56
+ public readonly pubKey: string, // "ed25519:{hex}"
57
+ public readonly metadata: IdentMetadata,
58
+ public readonly signature: string, // "ed25519:{base64}"
59
+ );
60
+
61
+ unsignedDict(): Record<string, unknown>; // { nid, pub_key, metadata } — signing payload
62
+ toDict(): Record<string, unknown>; // unsignedDict + signature
63
+
64
+ static fromDict(data: Record<string, unknown>): IdentFrame;
65
+ }
66
+ ```
67
+
68
+ `unsignedDict()` is the canonical signing payload — it omits the
69
+ `signature` field. Pair it with `NipIdentity.sign()` to produce the
70
+ self-signed `signature`.
71
+
72
+ ---
73
+
74
+ ## `TrustFrame` (0x21)
75
+
76
+ Inter-CA trust certificate.
77
+
78
+ ```typescript
79
+ class TrustFrame {
80
+ readonly frameType: FrameType.TRUST;
81
+ readonly preferredTier: EncodingTier.MSGPACK;
82
+
83
+ constructor(
84
+ public readonly issuerNid: string,
85
+ public readonly subjectNid: string,
86
+ public readonly scopes: readonly string[],
87
+ public readonly expiresAt: string, // ISO 8601 UTC
88
+ public readonly signature: string, // "ed25519:{base64}"
89
+ );
90
+
91
+ toDict(): Record<string, unknown>;
92
+ static fromDict(data: Record<string, unknown>): TrustFrame;
93
+ }
94
+ ```
95
+
96
+ ---
97
+
98
+ ## `RevokeFrame` (0x22)
99
+
100
+ Certificate revocation.
101
+
102
+ ```typescript
103
+ class RevokeFrame {
104
+ readonly frameType: FrameType.REVOKE;
105
+ readonly preferredTier: EncodingTier.MSGPACK;
106
+
107
+ constructor(
108
+ public readonly nid: string,
109
+ public readonly reason?: string, // e.g. "key_compromise"
110
+ public readonly revokedAt?: string, // ISO 8601 UTC
111
+ );
112
+
113
+ toDict(): Record<string, unknown>;
114
+ static fromDict(data: Record<string, unknown>): RevokeFrame;
115
+ }
116
+ ```
117
+
118
+ Signed by the issuing CA. Verifiers MUST refuse any `IdentFrame` whose
119
+ `nid` is covered by a valid `RevokeFrame`.
120
+
121
+ ---
122
+
123
+ ## `NipIdentity`
124
+
125
+ Ed25519 keypair manager with optional encrypted-keyfile persistence.
126
+ Built on `@noble/ed25519` + `node:crypto`.
127
+
128
+ ```typescript
129
+ class NipIdentity {
130
+ // Factory
131
+ static generate(): NipIdentity;
132
+ static fromPrivateKey(privKey: Uint8Array): NipIdentity;
133
+ static load(path: string, passphrase: string): NipIdentity;
134
+
135
+ // Persist
136
+ save(path: string, passphrase: string): void;
137
+
138
+ // Signing
139
+ sign(payload: Record<string, unknown>): string; // "ed25519:{base64}"
140
+ verify(payload: Record<string, unknown>, signature: string): boolean;
141
+
142
+ // Public key access
143
+ readonly pubKey: Uint8Array; // 32 bytes
144
+ readonly pubKeyString: string; // "ed25519:{hex}"
145
+ }
146
+ ```
147
+
148
+ ### Key-file format
149
+
150
+ `save` / `load` write a JSON envelope (versioned) containing:
151
+
152
+ ```
153
+ {
154
+ version: 1,
155
+ salt: hex(16 B),
156
+ iv: hex(12 B),
157
+ ciphertext: hex( AES-GCM(privateKey) || authTag(16 B) ),
158
+ pubKey: hex(32 B)
159
+ }
160
+ ```
161
+
162
+ Key derivation: **PBKDF2-SHA256**, 600 000 iterations.
163
+ Cipher: **AES-256-GCM** — the 16-byte auth tag is appended to the
164
+ ciphertext inside the `ciphertext` field.
165
+
166
+ ### `generate()`
167
+
168
+ Produces a fresh Ed25519 keypair. Does not touch disk.
169
+
170
+ ### `fromPrivateKey(priv)`
171
+
172
+ Wraps an existing 32-byte Ed25519 private key (derives the matching
173
+ public key).
174
+
175
+ ### `load(path, passphrase)`
176
+
177
+ Reads & decrypts a previously saved keyfile. Throws if the JSON envelope
178
+ is malformed, if the auth tag is invalid, or if the passphrase is wrong.
179
+
180
+ ### `save(path, passphrase)`
181
+
182
+ Encrypts and writes the keypair to `path`. The file is overwritten if it
183
+ exists — back up first.
184
+
185
+ ### `sign(payload)` / `verify(payload, signature)`
186
+
187
+ Canonicalises `payload` (sorted keys, compact separators), runs Ed25519,
188
+ and emits `"ed25519:{base64}"`. `verify` returns `false` on any failure —
189
+ it never throws.
190
+
191
+ ---
192
+
193
+ ## Canonical JSON & signing format
194
+
195
+ The SDK normalises signing payloads with:
196
+
197
+ ```js
198
+ JSON.stringify(payload, Object.keys(payload).sort());
199
+ ```
200
+
201
+ - Keys are sorted lexicographically at every level.
202
+ - `undefined` keys are dropped implicitly by `JSON.stringify`.
203
+ - No whitespace between tokens.
204
+ - Output UTF-8 bytes feed the Ed25519 primitive.
205
+
206
+ For `IdentFrame`, use `unsignedDict()` as the payload — it already omits
207
+ `signature`.
208
+
209
+ ---
210
+
211
+ ## End-to-end example
212
+
213
+ ```typescript
214
+ import {
215
+ IdentFrame, IdentMetadata, NipIdentity,
216
+ } from "@labacacia/nps-sdk/nip";
217
+
218
+ // 1) One-off: create a keypair and persist it
219
+ const id = NipIdentity.generate();
220
+ id.save("./agent.key", "correct horse battery");
221
+
222
+ // 2) Build & sign an IdentFrame
223
+ const meta: IdentMetadata = {
224
+ issuer: "urn:nps:ca:example.com:root",
225
+ issuedAt: new Date().toISOString(),
226
+ expiresAt: new Date(Date.now() + 30 * 86400_000).toISOString(),
227
+ capabilities: ["nwp:query", "nop:delegate"],
228
+ };
229
+
230
+ const unsigned = new IdentFrame(
231
+ "urn:nps:agent:example.com:agent-001",
232
+ id.pubKeyString,
233
+ meta,
234
+ "placeholder",
235
+ );
236
+
237
+ const signature = id.sign(unsigned.unsignedDict());
238
+ const signed = new IdentFrame(unsigned.nid, unsigned.pubKey, meta, signature);
239
+
240
+ // 3) Anyone with the same keypair (or equivalent pubKey) can verify
241
+ const ok = id.verify(signed.unsignedDict(), signed.signature);
242
+ // → true
243
+ ```
244
+
245
+ ---
246
+
247
+ ## `NipErrorCodes`
248
+
249
+ String constants for NIP wire error codes. Import from `@labacacia/nps-sdk/nip`.
250
+
251
+ ```typescript
252
+ import { NipErrorCodes } from "@labacacia/nps-sdk/nip";
253
+ ```
254
+
255
+ | Constant | Wire value | Since |
256
+ |----------|------------|-------|
257
+ | `NipErrorCodes.IDENT_SIG_INVALID` | `"NIP-IDENT-SIG-INVALID"` | alpha.4 |
258
+ | `NipErrorCodes.IDENT_NID_MISMATCH` | `"NIP-IDENT-NID-MISMATCH"` | alpha.4 |
259
+ | `NipErrorCodes.IDENT_EXPIRED` | `"NIP-IDENT-EXPIRED"` | alpha.4 |
260
+ | `NipErrorCodes.IDENT_REVOKED` | `"NIP-IDENT-REVOKED"` | alpha.4 |
261
+ | `NipErrorCodes.TRUST_CHAIN_BROKEN` | `"NIP-TRUST-CHAIN-BROKEN"` | alpha.4 |
262
+ | `NipErrorCodes.TRUST_SCOPE_VIOLATION` | `"NIP-TRUST-SCOPE-VIOLATION"` | alpha.4 |
263
+ | `NipErrorCodes.ACME_CHALLENGE_FAILED` | `"NIP-ACME-CHALLENGE-FAILED"` | alpha.4 |
264
+ | `NipErrorCodes.ACME_ORDER_EXPIRED` | `"NIP-ACME-ORDER-EXPIRED"` | alpha.4 |
265
+ | `NipErrorCodes.X509_CERT_INVALID` | `"NIP-X509-CERT-INVALID"` | alpha.4 |
266
+ | `NipErrorCodes.X509_CHAIN_UNTRUSTED` | `"NIP-X509-CHAIN-UNTRUSTED"` | alpha.4 |
267
+ | `NipErrorCodes.REPUTATION_LOG_UNREACHABLE` | `"NIP-REPUTATION-LOG-UNREACHABLE"` | alpha.4 |
268
+ | `NipErrorCodes.REPUTATION_GOSSIP_FORK` | `"NIP-REPUTATION-GOSSIP-FORK"` | **alpha.5** |
269
+ | `NipErrorCodes.REPUTATION_GOSSIP_SIG_INVALID` | `"NIP-REPUTATION-GOSSIP-SIG-INVALID"` | **alpha.5** |
270
+
271
+ `REPUTATION_GOSSIP_FORK` is returned when an STH consistency check fails across peers.
272
+ `REPUTATION_GOSSIP_SIG_INVALID` is returned when a peer STH signature fails verification during a gossip exchange.