### Test File Format Example Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Shows the structure of syntax test files, including comments, valid identifiers, and how invalid examples are marked. ```text # Comment line (starts with #) valid-identifier-1 valid-identifier-2 # Section with comment another-valid-identifier # Invalid examples follow (in invalid files) ``` -------------------------------- ### Valid URI Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Demonstrates various correctly formatted URIs, including different schemes, authorities, paths, queries, and fragments. ```text https://example.com/path ``` ```text http://user:pass@host:8080/path?query=value#fragment ``` ```text ftp://ftp.example.com ``` ```text mailto:user@example.com ``` ```text file:///path/to/file ``` -------------------------------- ### Example MST Key Output Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Illustrates the format of generated MST keys, including prefix, height, separator, and suffix. ```text A0/374913 A1/986427 A2/451630 A3/670489 A4/085263 A5/765327 B0/123456 ... ``` -------------------------------- ### Valid DID Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid Decentralized Identifiers (DIDs) conforming to the W3C DID specification. Includes examples for different DID methods like key, plc, web, and ethr. ```text did:key:zQ3shZc2QzApp2oymGvQbzP8eKheVshBHbU4ZYjeXqwSKEn6N did:plc:7iza6de2dwap2sbkpav7c6c6 did:web:example.com did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a ``` -------------------------------- ### K-256 DID Key Pair Example Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/crypto-fixtures.md Example of a key pair object for K-256 (secp256k1) DID keys, containing a private key in hex format and its corresponding public DID key. ```json { "privateKeyBytesHex": "9085d2bef69286a6cbb51623c8fa258629945cd55ca705cc4e66700396894e0c", "publicDidKey": "did:key:zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme" } ``` -------------------------------- ### Testing Pattern Example Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Outlines the systematic approach to testing identifier validation, iterating through valid and invalid files and asserting the expected outcomes. ```text For each syntax_valid.txt file: For each line: Parse line as identifier Validate against type rules Assert validation succeeds For each syntax_invalid.txt file: For each line: Parse line as identifier Validate against type rules Assert validation fails ``` -------------------------------- ### Common Prefix Calculation Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Test cases for determining the common prefix length between two key strings. The comparison is byte-level. ```json { "left": "abc", "right": "abc", "len": 3 } ``` ```json { "left": "", "right": "abc", "len": 0 } ``` ```json { "left": "abc", "right": "", "len": 0 } ``` ```json { "left": "ab", "right": "abc", "len": 2 } ``` ```json { "left": "abcde", "right": "abc", "len": 3 } ``` ```json { "left": "abcde", "right": "abb", "len": 2 } ``` ```json { "left": "abc", "right": "abc ", "len": 3 } ``` -------------------------------- ### Valid DateTime Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid ISO 8601 datetime formats (RFC 3339) with UTC timezone, used for timestamps in the AT Protocol. Supports fractional seconds. ```text 2023-04-05T13:45:30Z 2023-12-31T23:59:59.999Z 1970-01-01T00:00:00Z ``` -------------------------------- ### P-256 DID Key Fixture Entry Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/crypto-fixtures.md An example entry from the P-256 DID key fixture file, showing a private key in hex format and its corresponding public DID key. ```json { "privateKeyBytesHex": "c55ad89e694e9cf40b5b22f8f6ca2d5c891fcee55d9fe2e8f5c8df01e93ca2bb", "publicDidKey": "did:key:zDnaembgSGUhZULN2Caob4HLJPaxBh92N7rtH21TErzqf8HQo" } ``` -------------------------------- ### Valid CID Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid Content Identifiers (CIDs), which are multibase-encoded CIDs used for content addressing. Supports CIDv1 (base32, base36) and CIDv0. ```text bafyreiclp443lavogvhj3d2ob2cxbfuscni2k5jk7bebjzg7khl3esabwq bafkreiccldh766hwcnuxnf2wh6jgzepf2nlu2lvcllt63eww5p6chi4ity bafk2bzace7hg4xsz4xfpukq5qpwqfwdqtfhpjxc5wnz4bbubjq3dhlzgf45e7u ``` -------------------------------- ### Invalid URI Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Illustrates common mistakes that lead to invalid URIs, such as invalid characters in the scheme, missing schemes, or incomplete authorities. ```text ht!tp://example.com # Invalid character in scheme ``` ```text example.com # Missing scheme ``` ```text http:// # Missing authority/path ``` -------------------------------- ### Valid AT Protocol Handles Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of syntactically correct AT Protocol handles, which follow DNS-like naming conventions. These are used for user identification and domain resolution. ```text john.test jan.test a234567890123456789.test john2.test john-john.test example.com user.bsky.social ``` -------------------------------- ### Valid AT Identifiers (Handle or DID) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid AT Identifiers, which can be either a handle or a DID. These are used for general identification within the AT Protocol. ```text jan.test john2.test did:key:zQ3shZc2QzApp2oymGvQbzP8eKheVshBHbU4ZYjeXqwSKEn6N did:plc:7iza6de2dwap2sbkpav7c6c6 ``` -------------------------------- ### Invalid DateTime Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of invalid ISO 8601 datetime formats. These highlight common errors like missing 'T' separator, missing 'Z' timezone, or non-UTC timezones. ```text 2023-04-05 13:45:30 # Missing T separator 2023-04-05T13:45:30 # Missing Z timezone 2023-04-05T13:45:30+00:00 # Non-UTC timezone ``` -------------------------------- ### Simple Addition Commit Proof Fixture Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/firehose-fixtures.md Example of a commit proof test case for a single addition to the Merkle tree. This fixture includes details about the leaf value, keys, additions, deletions, and the root hashes before and after the commit. ```json { "comment": "one deep single addition", "leafValue": "bafyreie5cvv4h45feadgeuwhbcutmh6t2ceseocckahdoe6uat64zmz454", "keys": ["A0/374913"], "adds": ["B1/986427"], "dels": [], "rootBeforeCommit": "bafyreiabcd...", "rootAfterCommit": "bafyreixyz...", "blocksInProof": [ "bafyreiabc...", "bafyreixyz..." ] } ``` -------------------------------- ### Leafless Split Commit Proof Fixture Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/firehose-fixtures.md An example of a 'leafless split' commit, where adding a key necessitates creating intermediate branch nodes without immediately adding a new leaf. This fixture details the scenario with existing keys and the new key to be added. ```json { "comment": "two deep leafless split", "leafValue": "bafyreie5cvv4h45feadgeuwhbcutmh6t2ceseocckahdoe6uat64zmz454", "keys": ["A0/374913", "B0/601692", "D0/952776", "E0/670489"], "adds": ["C2/014073"], "dels": [], "rootBeforeCommit": "bafyreialm5sgf7pijawbschsjpdevid5rss5ip3d4n4w6cc4mhu53sfl4i", "rootAfterCommit": "bafyreibxh4iztp5l2yshz3ectg2qjpeyprpw2gogao3pvceowpq3k3thya", "blocksInProof": [ "bafyreih7dxytqtcjv3cfia3fi3wxofeip62teqkpynnkxisxqwfchfb4bu", "bafyreiaqbymlnvpklmogx75gozjl3y73gva43jbgwcrqu2pp5g5ejou5vm", "bafyreicfh3st5ghtnoqyyvznjv4lhfnvl7qsndempx35i4tcmoxakqbgrm", "bafyreieyjrrai6igjceyxzkajrxgxz37da2eufb33anvesb4ev6yzztauu", "bafyreibxh4iztp5l2yshz3ectg2qjpeyprpw2gogao3pvceowpq3k3thya" ] } ``` -------------------------------- ### Lexicon Fixture Files Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Provides valid and invalid Lexicon definitions, valid and invalid record data instances, and example definitions for various Lexicon types. ```json lexicon/ ├── lexicon-valid.json # Valid Lexicon definitions ├── lexicon-invalid.json # Invalid Lexicon definitions ├── record-data-valid.json # Valid record data instances ├── record-data-invalid.json # Invalid record data instances └── catalog/ ├── record.json # Example record definition ├── query.json # Example query definition ├── procedure.json # Example procedure definition ├── subscription.json # Example subscription definition └── permission-set.json # Example permission-set definition ``` -------------------------------- ### Invalid AT URIs Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of invalid AT URIs. These highlight common errors such as using a handle instead of a DID for the authority or omitting the DID. ```text at://handle.test/app.bsky.feed.post/3lo3kqqljmfe2 # Handle not allowed, must be DID at:/app.bsky.feed.post/3lo3kqqljmfe2 # Missing DID authority ``` -------------------------------- ### Valid Record Keys Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid record keys, which are identifiers for records within a collection. This includes literal keys and TID-based keys. ```text literal:main literal:self 3lo3kqqljmfe2 abc123 some-record-key ``` -------------------------------- ### Invalid AT Protocol Handles Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of syntactically incorrect AT Protocol handles. These illustrate common errors such as leading/trailing hyphens, double dots, and excessively long labels. ```text -invalid.test # Starts with hyphen invalid-.test # Ends with hyphen .invalid.test # Starts with dot invalid..test # Double dot a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t.u.v.w.x.y.z-too-long.test # Label > 63 chars ``` -------------------------------- ### Common Prefix Validation Implementation Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Compares left and right strings byte-by-byte to count matching bytes from the start, stopping at the first mismatch or end of either string. ```text 1. For each test case, compare left and right strings byte-by-byte 2. Count matching bytes from start 3. Stop at first mismatch or end of either string 4. Verify result matches expected length ``` -------------------------------- ### Valid AT URIs Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid AT URIs, which identify specific records within the AT Protocol. They must use the 'at://' scheme and a DID as the authority. ```text at://did:plc:7iza6de2dwap2sbkpav7c6c6/app.bsky.feed.post/3lo3kqqljmfe2 at://did:key:zQ3shZc2QzApp2oymGvQbzP8eKheVshBHbU4ZYjeXqwSKEn6N/com.example.record/xyz ``` -------------------------------- ### Valid P-256 Signature Test Case Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/crypto-fixtures.md Example of a valid ECDSA signature for P-256 with a low-S value, used for testing signature verification. ```json { "comment": "valid P-256 key and signature, with low-S signature", "messageBase64": "oWVoZWxsb2V3b3JsZA", "algorithm": "ES256", "didDocSuite": "EcdsaSecp256r1VerificationKey2019", "publicKeyDid": "did:key:zDnaembgSGUhZULN2Caob4HLJPaxBh92N7rtH21TErzqf8HQo", "publicKeyMultibase": "zxdM8dSstjrpZaRUwBmDvjGXweKuEMVN95A9oJBFjkWMh", "signatureBase64": "2vZNsG3UKvvO/CDlrdvyZRISOFylinBh0Jupc6KcWoJWExHptCfduPleDbG3rko3YZnn9Lw0IjpixVmexJDegg", "validSignature": true, "tags": [] } ``` -------------------------------- ### Example Valid Record Data Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/lexicon-fixtures.md This JSON object represents a minimal valid record data instance conforming to a Lexicon schema. It includes a name, rkey, and the data payload with a $type and an integer field. ```json { "name": "minimal", "rkey": "demo", "data": { "$type": "example.lexicon.record", "integer": 1 } } ``` -------------------------------- ### Key Height Calculation Examples Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Test cases for calculating MST node heights based on key values using SHA-256 hashing. The height is determined by the first non-zero hex digit of the key's SHA-256 hash. ```json [ { "key": "", "height": 0 }, { "key": "asdf", "height": 0 }, { "key": "blue", "height": 1 }, { "key": "2653ae71", "height": 0 }, { "key": "88bfafc7", "height": 2 }, { "key": "2a92d355", "height": 4 }, { "key": "884976f5", "height": 6 }, { "key": "app.bsky.feed.post/454397e440ec", "height": 4 }, { "key": "app.bsky.feed.post/9adeb165882c", "height": 8 } ] ``` -------------------------------- ### Valid Namespace Identifiers (NSIDs) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid Namespace Identifiers (NSIDs), used for defining Lexicon schemas in AT Protocol. They consist of dot-separated lowercase segments. ```text com.atproto.server.getServer app.bsky.feed.post example.namespace.item a.b ``` -------------------------------- ### Invalid Namespace Identifiers (NSIDs) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of invalid Namespace Identifiers (NSIDs), demonstrating violations such as single segments, double dots, segments starting with hyphens, or uppercase characters. ```text app # Single segment app.bsky..feed # Double dot app.-invalid.feed # Segment starts with hyphen APP.BSKY.FEED # Uppercase not allowed app.bsky.feed. # Trailing dot .app.bsky.feed # Leading dot ``` -------------------------------- ### Firehose/Sync Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing Firehose and synchronization functionalities, including proof validation, commit operations, and root hash computation. ```markdown - Load firehose/commit-proof-fixtures.json - Implement proof validation for all scenario types - Test multi-operation commits (add/delete combinations) - Verify root hash computation after tree modifications - Validate CID references in proofs ``` -------------------------------- ### Integration Approach for AT Protocol Tests Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/README.md This outlines the standard five-step process for integrating and running AT Protocol interoperability tests using fixtures. It details loading, parsing, execution, verification, and reporting. ```text 1. Load fixtures from appropriate category 2. Parse test cases (JSON or text) 3. Run implementation function under test 4. Verify results against expected values 5. Report pass/fail for each case ``` -------------------------------- ### CBOR/Data Model Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing CBOR and data model handling, including fixture loading, encoding/decoding, CID computation, and support for special values. ```markdown - Load data-model/data-model-fixtures.json - Implement CBOR encoding to match fixtures - Implement CBOR decoding from fixtures - Compute CIDs matching fixture values - Load data-model-invalid.json and verify rejection - Support $link, $bytes, $type special values - Support blob type with all required fields ``` -------------------------------- ### MST Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing Merkle Search Tree functionalities, including key height and common prefix calculations, key generation, and tree navigation. ```markdown - Implement key height calculation from mst/key_heights.json - Verify all test cases match algorithm - Implement common prefix calculation from mst/common_prefix.json - Test key generation script output - Validate tree navigation and path calculation ``` -------------------------------- ### Signature Verification Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing signature verification, including loading fixtures, supporting specific algorithms (P-256, K-256), and enforcing signature requirements. ```markdown - Load crypto/signature-fixtures.json - Implement ECDSA verification for P-256 - Implement ECDSA verification for K-256 - Enforce low-S signature requirement - Reject DER-encoded signatures (must be raw 64-byte) - Test against all fixture cases ``` -------------------------------- ### Performance Considerations Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Guidelines on performance considerations for Atproto implementations, noting that test data is limited and the focus is on correctness. ```markdown - Test data is intentionally limited in size - Large-scale performance testing is out of scope - Focus is on correctness, not optimization - Implementations should handle larger datasets ``` -------------------------------- ### Lexicon Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing lexicon parsing and validation, including loading valid/invalid definitions, type/constraint validation, and format validation. ```markdown - Load and parse all lexicon-valid.json definitions - Verify rejection of lexicon-invalid.json definitions - Implement all field type validations - Implement all type constraints (range, length, enum, etc.) - Implement format validation (did, handle, at-uri, etc.) - Load and validate record-data-valid.json against schemas - Verify rejection of record-data-invalid.json ``` -------------------------------- ### Identifier Validation Implementation Checklist Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Checklist for implementing identifier validation, including loading syntax test files, implementing validators, and testing against invalid cases. ```markdown - Load all syntax/\*_syntax_valid.txt files - Implement validators for each identifier type - Test against syntax/\*_syntax_invalid.txt files - Verify rejection of all invalid cases - Ensure format-specific constraints (length, character set, etc.) ``` -------------------------------- ### Invalid P-256 Signature Test Case (DER-Encoded) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/crypto-fixtures.md Example of an invalid ECDSA signature for P-256 that is DER-encoded, which is not the raw 64-byte format required by AT Protocol. ```json { "comment": "P-256 key and signature, with DER-encoded signature which is invalid in atproto", "messageBase64": "oWVoZWxsb2V3b3JsZA", "algorithm": "ES256", "didDocSuite": "EcdsaSecp256r1VerificationKey2019", "publicKeyDid": "did:key:zDnaeT6hL2RnTdUhAPLij1QBkhYZnmuKyM7puQLW1tkF4Zkt8", "publicKeyMultibase": "ze8N2PPxnu19hmBQ58t5P3E9Yj6CqakJmTVCaKvf9Byq2", "signatureBase64": "MEQCIFxYelWJ9lNcAVt+jK0y/T+DC/X4ohFZ+m8f9SEItkY1AiACX7eXz5sgtaRrz/SdPR8kprnbHMQVde0T2R8yOTBweA", "validSignature": false, "tags": ["der-encoded"] } ``` -------------------------------- ### Cryptography Fixture Files Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Contains test cases for P-256 and K-256 signatures, and DID key pairs for K-256 and P-256 curves. ```json crypto/ ├── signature-fixtures.json # P-256 & K-256 signature test cases ├── w3c_didkey_K256.json # K-256 DID key pairs └── w3c_didkey_P256.json # P-256 DID key pairs ``` -------------------------------- ### Commit Proof Validation Algorithm Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/firehose-fixtures.md This pseudocode outlines the steps to validate a commit proof, including extracting operations, reconstructing the tree state, and verifying the final root hash against the expected value. ```pseudocode function validateCommitProof(proof): 1. Extract keys, adds, dels from proof 2. For each added key: - Calculate MST path using key height and hash - Verify path exists in blocksInProof 3. Reconstruct tree state: - Start with rootBeforeCommit - Apply dels (remove nodes) - Apply adds (insert nodes) - Recalculate parent hashes 4. Verify final root: - Compare computed root with rootAfterCommit 5. Verify all blocks in proof: - Each block should be referenced by parent - No orphaned blocks 6. Return success/failure ``` -------------------------------- ### Valid Timestamp Identifiers (TIDs) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid Timestamp Identifiers (TIDs), which are base32-encoded 64-bit values used for AT Protocol records. They combine timestamp and entropy. ```text 3lo3kqqljmfe2 3lfkk2gblag2b 3lccd5dj6qk0a ``` -------------------------------- ### Data Model Fixture Files Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Includes valid CBOR/JSON encoding pairs, valid and invalid JSON test cases, and CID computations. ```json data-model/ ├── data-model-fixtures.json # Valid CBOR/JSON encoding pairs with CIDs ├── data-model-valid.json # Valid JSON test cases └── data-model-invalid.json # Invalid JSON test cases ``` -------------------------------- ### MST Key Generation Helper Script Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Python utility script to generate MST keys with specific height values. Includes functions for calculating key height and generating random keys. ```python def height(key): h = hashlib.sha256(key).hexdigest() i = 0 for c in h: if c >= '4': return i*2 if c != '0': return i*2+1 i = i+1 raise Exception("very suss") ``` ```python def rand_key(letter, level): num = random.randint(0, 999999) return f"{letter}{level}/{num:06}".encode("utf8") ``` ```python def gen_key(letter, level): while True: key = rand_key(letter, level) if height(key) == level: print(key.decode("utf-8")) return ``` -------------------------------- ### Merge and Split Commit Proof Fixture Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/firehose-fixtures.md A test case demonstrating a commit operation that involves both merging (deleting keys) and splitting (adding keys). This fixture includes the leaf value, existing keys, keys to be added and deleted, and the resulting root hashes. ```json { "comment": "merge and split in multi-op commit", "leafValue": "bafyreie5cvv4h45feadgeuwhbcutmh6t2ceseocckahdoe6uat64zmz454", "keys": ["A0/374913", "B2/827649", "D2/269196", "E0/670489"], "adds": ["C2/014073"], "dels": ["B2/827649", "D2/269196"], "rootBeforeCommit": "bafyreiceld4icym4qjmdcn3dfgtxt7t66hdgyhvigessgmkvb56dx6amgi", "rootAfterCommit": "bafyreigkalika3taqauapfha556lo36zzcjoiifny5xeru6yis3nxw5ruq", "blocksInProof": [ "bafyreid44jgimksqqdratyste2moqu6zo4h6co2pknjppfoiplsqxtuxae", "bafyreihytu6onh476trave25zuo63ziebkeong2755sc5nmf55uzdawgt4", "bafyreigkalika3taqauapfha556lo36zzcjoiifny5xeru6yis3nxw5ruq", "bafyreidnnkrdkcaswbflgtdsxm7nzs7p5f2rdous6wrlupzstuwqu5pfgm", "bafyreia2kq243hqq3volwlzkbzzphoeqauk54sc5h7vgogq4ei5fjizxvy" ] } ``` -------------------------------- ### Invalid P-256 Signature Test Case (High-S) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/crypto-fixtures.md Example of an invalid ECDSA signature for P-256 with a high-S value, which is not compliant with AT Protocol's low-S requirement. ```json { "comment": "P-256 key and signature, with non-low-S signature which is invalid in atproto", "messageBase64": "oWVoZWxsb2V3b3JsZA", "algorithm": "ES256", "didDocSuite": "EcdsaSecp256r1VerificationKey2019", "publicKeyDid": "did:key:zDnaembgSGUhZULN2Caob4HLJPaxBh92N7rtH21TErzqf8HQo", "publicKeyMultibase": "zxdM8dSstjrpZaRUwBmDvjGXweKuEMVN95A9oJBFjkWMh", "signatureBase64": "2vZNsG3UKvvO/CDlrdvyZRISOFylinBh0Jupc6KcWoKp7O4VS9giSAah8k5IUbXIW00SuOrjfEqQ9HEkN9JGzw", "validSignature": false, "tags": ["high-s"] } ``` -------------------------------- ### Invalid Timestamp Identifiers (TIDs) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of invalid Timestamp Identifiers (TIDs), showing common errors like incorrect length, invalid characters, or incorrect casing. ```text 3lo3kqqljmfe # Too short 3lo3kqqljmfe2a # Too long 3lo3kqqljmfe! # Invalid character 3LO3KQQLJMFE2 # Uppercase not allowed ``` -------------------------------- ### Valid BCP 47 Language Tags Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of valid BCP 47 language tags, used to identify languages. These include primary language, optional region, and script designators. ```text en en-US zh-Hans fr-CA pt-BR en-Latn-US ``` -------------------------------- ### Invalid BCP 47 Language Tags Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/syntax-fixtures.md Examples of invalid BCP 47 language tags, highlighting common mistakes like incorrect casing, using underscores instead of hyphens, or invalid region codes. ```text EN # Must be lowercase en_US # Must use hyphen, not underscore en-USA # Region must be 2 letters ``` -------------------------------- ### Text Syntax File Format Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Format specifications for plain text syntax files, including line-based identifiers, comment syntax, and allowed blank lines. ```text # One identifier per line # Comments starting with "#" # Blank lines allowed # UTF-8 encoding ``` -------------------------------- ### Test Case Organization Conventions Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Conventions for organizing test cases, categorizing them into positive, negative, edge, and special cases. ```markdown - **Positive tests** (valid): Demonstrate correct, expected behavior - **Negative tests** (invalid): Demonstrate rejection of bad input - **Edge cases**: Boundary conditions, unusual but valid cases - **Special cases**: Format-specific requirements (e.g., high-S rejection) ``` -------------------------------- ### Key Height Algorithm Pseudocode Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Pseudocode illustrating the algorithm for calculating the height of a key in an MST based on its SHA-256 hash. ```pseudocode function getKeyHeight(key: string): integer { hashHex = SHA256(UTF8.encode(key)).toHex() for (i = 0; i < hashHex.length; i++) { digit = hashHex[i] if (digit >= '4') { return i * 2 } if (digit != '0') { return i * 2 + 1 } } // Should not reach here for well-formed hashes throw Error("unexpected hash") } ``` -------------------------------- ### Generate MST Keys Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Generates 156 MST keys with specific characteristics. The output format is `/`. ```bash python3 gen_keys.py ``` -------------------------------- ### Complex Multi-Op Commit Proof Fixture (Two Deep Split) Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/firehose-fixtures.md A test case for a complex commit involving a two-deep split in the Merkle tree, including multiple existing keys and a new addition. It specifies the leaf value, keys, additions, deletions, and root hashes. ```json { "comment": "two deep split", "leafValue": "bafyreie5cvv4h45feadgeuwhbcutmh6t2ceseocckahdoe6uat64zmz454", "keys": [ "A0/374913", "B1/986427", "C0/451630", "E0/670489", "F1/085263", "G0/765327" ], "adds": ["D2/269196"], "dels": [], "rootBeforeCommit": "bafyreicraprx2xwnico4tuqir3ozsxpz46qkcpox3obf5bagicqwurghpy", "rootAfterCommit": "bafyreihvay6pazw3dfa47u5d2tn3rd6pa57sr37bo5bqyvjuqc73ib65my", "blocksInProof": [ "bafyreieazvzmba35p4phksumwfoklwe5o4ncmo7otud74idcyv4orrbzxi", "bafyreie4227qpa4vbtbpnsvuhp322b776vjuhxsidi5hxp2gawumr4m3de", "bafyreid44jgimksqqdratyste2moqu6zo4h6co2pknjppfoiplsqxtuxae", "bafyreiaerlvitye7fjjwodkshtbqqdsmfsdjtnlz4vs6y4trnddshsmd5a", "bafyreihvay6pazw3dfa47u5d2tn3rd6pa57sr37bo5bqyvjuqc73ib65my" ] } ``` -------------------------------- ### Height Validation Implementation Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/api-reference/mst-fixtures.md Computes height using SHA-256 for each test case and compares it against the expected value, reporting mismatches. ```text 1. For each test case, compute height using SHA-256 2. Compare against expected value 3. Report mismatches with test case key ``` -------------------------------- ### Error Handling Conventions Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Conventions for error handling in Atproto implementations, emphasizing explicit test cases for failures and strict validation rules. ```markdown - Expected failures have explicit test cases - Invalid data should be rejected with specific error types - Validation rules are strict (reject ambiguous cases) - Format validation is case-sensitive where specified ``` -------------------------------- ### Firehose Test Data Structure Source: https://github.com/bluesky-social/atproto-interop-tests/blob/main/_autodocs/REFERENCE-INDEX.md Directory structure for Firehose test data, specifically containing Merkle proof test cases. ```tree firehose/ └── commit-proof-fixtures.json # Merkle proof test cases ```