xoonya 2.6.0 → 2.8.0
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/CROSS_RUNTIME_POSTURE.md +32 -2
- package/README.md +14 -1
- package/RELEASE_NOTES.md +25 -0
- package/SERVICE_CONTRACT.md +4 -0
- package/XNYA_CONFORMANCE_MARK.md +78 -0
- package/XNYA_REFERENCE_IMPLEMENTATIONS.md +157 -0
- package/XOONYA_NATIVE_PROOF_FORMAT.md +2 -0
- package/XOONYA_NATIVE_STANDARD_GOVERNANCE.md +4 -1
- package/bin/xoonya-release.js +19 -1
- package/bin/xoonya.js +1 -0
- package/lib/release_history.js +27 -0
- package/package.json +12 -2
- package/proof_sdk.js +605 -2
- package/reference/python/README.md +35 -0
- package/reference/python/requirements-optional.txt +1 -0
- package/reference/python/verify_vectors.py +209 -0
- package/reference/python/xnya_reference.py +810 -0
- package/reference/rust/Cargo.toml +11 -0
- package/reference/rust/README.md +28 -0
- package/reference/rust/src/lib.rs +87 -0
- package/scripts/registry_cli.js +157 -0
- package/scripts/verify_all.js +593 -0
- package/scripts/verify_examples.js +19 -0
- package/scripts/verify_external_proof_import_gate.js +84 -0
- package/scripts/verify_integrations.js +170 -0
- package/scripts/verify_native_hybrid_design_gate.js +108 -0
- package/scripts/verify_reference_promotion_gate.js +74 -0
- package/scripts/verify_reference_python.js +49 -0
- package/scripts/verify_reference_python_crypto.js +87 -0
- package/scripts/verify_reference_rust_scaffold.js +50 -0
- package/scripts/verify_release_candidate.js +106 -0
- package/scripts/verify_service.js +2849 -0
- package/scripts/verify_tooling.js +1251 -0
- package/scripts/verify_vectors.js +164 -0
- package/server.js +20 -0
- package/vectors/adversarial-vectors.json +27 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# XNYA Rust Candidate Scaffold
|
|
2
|
+
|
|
3
|
+
This directory is a source-only candidate scaffold for a future independent
|
|
4
|
+
Rust XNYA reference implementation.
|
|
5
|
+
|
|
6
|
+
It is not a full XNYA-compatible reference implementation yet. The JavaScript
|
|
7
|
+
package remains the canonical implementation, and the Python candidate remains
|
|
8
|
+
the only verified non-JavaScript scaffold today.
|
|
9
|
+
|
|
10
|
+
Current scope:
|
|
11
|
+
|
|
12
|
+
- fixed-size `XNYA` atom constants
|
|
13
|
+
- v1/v2 atom byte-length checks
|
|
14
|
+
- record-type checks
|
|
15
|
+
- deterministic atom parser error codes
|
|
16
|
+
|
|
17
|
+
Not claimed yet:
|
|
18
|
+
|
|
19
|
+
- SHA-256 or RIPEMD-160 verification parity
|
|
20
|
+
- XNYP payload-profile parity
|
|
21
|
+
- canonical-event or proof-bundle parity
|
|
22
|
+
- signature-suite validation
|
|
23
|
+
- adversarial vector parity
|
|
24
|
+
- `XNYA-compatible` conformance mark eligibility
|
|
25
|
+
|
|
26
|
+
Future promotion requires a real Rust toolchain check that compiles the crate
|
|
27
|
+
and passes every required positive and adversarial vector set independently.
|
|
28
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//! Source-only Rust candidate scaffold for XNYA atom parsing.
|
|
2
|
+
//!
|
|
3
|
+
//! This crate is intentionally not promoted as an independent XNYA-compatible
|
|
4
|
+
//! reference. It gives future Rust work a stable parser/error-code starting
|
|
5
|
+
//! point while vector parity, hashing, payload, proof-bundle, and signature
|
|
6
|
+
//! validation remain gated.
|
|
7
|
+
|
|
8
|
+
pub const XNYA_MAGIC: [u8; 4] = *b"XNYA";
|
|
9
|
+
pub const VERSION_V1: u8 = 0x01;
|
|
10
|
+
pub const VERSION_V2: u8 = 0x02;
|
|
11
|
+
pub const ATOM_V1_LEN: usize = 58;
|
|
12
|
+
pub const ATOM_V2_LEN: usize = 70;
|
|
13
|
+
|
|
14
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
15
|
+
pub enum XnyaError {
|
|
16
|
+
AtomBadMagic,
|
|
17
|
+
AtomUnsupportedLength,
|
|
18
|
+
AtomUnsupportedRecordType,
|
|
19
|
+
AtomVersionLengthMismatch,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
impl XnyaError {
|
|
23
|
+
pub fn code(&self) -> &'static str {
|
|
24
|
+
match self {
|
|
25
|
+
XnyaError::AtomBadMagic => "atom_bad_magic",
|
|
26
|
+
XnyaError::AtomUnsupportedLength => "atom_unsupported_length",
|
|
27
|
+
XnyaError::AtomUnsupportedRecordType => "atom_unsupported_record_type",
|
|
28
|
+
XnyaError::AtomVersionLengthMismatch => "atom_version_length_mismatch",
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
34
|
+
pub struct ParsedAtom<'a> {
|
|
35
|
+
pub version: u8,
|
|
36
|
+
pub record_type: u8,
|
|
37
|
+
pub identity_commitment: &'a [u8],
|
|
38
|
+
pub payload_hash_sha256: &'a [u8],
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pub fn parse_atom(bytes: &[u8]) -> Result<ParsedAtom<'_>, XnyaError> {
|
|
42
|
+
if bytes.len() != ATOM_V1_LEN && bytes.len() != ATOM_V2_LEN {
|
|
43
|
+
return Err(XnyaError::AtomUnsupportedLength);
|
|
44
|
+
}
|
|
45
|
+
if bytes[0..4] != XNYA_MAGIC {
|
|
46
|
+
return Err(XnyaError::AtomBadMagic);
|
|
47
|
+
}
|
|
48
|
+
let version = bytes[4];
|
|
49
|
+
let record_type = bytes[5];
|
|
50
|
+
if !matches!(record_type, 0x01 | 0x02 | 0x03) {
|
|
51
|
+
return Err(XnyaError::AtomUnsupportedRecordType);
|
|
52
|
+
}
|
|
53
|
+
let identity_len = match version {
|
|
54
|
+
VERSION_V1 if bytes.len() == ATOM_V1_LEN => 20,
|
|
55
|
+
VERSION_V2 if bytes.len() == ATOM_V2_LEN => 32,
|
|
56
|
+
VERSION_V1 | VERSION_V2 => return Err(XnyaError::AtomVersionLengthMismatch),
|
|
57
|
+
_ => return Err(XnyaError::AtomVersionLengthMismatch),
|
|
58
|
+
};
|
|
59
|
+
let identity_start = 6;
|
|
60
|
+
let identity_end = identity_start + identity_len;
|
|
61
|
+
let payload_end = identity_end + 32;
|
|
62
|
+
Ok(ParsedAtom {
|
|
63
|
+
version,
|
|
64
|
+
record_type,
|
|
65
|
+
identity_commitment: &bytes[identity_start..identity_end],
|
|
66
|
+
payload_hash_sha256: &bytes[identity_end..payload_end],
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#[cfg(test)]
|
|
71
|
+
mod tests {
|
|
72
|
+
use super::*;
|
|
73
|
+
|
|
74
|
+
#[test]
|
|
75
|
+
fn rejects_bad_length() {
|
|
76
|
+
assert_eq!(parse_atom(&[]).unwrap_err().code(), "atom_unsupported_length");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
#[test]
|
|
80
|
+
fn rejects_bad_magic() {
|
|
81
|
+
let mut atom = [0u8; ATOM_V1_LEN];
|
|
82
|
+
atom[4] = VERSION_V1;
|
|
83
|
+
atom[5] = 0x01;
|
|
84
|
+
assert_eq!(parse_atom(&atom).unwrap_err().code(), "atom_bad_magic");
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const {
|
|
6
|
+
exportIntegrationRegistrySnapshot,
|
|
7
|
+
summarizeIntegrationPromotionWorkflow,
|
|
8
|
+
summarizeIntegrationPromotionWorkflowList,
|
|
9
|
+
summarizeIntegrationPromotionReadiness,
|
|
10
|
+
validateIntegrationRegistration
|
|
11
|
+
} = require("../integrations/registry");
|
|
12
|
+
|
|
13
|
+
function readJson(filePath) {
|
|
14
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function writeJson(payload) {
|
|
18
|
+
process.stdout.write(`${JSON.stringify(payload, null, 2)}\n`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function resolveExampleRegistration(name) {
|
|
22
|
+
const filename = name === "verifier"
|
|
23
|
+
? "example-third-party-verifier-registration.record.json"
|
|
24
|
+
: "example-third-party-verifier-registration.record.json";
|
|
25
|
+
return path.resolve(__dirname, "..", "integrations", "examples", filename);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function resolveExampleDescriptor(name) {
|
|
29
|
+
const descriptorByExample = {
|
|
30
|
+
verifier: {
|
|
31
|
+
integration_id: "partner.verifier.lattice_notary",
|
|
32
|
+
integration_class: "verification_helper_adapter",
|
|
33
|
+
proof_scope: "profile_verification"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return descriptorByExample[name] || descriptorByExample.verifier;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function parseArgs(argv) {
|
|
40
|
+
const [command, ...rest] = argv;
|
|
41
|
+
const options = {};
|
|
42
|
+
for (let index = 0; index < rest.length; index += 1) {
|
|
43
|
+
const token = rest[index];
|
|
44
|
+
if (!token.startsWith("--")) continue;
|
|
45
|
+
const key = token.slice(2);
|
|
46
|
+
const next = rest[index + 1];
|
|
47
|
+
if (!next || next.startsWith("--")) {
|
|
48
|
+
options[key] = true;
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
options[key] = next;
|
|
52
|
+
index += 1;
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
command: command || "",
|
|
56
|
+
options
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function runValidateRegistration(options) {
|
|
61
|
+
const exampleName = options.example === "verifier" ? "verifier" : "verifier";
|
|
62
|
+
const filePath = options.file
|
|
63
|
+
? path.resolve(process.cwd(), options.file)
|
|
64
|
+
: resolveExampleRegistration(exampleName);
|
|
65
|
+
const registrationRecord = readJson(filePath);
|
|
66
|
+
const descriptor = resolveExampleDescriptor(exampleName);
|
|
67
|
+
const validation = validateIntegrationRegistration(descriptor, registrationRecord);
|
|
68
|
+
writeJson({
|
|
69
|
+
ok: validation.ok,
|
|
70
|
+
file: filePath,
|
|
71
|
+
descriptor,
|
|
72
|
+
errors: validation.errors
|
|
73
|
+
});
|
|
74
|
+
process.exitCode = validation.ok ? 0 : 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function runExportSnapshot(options) {
|
|
78
|
+
const filters = {
|
|
79
|
+
source: options.source || undefined,
|
|
80
|
+
certification_state: options.certification_state || undefined,
|
|
81
|
+
integration_maturity: options.integration_maturity || undefined,
|
|
82
|
+
registration_state: options.registration_state || undefined,
|
|
83
|
+
proof_scope: options.proof_scope || undefined,
|
|
84
|
+
bundled: options.bundled || undefined
|
|
85
|
+
};
|
|
86
|
+
const snapshot = exportIntegrationRegistrySnapshot(filters);
|
|
87
|
+
writeJson({
|
|
88
|
+
generated_by: "registry_cli",
|
|
89
|
+
filters: snapshot.filters,
|
|
90
|
+
snapshot
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function runPromotionReadiness(options) {
|
|
95
|
+
const integrationId = options.integration || "partner.verifier.lattice_notary";
|
|
96
|
+
writeJson({
|
|
97
|
+
integration_id: integrationId,
|
|
98
|
+
review: summarizeIntegrationPromotionReadiness(integrationId)
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function runPromotionWorkflow(options) {
|
|
103
|
+
const integrationId = options.integration || "partner.verifier.lattice_notary";
|
|
104
|
+
writeJson({
|
|
105
|
+
integration_id: integrationId,
|
|
106
|
+
review: summarizeIntegrationPromotionWorkflow(integrationId)
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function runPromotionWorkflowSummary(options) {
|
|
111
|
+
writeJson({
|
|
112
|
+
review: summarizeIntegrationPromotionWorkflowList({
|
|
113
|
+
source: options.source || undefined,
|
|
114
|
+
registration_state: options.registration_state || undefined,
|
|
115
|
+
proof_scope: options.proof_scope || undefined,
|
|
116
|
+
bundled: options.bundled || undefined
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function main() {
|
|
122
|
+
const { command, options } = parseArgs(process.argv.slice(2));
|
|
123
|
+
if (command === "validate-registration") {
|
|
124
|
+
runValidateRegistration(options);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (command === "export-snapshot") {
|
|
128
|
+
runExportSnapshot(options);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (command === "promotion-readiness") {
|
|
132
|
+
runPromotionReadiness(options);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (command === "promotion-workflow") {
|
|
136
|
+
runPromotionWorkflow(options);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (command === "promotion-workflow-summary") {
|
|
140
|
+
runPromotionWorkflowSummary(options);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
writeJson({
|
|
145
|
+
ok: false,
|
|
146
|
+
usage: [
|
|
147
|
+
"node scripts/registry_cli.js validate-registration [--file <path>] [--example verifier]",
|
|
148
|
+
"node scripts/registry_cli.js export-snapshot [--source <value>] [--registration_state <value>] [--proof_scope <value>]",
|
|
149
|
+
"node scripts/registry_cli.js promotion-readiness [--integration <integration_id>]",
|
|
150
|
+
"node scripts/registry_cli.js promotion-workflow [--integration <integration_id>]",
|
|
151
|
+
"node scripts/registry_cli.js promotion-workflow-summary [--source <value>] [--registration_state <value>] [--proof_scope <value>] [--bundled true|false]"
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
process.exitCode = 1;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
main();
|