|
| 1 | +{ |
| 2 | + "groupId": "nip46-interop", |
| 3 | + "testedAt": "2026-05-28T12:30:00.000Z", |
| 4 | + "isolation": { |
| 5 | + "workingDirectory": "/Users/plebdev/Desktop/Work/code/frostr/igloo/igloo-server", |
| 6 | + "testRunner": "bun", |
| 7 | + "testFile": "tests/routes/nip46.spec.ts", |
| 8 | + "testNamePattern": "nip44", |
| 9 | + "serverRequired": false |
| 10 | + }, |
| 11 | + "toolsUsed": ["bun test"], |
| 12 | + "assertions": [ |
| 13 | + { |
| 14 | + "id": "VAL-NIP46-001", |
| 15 | + "title": "nip44_encrypt produces ciphertext decryptable by a standards-compliant external peer", |
| 16 | + "status": "pass", |
| 17 | + "steps": [ |
| 18 | + { |
| 19 | + "action": "Run bun test tests/routes/nip46.spec.ts --test-name-pattern 'nip44'", |
| 20 | + "expected": "Test 'nip44_encrypt produces ciphertext decryptable by a standards-compliant external peer' passes", |
| 21 | + "observed": "Test passed in 48.10ms" |
| 22 | + }, |
| 23 | + { |
| 24 | + "action": "Verify ciphertext produced by Nip46Service.handleNip44Encrypt can be decrypted by nostr-tools nip44.decrypt using standards-compliant conversation key", |
| 25 | + "expected": "Decrypted plaintext matches 'hello from igloo nip46'", |
| 26 | + "observed": "Decrypted plaintext matches exactly" |
| 27 | + } |
| 28 | + ], |
| 29 | + "evidence": { |
| 30 | + "testOutput": "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_encrypt produces ciphertext decryptable by a standards-compliant external peer [48.10ms]" |
| 31 | + }, |
| 32 | + "issues": null |
| 33 | + }, |
| 34 | + { |
| 35 | + "id": "VAL-NIP46-002", |
| 36 | + "title": "nip44_decrypt accepts externally generated standards-compliant ciphertext", |
| 37 | + "status": "pass", |
| 38 | + "steps": [ |
| 39 | + { |
| 40 | + "action": "Run bun test tests/routes/nip46.spec.ts --test-name-pattern 'nip44'", |
| 41 | + "expected": "Test 'nip44_decrypt accepts externally generated standards-compliant ciphertext' passes", |
| 42 | + "observed": "Test passed in 44.82ms" |
| 43 | + }, |
| 44 | + { |
| 45 | + "action": "Encrypt plaintext using nostr-tools nip44.encrypt with standards-compliant conversation key, then decrypt via Nip46Service.handleNip44Decrypt", |
| 46 | + "expected": "Decrypted plaintext matches 'hello from external nip44 peer'", |
| 47 | + "observed": "Decrypted plaintext matches exactly" |
| 48 | + } |
| 49 | + ], |
| 50 | + "evidence": { |
| 51 | + "testOutput": "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_decrypt accepts externally generated standards-compliant ciphertext [44.82ms]" |
| 52 | + }, |
| 53 | + "issues": null |
| 54 | + }, |
| 55 | + { |
| 56 | + "id": "VAL-NIP46-003", |
| 57 | + "title": "nip44_decrypt rejects legacy raw-shared-secret / malformed / non-v2 ciphertext", |
| 58 | + "status": "pass", |
| 59 | + "steps": [ |
| 60 | + { |
| 61 | + "action": "Run bun test tests/routes/nip46.spec.ts --test-name-pattern 'nip44'", |
| 62 | + "expected": "Three negative tests pass: legacy raw-shared-secret, malformed, and non-v2 ciphertext", |
| 63 | + "observed": "All three negative tests passed" |
| 64 | + }, |
| 65 | + { |
| 66 | + "action": "Test 1: Pass legacy ciphertext encrypted with raw shared X (pre-fix non-standard behavior) to handleNip44Decrypt", |
| 67 | + "expected": "Returns null result and throws error (no fallback)", |
| 68 | + "observed": "result is null, error is a string describing the failure" |
| 69 | + }, |
| 70 | + { |
| 71 | + "action": "Test 2: Pass malformed non-base64 ciphertext '!!!not-base64!!!' to handleNip44Decrypt", |
| 72 | + "expected": "Returns null result and throws error", |
| 73 | + "observed": "result is null, error is a string describing the failure" |
| 74 | + }, |
| 75 | + { |
| 76 | + "action": "Test 3: Tamper valid ciphertext version byte from 2 to 1 and pass to handleNip44Decrypt", |
| 77 | + "expected": "Returns null result and throws error containing 'encryption version'", |
| 78 | + "observed": "result is null, error contains 'encryption version'" |
| 79 | + } |
| 80 | + ], |
| 81 | + "evidence": { |
| 82 | + "testOutputs": [ |
| 83 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_decrypt rejects legacy raw-shared-secret ciphertext (no fallback) on an allowed session [43.63ms]", |
| 84 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_decrypt rejects malformed ciphertext on an allowed session [40.98ms]", |
| 85 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_decrypt rejects non-v2 payload on an allowed session [43.48ms]" |
| 86 | + ] |
| 87 | + }, |
| 88 | + "issues": null |
| 89 | + }, |
| 90 | + { |
| 91 | + "id": "VAL-NIP46-004", |
| 92 | + "title": "nip44_encrypt and nip44_decrypt accept x-only and compressed 02/03 peer pubkeys, error on missing/empty params, and preserve request id", |
| 93 | + "status": "pass", |
| 94 | + "steps": [ |
| 95 | + { |
| 96 | + "action": "Run bun test tests/routes/nip46.spec.ts --test-name-pattern 'nip44'", |
| 97 | + "expected": "Three sub-tests pass: pubkey formats, param validation, and request id preservation", |
| 98 | + "observed": "All three sub-tests passed" |
| 99 | + }, |
| 100 | + { |
| 101 | + "action": "Test pubkey formats: Use x-only pubkey, compressed 02 prefix, and compressed 03 prefix for both encrypt and decrypt", |
| 102 | + "expected": "All three formats produce valid ciphertext and decrypt to expected plaintext", |
| 103 | + "observed": "All three formats work correctly; plaintexts match 'shape-' + prefix" |
| 104 | + }, |
| 105 | + { |
| 106 | + "action": "Test param validation: Call encrypt/decrypt with no params, empty peer, and empty payload/ciphertext", |
| 107 | + "expected": "All six cases throw descriptive error messages", |
| 108 | + "observed": "All six cases threw errors with non-null messages" |
| 109 | + }, |
| 110 | + { |
| 111 | + "action": "Test request id preservation: Execute nip44_encrypt (success) and nip44_decrypt with bad ciphertext (error) via handleSocketRequest", |
| 112 | + "expected": "Success response contains original request id 'happy-id-42' with result; error response contains original request id 'sad-id-99' with error", |
| 113 | + "observed": "Both response ids preserved correctly; happy has result, sad has error" |
| 114 | + } |
| 115 | + ], |
| 116 | + "evidence": { |
| 117 | + "testOutputs": [ |
| 118 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_encrypt and nip44_decrypt accept x-only and compressed 02/03 peer pubkeys [44.01ms]", |
| 119 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44_encrypt and nip44_decrypt error on missing/empty params with descriptive messages [42.11ms]", |
| 120 | + "(pass) NIP-46 nip44 RPC standards-compliant interop > nip44 RPC responses preserve the original request id on success and on error [600.11ms]" |
| 121 | + ] |
| 122 | + }, |
| 123 | + "issues": null |
| 124 | + } |
| 125 | + ], |
| 126 | + "frictions": [], |
| 127 | + "blockers": [], |
| 128 | + "summary": "Tested 4 assigned assertions covering 8 test cases (plus 4 additional related tests): all 12 tests passed, 0 failed. VAL-NIP46-001 and VAL-NIP46-002 confirm standards-compliant NIP-44 v2 interop in both directions. VAL-NIP46-003 confirms three rejection modes for invalid ciphertext. VAL-NIP46-004 confirms pubkey format flexibility, parameter validation, and RPC id preservation." |
| 129 | +} |
0 commit comments