diff --git a/bip-encrypted-backup.md b/bip-encrypted-backup.md new file mode 100644 index 0000000000..cea526afb2 --- /dev/null +++ b/bip-encrypted-backup.md @@ -0,0 +1,360 @@ +``` +BIP: ? +Title: Compact encryption scheme for non-seed wallet data +Author: Pyth +Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-xxxx +Status: Draft +Type: Specification +Created: 2025-08-22 +License: BSD-2-Clause +Post-History: https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607/31 + https://groups.google.com/g/bitcoindev/c/5NgJbpVDgEc +``` + +## Introduction + +### Abstract + +This BIP defines a compact encryption scheme for **wallet descriptors** (BIP-0380), +**wallet policies** (BIP-0388), **labels** (BIP-0329), and **wallet backup metadata** (json). +The payload must not contain any private key material. + +Users can store encrypted backups on untrusted media or cloud services without leaking +addresses, script structures, or cosigner counts. The encryption key derives from the +lexicographically-sorted public keys in the descriptor, allowing any keyholder to decrypt +without additional secrets. + +Though designed for descriptors and policies, the scheme works equally well for labels +and backup metadata. + +### Copyright + +This BIP is licensed under the BSD 2-Clause License. +Redistribution and use in source and binary forms, with or without modification, are +permitted provided that the above copyright notice and this permission notice appear +in all copies. + +### Motivation + +Losing the **wallet descriptor** (or **wallet policy**) is just as catastrophic as +losing the seed itself. The seed lets you sign, but the descriptor maps you to your coins. +For multisig or miniscript wallets, keys alone won't help—without the descriptor, you +can't reconstruct the script. + +Offline storage of descriptors has two practical obstacles: + +1. **Descriptors are hard to store offline.** + Descriptors can be much longer than a 12/24-word seed. Paper and steel backups + become impractical or error-prone. + +2. **Online redundancy carries privacy risk.** + USB drives, phones, and cloud storage solve the length problem but expose your + wallet structure. Plaintext descriptors leak your pubkeys and script details. + Cloud storage is often unencrypted, and even cloud encryption could be compromised, + depending on (often opaque) implementation details. Its security also reduces to + that of the weakest device with cloud access. Each copy increases the attack surface. + +This BIP therefore proposes an **encrypted**, and compact backup format that: + +* can be **safely stored in multiple places**, including untrusted on-line services, +* can be **decrypted only by intended holders** of specified public keys, + +See the original [Delving post](https://delvingbitcoin.org/t/a-simple-backup-scheme-for-wallet-accounts/1607/31) +for more background. + +### Expected properties + +* **Encrypted**: safe to store with untrusted cloud providers or backup services +* **Access controlled**: only designated cosigners can decrypt +* **Easy to implement**: it should not require any sophisticated tools/libraries. +* **Vendor-neutral**: works with any hardware signer + +### Scope + +This proposal targets wallet descriptors (BIP-0380) and policies (BIP-0388), but the +scheme also works for labels (BIP-0329) and other wallet metadata like +[wallet backup](https://github.com/pythcoiner/wallet_backup). + +Private key material MUST be removed before encrypting any payload. + +## Specification + +Note: in the followings sections, the operator ⊕ refers to the bitwise XOR operation. + +### Secret generation + +- Let $p_1, p_2, \dots, p_n$, be the public keys in the descriptor/wallet policy, in + increasing lexicographical order +- Let $s$ = sha256("BIP_XXXX_DECRYPTION_SECRET" | $p_1$ | $p_2$ | ... | $p_n$) +- Let $s_i$ = sha256("BIP_XXXX_INDIVIDUAL_SECRET" | $p_i$) +- Let $c_i$ = $s$ ⊕ $s_i$ + +**Note:** To prevent attackers from decrypting the backup using publicly known +keys, explicitly exclude any public keys with x coordinate +`50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0` (the BIP341 NUMS +point, used as a taproot internal key in some applications). Additionally, exclude any +other publicly known keys. + +Applications that exclude additional keys SHOULD document this, although decryption +using these keys will simply fail. This does not affect decryption with the remaining +keys. + +### Key Normalization + +Before computing the encryption secret, all public keys in the descriptor/wallet policy +MUST be normalized to **32-byte x-only public key format**.[^x-only] + +[^x-only]: **Why x-only keys?** + X-only public keys are 32 bytes, a natural size for cryptographic operations. + This format is also used in BIP340 (Schnorr signatures) and BIP341 (Taproot). + +The normalization process depends on the key type: + +#### Extended Public Keys (xpubs) + +For extended public keys (including those with origin information and/or multipaths): +- Extract the root extended public key +- Extract the **x-coordinate** from its public key (32 bytes) +- Ignore derivation paths, origin information, and multipath specifiers + +#### Compressed Public Keys + +For 33-byte compressed public keys (0x02 or 0x03 prefix): +- Remove the prefix byte +- Result is 32 bytes (x-coordinate only) + +#### X-only Public Keys + +Already in the correct format—use as-is (32 bytes). + +#### Uncompressed Public Keys + +For 65-byte uncompressed public keys (0x04 prefix): +- Extract the x-coordinate (bytes 1-32) +- Result is 32 bytes + +See [keys_types.json](./bip-encrypted-backup/test_vectors/keys_types.json) for +normalization test vectors. + +### Encryption + +The format uses CHACHA20_POLY1305 (RFC 8439) as the default encryption algorithm, +with a 96-bit random nonce and a 128-bit authentication tag to provide confidentiality +and integrity. AES_256_GCM is also supported as an alternative.[^chacha-default] + +[^chacha-default]: **Why CHACHA20-POLY1305 as default?** + ChaCha20-Poly1305 is already used in Bitcoin Core (e.g., BIP324) and is widely + available in cryptographic libraries. It performs well in software without + hardware acceleration, making it suitable for hardware wallets and embedded devices. + +* let $nonce$ = random(96 bits) +* let $ciphertext$ = encrypt($payload$, $secret$, $nonce$) + +### Decryption + +In order to decrypt the payload of a backup, the owner of a certain public key p +computes: + +* let $s_i$ = sha256("BIP_XXXX_INDIVIDUAL_SECRET" ‖ $p$) +* for each `individual_secret_i` generate `reconstructed_secret_i` = +`individual_secret_i` ⊕ `si` +* for each `reconstructed_secret_i` process $payload$ = +decrypt($ciphertext$, $secret$, $nonce$) + +Decryption will succeed if and only if **p** was one of the keys in the +descriptor/wallet policy. + +### Encoding + +The encrypted backup must be encoded as follows: + +`MAGIC` `VERSION` `DERIVATION_PATHS` `INDIVIDUAL_SECRETS` `ENCRYPTION` +`ENCRYPTED_PAYLOAD` + +#### Magic + +`MAGIC`: 6 bytes which are ASCII/UTF-8 representation of **BIPXXX** (TBD). + +#### Version + +`VERSION`: 1 byte unsigned integer representing the format version. The current +specification defines version `0x01`. + +#### Derivation Paths + +Note: the derivation-path vector should not contain duplicates. +Derivation paths are optional; they can be useful to simplify the recovery process +if one has used a non-common derivation path to derive his key.[^derivation-optional] + +[^derivation-optional]: **Why are derivation paths optional?** + When standard derivation paths are used, they are easily discoverable, making + them straightforward to brute-force. Omitting them enhances privacy by reducing + the information shared publicly about the descriptor scheme. + +`DERIVATION_PATH` follows this format: + +`COUNT` +`CHILD_COUNT` `CHILD` `...` `CHILD` +`...` +`CHILD_COUNT` `CHILD` `...` `CHILD` + +`COUNT`: 1-byte unsigned integer (0–255) indicating how many derivation paths are +included. +`CHILD_COUNT`: 1-byte unsigned integer (1–255) indicating how many children are in +the current path. +`CHILD`: 4-byte big-endian unsigned integer representing a child index per BIP-32. + +#### Individual Secrets + +At least one individual secret must be supplied.[^no-fingerprints] + +[^no-fingerprints]: **Why no fingerprints in plaintext encoding?** + Including fingerprints would leak direct information about the descriptor + participants, which compromises privacy. + +The `INDIVIDUAL_SECRETS` section follows this format: + +`COUNT` +`INDIVIDUAL_SECRET` +`INDIVIDUAL_SECRET` + +`COUNT`: 1-byte unsigned integer (1–255) indicating how many secrets are included. +`INDIVIDUAL_SECRET`: 32-byte serialization of the derived individual secret. + +Note: the individual secrets vector should not contain duplicates. Implementations +MAY deduplicate secrets during encoding or parsing. + +#### Encryption + +`ENCRYPTION`: 1-byte unsigned integer identifying the encryption algorithm. + +| Value | Definition | +|:-------|:---------------------------------------| +| 0x00 | Reserved | +| 0x01 | CHACHA20_POLY1305 (default) | +| 0x02 | AES_256_GCM | + +#### Payload Size Limits + +CHACHA20_POLY1305 (per RFC 8439) supports plaintext up to 2^38 - 64 bytes. +AES_256_GCM (per RFC 5116) supports plaintext up to 2^36 - 31 bytes. +Implementations MAY impose stricter limits based on platform constraints +(e.g., limiting to 2^32 - 1 bytes on 32-bit architectures). + +Implementations MUST reject empty payloads. + +#### Ciphertext + +`CIPHERTEXT` is the encrypted data resulting from encryption of `PAYLOAD` with algorithm +defined in `ENCRYPTION` where `PAYLOAD` is encoded following this format: + +`CONTENT` `PLAINTEXT` + +#### Integer Encodings + +All variable-length integers are encoded as +[compact size](https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer). + +#### Content + +`CONTENT` is a variable length field defining the type of `PLAINTEXT` being encrypted, +it follows this format: + +`TYPE` (`LENGTH`) `DATA` + +`TYPE`: 1-byte unsigned integer identifying how to interpret `DATA`. + +| Value | Definition | +|:-------|:---------------------------------------| +| 0x00 | Reserved | +| 0x01 | BIP Number (big-endian uint16) | +| 0x02 | Vendor-Specific Opaque Tag | + +`LENGTH`: variable-length integer representing the length of `DATA` in bytes. + +For all `TYPE` values except `0x01`, `LENGTH` MUST be present. + +`DATA`: variable-length field whose encoding depends on `TYPE`. + +For `TYPE` values defined above: +- 0x00: parsers MUST reject the payload. +- 0x01: `LENGTH` MUST be omitted and `DATA` is a 2-byte big-endian unsigned integer + representing the BIP number that defines it. +- 0x02: `DATA` MUST be `LENGTH` bytes of opaque, vendor-specific data. + +For all `TYPE` values except `0x01`, parsers MUST reject `CONTENT` if `LENGTH` exceeds +the remaining payload bytes. + +Parsers MUST skip unknown `TYPE` values less than `0x80`, by consuming `LENGTH` bytes +of `DATA`. + +For unknown `TYPE` values greater than or equal to `0x80`, parsers MUST stop parsing +`CONTENT`.[^type-upgrade] + +[^type-upgrade]: **Why the 0x80 threshold?** + The `TYPE >= 0x80` rule means we're not stuck with the current TLV encoding. + It has a nice upgrade property: you can still encode backward compatible stuff + at the start. + +#### Encrypted Payload + +`ENCRYPTED_PAYLOAD` follows this format: + +`NONCE` `LENGTH` `CIPHERTEXT` + +`NONCE`: 12-byte (96-bit) nonce. +`LENGTH`: variable-length integer representing ciphertext length. +`CIPHERTEXT`: variable-length ciphertext. + +Note: `CIPHERTEXT` is followed by the end of the `ENCRYPTED_PAYLOAD` section. +Compliant parsers MUST stop reading after consuming `LENGTH` bytes of ciphertext; +additional trailing bytes are reserved for vendor-specific extensions and MUST +be ignored. + +### Text Representation + +Implementations SHOULD encode and decode the backup using Base64 (RFC 4648).[^psbt-base64] + +[^psbt-base64]: **Why Base64?** + PSBT (BIP174) is commonly exchanged as a Base64 string, so wallet software + likely already supports this representation. + +## Rationale + +See footnotes throughout the specification for design rationale. + +### Future Extensions + +The version field enables possible future enhancements: + +- Additional encryption algorithms +- Support for threshold-based decryption +- Hiding number of participants +- bech32m export + +### Implementation + +- Rust [implementation](https://github.com/pythcoiner/bitcoin-encrypted-backup) + +### Test Vectors + +[key_types.json](./bip-encrypted-backup/test_vectors/keys_types.json) contains test +vectors for key serialisations. +[content_type.json](./bip-encrypted-backup/test_vectors/content_type.json) contains test +vectors for contents types serialisations. +[derivation_path.json](./bip-encrypted-backup/test_vectors/derivation_path.json) contains +test vectors for derivation paths serialisations. +[individual_secrets.json](./bip-encrypted-backup/test_vectors/individual_secrets.json) +contains test vectors for individual secrets serialization. +[encryption_secret.json](./bip-encrypted-backup/test_vectors/encryption_secret.json) +contains test vectors for generation of encryption secret. +[chacha20poly1305_encryption.json](./bip-encrypted-backup/test_vectors/chacha20poly1305_encryption.json) +contains test vectors for ciphertexts generated using CHACHA20-POLY1305. +[aesgcm256_encryption.json](./bip-encrypted-backup/test_vectors/aesgcm256_encryption.json) +contains test vectors for ciphertexts generated using AES-GCM256. +[encrypted_backup.json](./bip-encrypted-backup/test_vectors/encrypted_backup.json) +contains test vectors for generation of complete encrypted backup. + +## Acknowledgements + +// TBD diff --git a/bip-encrypted-backup/test_vectors/aesgcm256_encryption.json b/bip-encrypted-backup/test_vectors/aesgcm256_encryption.json new file mode 100644 index 0000000000..1b27e99cec --- /dev/null +++ b/bip-encrypted-backup/test_vectors/aesgcm256_encryption.json @@ -0,0 +1,39 @@ +[ + { + "description": "Basic encryption with short plaintext", + "nonce": "000102030405060708090a0b", + "plaintext": "48656c6c6f", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": "c0ae5f3e6f609000697cc7c8de2b30ce8817ca44fa" + }, + { + "description": "Empty plaintext should fail", + "nonce": "000102030405060708090a0b", + "plaintext": "", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": null + }, + { + "description": "Encryption with all zeros", + "nonce": "000000000000000000000000", + "plaintext": "00000000000000000000000000000000", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": "cea7403d4d606b6e074ec5d3baf39d18d0d1c8a799996bf0265b98b5d48ab919" + }, + { + "description": "Encryption with all FFs", + "nonce": "ffffffffffffffffffffffff", + "plaintext": "ffffffffffffffffffffffffffffffff", + "secret": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "ciphertext": "42c4417ae76f276beb09973a4b9b37155b3f5fe9af300dd8d2372023367d86b7" + }, + { + "description": "Longer plaintext", + "nonce": "0f1e2d3c4b5a69788796a5b4", + "plaintext": "546869732069732061206c6f6e67657220706c61696e746578742074686174207368756c6420626520656e637279707465642070726f7065726c792e", + "secret": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", + "ciphertext": "ea2e3d6ac4724e3301f138b449495b9eed1f01207eb5f62d1c0e103f2237a8e459b1770a8c7b8eabf2d69922e5f767ad4de4d8d7bf737e49dd6fef6d7996158207af0edd60e87faf8a353d7c" + } +] + + diff --git a/bip-encrypted-backup/test_vectors/chacha20poly1305_encryption.json b/bip-encrypted-backup/test_vectors/chacha20poly1305_encryption.json new file mode 100644 index 0000000000..ef13646d4c --- /dev/null +++ b/bip-encrypted-backup/test_vectors/chacha20poly1305_encryption.json @@ -0,0 +1,37 @@ +[ + { + "description": "Basic encryption with short plaintext", + "nonce": "000102030405060708090a0b", + "plaintext": "48656c6c6f", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": "TBD" + }, + { + "description": "Empty plaintext should fail", + "nonce": "000102030405060708090a0b", + "plaintext": "", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": null + }, + { + "description": "Encryption with all zeros", + "nonce": "000000000000000000000000", + "plaintext": "00000000000000000000000000000000", + "secret": "0000000000000000000000000000000000000000000000000000000000000000", + "ciphertext": "TBD" + }, + { + "description": "Encryption with all FFs", + "nonce": "ffffffffffffffffffffffff", + "plaintext": "ffffffffffffffffffffffffffffffff", + "secret": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "ciphertext": "TBD" + }, + { + "description": "Longer plaintext", + "nonce": "0f1e2d3c4b5a69788796a5b4", + "plaintext": "546869732069732061206c6f6e67657220706c61696e746578742074686174207368756c6420626520656e637279707465642070726f7065726c792e", + "secret": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", + "ciphertext": "TBD" + } +] diff --git a/bip-encrypted-backup/test_vectors/content_type.json b/bip-encrypted-backup/test_vectors/content_type.json new file mode 100644 index 0000000000..deff5eb87d --- /dev/null +++ b/bip-encrypted-backup/test_vectors/content_type.json @@ -0,0 +1,77 @@ +[ + { + "description": "TYPE 0x00 is reserved", + "valid": false, + "content": "00" + }, + { + "description": "BIP 380", + "valid": true, + "content": "01017c" + }, + { + "description": "BIP 388", + "valid": true, + "content": "010184" + }, + { + "description": "BIP 329", + "valid": true, + "content": "010149" + }, + { + "description": "BIP 999", + "valid": true, + "content": "0103e7" + }, + { + "description": "BIP max (65535)", + "valid": true, + "content": "01ffff" + }, + { + "description": "BIP min (0)", + "valid": true, + "content": "010000" + }, + { + "description": "Vendor-specific 00010203", + "valid": true, + "content": "020400010203" + }, + { + "description": "Vendor-specific empty", + "valid": true, + "content": "0200" + }, + { + "description": "TYPE 0x01 incomplete (missing DATA)", + "valid": false, + "content": "01" + }, + { + "description": "TYPE 0x01 incomplete (only 1 byte of DATA)", + "valid": false, + "content": "0100" + }, + { + "description": "TYPE 0x02 LENGTH exceeds remaining bytes", + "valid": false, + "content": "0205aabbcc" + }, + { + "description": "TYPE >= 0x80 stops parsing", + "valid": false, + "content": "80" + }, + { + "description": "TYPE >= 0x80 stops parsing (0xff)", + "valid": false, + "content": "ff" + }, + { + "description": "Unknown TYPE < 0x80 with valid LENGTH skipped", + "valid": true, + "content": "0302aabb" + } +] diff --git a/bip-encrypted-backup/test_vectors/derivation_path.json b/bip-encrypted-backup/test_vectors/derivation_path.json new file mode 100644 index 0000000000..2ce20db446 --- /dev/null +++ b/bip-encrypted-backup/test_vectors/derivation_path.json @@ -0,0 +1,141 @@ +[ + { + "description": "Empty derivation paths", + "paths": [], + "expected": "00" + }, + { + "description": "Single path with one child: m/0", + "paths": ["m/0"], + "expected": "010100000000" + }, + { + "description": "Single path with hardened child: m/44'", + "paths": ["m/44'"], + "expected": "01018000002c" + }, + { + "description": "Standard BIP-84 path: m/84'/0'/0'", + "paths": ["m/84'/0'/0'"], + "expected": "0103800000548000000080000000" + }, + { + "description": "Mixed hardened and normal: m/0/1'/2/3'", + "paths": ["m/0/1'/2/3'"], + "expected": "010400000000800000010000000280000003" + }, + { + "description": "Multiple paths: m/0/1'/2/3' and m/84'/0'/0'/2'", + "paths": ["m/0/1'/2/3'", "m/84'/0'/0'/2'"], + "expected": "0204000000008000000100000002800000030480000054800000008000000080000002" + }, + { + "description": "Path with large indices: m/2147483647'/2147483646", + "paths": ["m/2147483647'/2147483646"], + "expected": "0102ffffffff7ffffffe" + }, + { + "description": "Single child path: m/1", + "paths": ["m/1"], + "expected": "010100000001" + }, + { + "description": "Path with max normal index: m/2147483647", + "paths": ["m/2147483647"], + "expected": "01017fffffff" + }, + { + "description": "Path with multiple normal indices: m/0/1/2/3/4", + "paths": ["m/0/1/2/3/4"], + "expected": "01050000000000000001000000020000000300000004" + }, + { + "description": "Path with all hardened: m/0'/1'/2'", + "paths": ["m/0'/1'/2'"], + "expected": "0103800000008000000180000002" + }, + { + "description": "Two different single-child paths: m/0 and m/1", + "paths": ["m/0", "m/1"], + "expected": "0201000000000100000001" + }, + { + "description": "BIP-44 account 0: m/44'/0'/0'", + "paths": ["m/44'/0'/0'"], + "expected": "01038000002c8000000080000000" + }, + { + "description": "BIP-49 account 0: m/49'/0'/0'", + "paths": ["m/49'/0'/0'"], + "expected": "0103800000318000000080000000" + }, + { + "description": "256 paths should fail (exceeds u8::MAX)", + "paths": [ + "m/0", "m/1", "m/2", "m/3", "m/4", "m/5", "m/6", "m/7", "m/8", "m/9", + "m/10", "m/11", "m/12", "m/13", "m/14", "m/15", "m/16", "m/17", "m/18", "m/19", + "m/20", "m/21", "m/22", "m/23", "m/24", "m/25", "m/26", "m/27", "m/28", "m/29", + "m/30", "m/31", "m/32", "m/33", "m/34", "m/35", "m/36", "m/37", "m/38", "m/39", + "m/40", "m/41", "m/42", "m/43", "m/44", "m/45", "m/46", "m/47", "m/48", "m/49", + "m/50", "m/51", "m/52", "m/53", "m/54", "m/55", "m/56", "m/57", "m/58", "m/59", + "m/60", "m/61", "m/62", "m/63", "m/64", "m/65", "m/66", "m/67", "m/68", "m/69", + "m/70", "m/71", "m/72", "m/73", "m/74", "m/75", "m/76", "m/77", "m/78", "m/79", + "m/80", "m/81", "m/82", "m/83", "m/84", "m/85", "m/86", "m/87", "m/88", "m/89", + "m/90", "m/91", "m/92", "m/93", "m/94", "m/95", "m/96", "m/97", "m/98", "m/99", + "m/100", "m/101", "m/102", "m/103", "m/104", "m/105", "m/106", "m/107", "m/108", "m/109", + "m/110", "m/111", "m/112", "m/113", "m/114", "m/115", "m/116", "m/117", "m/118", "m/119", + "m/120", "m/121", "m/122", "m/123", "m/124", "m/125", "m/126", "m/127", "m/128", "m/129", + "m/130", "m/131", "m/132", "m/133", "m/134", "m/135", "m/136", "m/137", "m/138", "m/139", + "m/140", "m/141", "m/142", "m/143", "m/144", "m/145", "m/146", "m/147", "m/148", "m/149", + "m/150", "m/151", "m/152", "m/153", "m/154", "m/155", "m/156", "m/157", "m/158", "m/159", + "m/160", "m/161", "m/162", "m/163", "m/164", "m/165", "m/166", "m/167", "m/168", "m/169", + "m/170", "m/171", "m/172", "m/173", "m/174", "m/175", "m/176", "m/177", "m/178", "m/179", + "m/180", "m/181", "m/182", "m/183", "m/184", "m/185", "m/186", "m/187", "m/188", "m/189", + "m/190", "m/191", "m/192", "m/193", "m/194", "m/195", "m/196", "m/197", "m/198", "m/199", + "m/200", "m/201", "m/202", "m/203", "m/204", "m/205", "m/206", "m/207", "m/208", "m/209", + "m/210", "m/211", "m/212", "m/213", "m/214", "m/215", "m/216", "m/217", "m/218", "m/219", + "m/220", "m/221", "m/222", "m/223", "m/224", "m/225", "m/226", "m/227", "m/228", "m/229", + "m/230", "m/231", "m/232", "m/233", "m/234", "m/235", "m/236", "m/237", "m/238", "m/239", + "m/240", "m/241", "m/242", "m/243", "m/244", "m/245", "m/246", "m/247", "m/248", "m/249", + "m/250", "m/251", "m/252", "m/253", "m/254", "m/255" + ], + "expected": null + }, + { + "description": "Path with 256 children should fail (exceeds u8::MAX)", + "paths": ["m/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0/0"], + "expected": null + }, + { + "description": "255 paths should succeed (maximum allowed)", + "paths": [ + "m/0", "m/1", "m/2", "m/3", "m/4", "m/5", "m/6", "m/7", "m/8", "m/9", + "m/10", "m/11", "m/12", "m/13", "m/14", "m/15", "m/16", "m/17", "m/18", "m/19", + "m/20", "m/21", "m/22", "m/23", "m/24", "m/25", "m/26", "m/27", "m/28", "m/29", + "m/30", "m/31", "m/32", "m/33", "m/34", "m/35", "m/36", "m/37", "m/38", "m/39", + "m/40", "m/41", "m/42", "m/43", "m/44", "m/45", "m/46", "m/47", "m/48", "m/49", + "m/50", "m/51", "m/52", "m/53", "m/54", "m/55", "m/56", "m/57", "m/58", "m/59", + "m/60", "m/61", "m/62", "m/63", "m/64", "m/65", "m/66", "m/67", "m/68", "m/69", + "m/70", "m/71", "m/72", "m/73", "m/74", "m/75", "m/76", "m/77", "m/78", "m/79", + "m/80", "m/81", "m/82", "m/83", "m/84", "m/85", "m/86", "m/87", "m/88", "m/89", + "m/90", "m/91", "m/92", "m/93", "m/94", "m/95", "m/96", "m/97", "m/98", "m/99", + "m/100", "m/101", "m/102", "m/103", "m/104", "m/105", "m/106", "m/107", "m/108", "m/109", + "m/110", "m/111", "m/112", "m/113", "m/114", "m/115", "m/116", "m/117", "m/118", "m/119", + "m/120", "m/121", "m/122", "m/123", "m/124", "m/125", "m/126", "m/127", "m/128", "m/129", + "m/130", "m/131", "m/132", "m/133", "m/134", "m/135", "m/136", "m/137", "m/138", "m/139", + "m/140", "m/141", "m/142", "m/143", "m/144", "m/145", "m/146", "m/147", "m/148", "m/149", + "m/150", "m/151", "m/152", "m/153", "m/154", "m/155", "m/156", "m/157", "m/158", "m/159", + "m/160", "m/161", "m/162", "m/163", "m/164", "m/165", "m/166", "m/167", "m/168", "m/169", + "m/170", "m/171", "m/172", "m/173", "m/174", "m/175", "m/176", "m/177", "m/178", "m/179", + "m/180", "m/181", "m/182", "m/183", "m/184", "m/185", "m/186", "m/187", "m/188", "m/189", + "m/190", "m/191", "m/192", "m/193", "m/194", "m/195", "m/196", "m/197", "m/198", "m/199", + "m/200", "m/201", "m/202", "m/203", "m/204", "m/205", "m/206", "m/207", "m/208", "m/209", + "m/210", "m/211", "m/212", "m/213", "m/214", "m/215", "m/216", "m/217", "m/218", "m/219", + "m/220", "m/221", "m/222", "m/223", "m/224", "m/225", "m/226", "m/227", "m/228", "m/229", + "m/230", "m/231", "m/232", "m/233", "m/234", "m/235", "m/236", "m/237", "m/238", "m/239", + "m/240", "m/241", "m/242", "m/243", "m/244", "m/245", "m/246", "m/247", "m/248", "m/249", + "m/250", "m/251", "m/252", "m/253", "m/254" + ], + "expected": "ff0100000000010000000101000000020100000003010000000401000000050100000006010000000701000000080100000009010000000a010000000b010000000c010000000d010000000e010000000f0100000010010000001101000000120100000013010000001401000000150100000016010000001701000000180100000019010000001a010000001b010000001c010000001d010000001e010000001f0100000020010000002101000000220100000023010000002401000000250100000026010000002701000000280100000029010000002a010000002b010000002c010000002d010000002e010000002f0100000030010000003101000000320100000033010000003401000000350100000036010000003701000000380100000039010000003a010000003b010000003c010000003d010000003e010000003f0100000040010000004101000000420100000043010000004401000000450100000046010000004701000000480100000049010000004a010000004b010000004c010000004d010000004e010000004f0100000050010000005101000000520100000053010000005401000000550100000056010000005701000000580100000059010000005a010000005b010000005c010000005d010000005e010000005f0100000060010000006101000000620100000063010000006401000000650100000066010000006701000000680100000069010000006a010000006b010000006c010000006d010000006e010000006f0100000070010000007101000000720100000073010000007401000000750100000076010000007701000000780100000079010000007a010000007b010000007c010000007d010000007e010000007f0100000080010000008101000000820100000083010000008401000000850100000086010000008701000000880100000089010000008a010000008b010000008c010000008d010000008e010000008f0100000090010000009101000000920100000093010000009401000000950100000096010000009701000000980100000099010000009a010000009b010000009c010000009d010000009e010000009f01000000a001000000a101000000a201000000a301000000a401000000a501000000a601000000a701000000a801000000a901000000aa01000000ab01000000ac01000000ad01000000ae01000000af01000000b001000000b101000000b201000000b301000000b401000000b501000000b601000000b701000000b801000000b901000000ba01000000bb01000000bc01000000bd01000000be01000000bf01000000c001000000c101000000c201000000c301000000c401000000c501000000c601000000c701000000c801000000c901000000ca01000000cb01000000cc01000000cd01000000ce01000000cf01000000d001000000d101000000d201000000d301000000d401000000d501000000d601000000d701000000d801000000d901000000da01000000db01000000dc01000000dd01000000de01000000df01000000e001000000e101000000e201000000e301000000e401000000e501000000e601000000e701000000e801000000e901000000ea01000000eb01000000ec01000000ed01000000ee01000000ef01000000f001000000f101000000f201000000f301000000f401000000f501000000f601000000f701000000f801000000f901000000fa01000000fb01000000fc01000000fd01000000fe" + } +] diff --git a/bip-encrypted-backup/test_vectors/encrypted_backup.json b/bip-encrypted-backup/test_vectors/encrypted_backup.json new file mode 100644 index 0000000000..b61acd7f0f --- /dev/null +++ b/bip-encrypted-backup/test_vectors/encrypted_backup.json @@ -0,0 +1,57 @@ +[ + { + "description": "Single key, no derivation paths, BIP380 content", + "version": 1, + "encryption": 1, + "content": "01017c", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "derivation_paths": [], + "plaintext": "00", + "nonce": "a1b2c3d4e5f607080910a1b2", + "expected": "TBD" + }, + { + "description": "Two keys, 1 derivation path, BIP380 content", + "version": 1, + "encryption": 1, + "content": "01017c", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07" + ], + "derivation_paths": ["m/48'/1'/0'/2'"], + "plaintext": "wsh(or_d(pk([9d69155f/48'/1'/0'/2']tpubDDxT9mkZzWwkKwpGT5fY6iiM9muYTPkTx6Eig8dpHR7TChuGGCWYAHVmpW1ciido5RiFWwjzYsF1GZHkEHg2nrYp3zNtx3QQRkznyLhQ77x/<0;1>/*),and_v(v:pkh([9d69155f/48'/1'/0'/2']tpubDDxT9mkZzWwkKwpGT5fY6iiM9muYTPkTx6Eig8dpHR7TChuGGCWYAHVmpW1ciido5RiFWwjzYsF1GZHkEHg2nrYp3zNtx3QQRkznyLhQ77x/<2;3>/*),older(52596))))#gx5f42wh", + "nonce": "0102030405060708090a0b0c", + "expected": "TBD" + }, + { + "description": "Three keys, multiple derivation paths, BIP329 content", + "version": 1, + "encryption": 1, + "content": "010149", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07", + "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5" + ], + "derivation_paths": ["m/84'/0'/0'", "m/0/1'/2/3'"], + "plaintext": "{\"type\":\"tx\",\"ref\":\"f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd\",\"label\":\"Transaction\",\"origin\":\"wpkh([d34db33f/84'/0'/0'])\"}\n{\"type\":\"addr\",\"ref\":\"bc1q34aq5drpuwy3wgl9lhup9892qp6svr8ldzyy7c\",\"label\":\"Address\"}\n{\"type\":\"pubkey\",\"ref\":\"0283409659355b6d1cc3c32decd5d561abaac86c37a353b52895a5e6c196d6f448\",\"label\":\"Public Key\"}\n{\"type\":\"input\",\"ref\":\"f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd:0\",\"label\":\"Input\"}\n{\"type\":\"output\",\"ref\":\"f91d0a8a78462bc59398f2c5d7a84fcff491c26ba54c4833478b202796c8aafd:1\",\"label\":\"Output\",\"spendable\":false}\n{\"type\":\"xpub\",\"ref\":\"xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8\",\"label\":\"Extended Public Key\"}\n{\"type\":\"tx\",\"ref\":\"f546156d9044844e02b181026a1a407abfca62e7ea1159f87bbeaa77b4286c74\",\"label\":\"Account #1 Transaction\",\"origin\":\"wpkh([d34db33f/84'/0'/1'])\"}", + "nonce": "deadbeefcafebabe12345678", + "expected": "TBD" + }, + { + "description": "Single key, vendor-specific content (4 bytes)", + "version": 1, + "encryption": 1, + "content": "0204deadbeef", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "derivation_paths": [], + "plaintext": "706c61696e74657874", + "nonce": "000102030405060708090a0b", + "expected": "TBD" + } +] diff --git a/bip-encrypted-backup/test_vectors/encryption_secret.json b/bip-encrypted-backup/test_vectors/encryption_secret.json new file mode 100644 index 0000000000..ccee9b70d4 --- /dev/null +++ b/bip-encrypted-backup/test_vectors/encryption_secret.json @@ -0,0 +1,89 @@ +[ + { + "description": "Single public key", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD" + ] + }, + { + "description": "Two public keys", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD", + "TBD" + ] + }, + { + "description": "Three public keys", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07", + "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD", + "TBD", + "TBD" + ] + }, + { + "description": "Three public keys bis (different sorting)", + "keys": [ + "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD", + "TBD", + "TBD" + ] + }, + { + "description": "Three public keys ter (different sorting)", + "keys": [ + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07", + "c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5", + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD", + "TBD", + "TBD" + ] + }, + { + "description": "Keys processed in sorted order", + "keys": [ + "84526253c27c7aef56c7b71a5cd25bebb66dddda437826defc5b2568bde81f07", + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD", + "TBD" + ] + }, + { + "description": "Duplicate keys should be handled", + "keys": [ + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443", + "e6642fd69bd211f93f7f1f36ca51a26a5290eb2dd1b0d8279a87bb0d480c8443" + ], + "decryption_secret": "TBD", + "individual_secrets": [ + "TBD" + ] + } +] diff --git a/bip-encrypted-backup/test_vectors/individual_secrets.json b/bip-encrypted-backup/test_vectors/individual_secrets.json new file mode 100644 index 0000000000..8e4f1a4812 --- /dev/null +++ b/bip-encrypted-backup/test_vectors/individual_secrets.json @@ -0,0 +1,554 @@ +[ + { + "description": "Single secret", + "secrets": [ + "0000000000000000000000000000000000000000000000000000000000000000" + ], + "expected": "010000000000000000000000000000000000000000000000000000000000000000" + }, + { + "description": "Two different secrets", + "secrets": [ + "0000000000000000000000000000000000000000000000000000000000000000", + "0101010101010101010101010101010101010101010101010101010101010101" + ], + "expected": "0200000000000000000000000000000000000000000000000000000000000000000101010101010101010101010101010101010101010101010101010101010101" + }, + { + "description": "Three secrets with different patterns", + "secrets": [ + "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0000000000000000000000000000000000000000000000000000000000000000", + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + ], + "expected": "030000000000000000000000000000000000000000000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + }, + { + "description": "Empty secrets should fail", + "secrets": [], + "expected": null + }, + { + "description": "256 secrets should fail (exceeds u8::MAX)", + "secrets": [ + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000002", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000005", + "0000000000000000000000000000000000000000000000000000000000000006", + "0000000000000000000000000000000000000000000000000000000000000007", + "0000000000000000000000000000000000000000000000000000000000000008", + "0000000000000000000000000000000000000000000000000000000000000009", + "000000000000000000000000000000000000000000000000000000000000000a", + "000000000000000000000000000000000000000000000000000000000000000b", + "000000000000000000000000000000000000000000000000000000000000000c", + "000000000000000000000000000000000000000000000000000000000000000d", + "000000000000000000000000000000000000000000000000000000000000000e", + "000000000000000000000000000000000000000000000000000000000000000f", + "0000000000000000000000000000000000000000000000000000000000000010", + "0000000000000000000000000000000000000000000000000000000000000011", + "0000000000000000000000000000000000000000000000000000000000000012", + "0000000000000000000000000000000000000000000000000000000000000013", + "0000000000000000000000000000000000000000000000000000000000000014", + "0000000000000000000000000000000000000000000000000000000000000015", + "0000000000000000000000000000000000000000000000000000000000000016", + "0000000000000000000000000000000000000000000000000000000000000017", + "0000000000000000000000000000000000000000000000000000000000000018", + "0000000000000000000000000000000000000000000000000000000000000019", + "000000000000000000000000000000000000000000000000000000000000001a", + "000000000000000000000000000000000000000000000000000000000000001b", + "000000000000000000000000000000000000000000000000000000000000001c", + "000000000000000000000000000000000000000000000000000000000000001d", + "000000000000000000000000000000000000000000000000000000000000001e", + "000000000000000000000000000000000000000000000000000000000000001f", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000021", + "0000000000000000000000000000000000000000000000000000000000000022", + "0000000000000000000000000000000000000000000000000000000000000023", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000025", + "0000000000000000000000000000000000000000000000000000000000000026", + "0000000000000000000000000000000000000000000000000000000000000027", + "0000000000000000000000000000000000000000000000000000000000000028", + "0000000000000000000000000000000000000000000000000000000000000029", + "000000000000000000000000000000000000000000000000000000000000002a", + "000000000000000000000000000000000000000000000000000000000000002b", + "000000000000000000000000000000000000000000000000000000000000002c", + "000000000000000000000000000000000000000000000000000000000000002d", + "000000000000000000000000000000000000000000000000000000000000002e", + "000000000000000000000000000000000000000000000000000000000000002f", + "0000000000000000000000000000000000000000000000000000000000000030", + "0000000000000000000000000000000000000000000000000000000000000031", + "0000000000000000000000000000000000000000000000000000000000000032", + "0000000000000000000000000000000000000000000000000000000000000033", + "0000000000000000000000000000000000000000000000000000000000000034", + "0000000000000000000000000000000000000000000000000000000000000035", + "0000000000000000000000000000000000000000000000000000000000000036", + "0000000000000000000000000000000000000000000000000000000000000037", + "0000000000000000000000000000000000000000000000000000000000000038", + "0000000000000000000000000000000000000000000000000000000000000039", + "000000000000000000000000000000000000000000000000000000000000003a", + "000000000000000000000000000000000000000000000000000000000000003b", + "000000000000000000000000000000000000000000000000000000000000003c", + "000000000000000000000000000000000000000000000000000000000000003d", + "000000000000000000000000000000000000000000000000000000000000003e", + "000000000000000000000000000000000000000000000000000000000000003f", + "0000000000000000000000000000000000000000000000000000000000000040", + "0000000000000000000000000000000000000000000000000000000000000041", + "0000000000000000000000000000000000000000000000000000000000000042", + "0000000000000000000000000000000000000000000000000000000000000043", + "0000000000000000000000000000000000000000000000000000000000000044", + "0000000000000000000000000000000000000000000000000000000000000045", + "0000000000000000000000000000000000000000000000000000000000000046", + "0000000000000000000000000000000000000000000000000000000000000047", + "0000000000000000000000000000000000000000000000000000000000000048", + "0000000000000000000000000000000000000000000000000000000000000049", + "000000000000000000000000000000000000000000000000000000000000004a", + "000000000000000000000000000000000000000000000000000000000000004b", + "000000000000000000000000000000000000000000000000000000000000004c", + "000000000000000000000000000000000000000000000000000000000000004d", + "000000000000000000000000000000000000000000000000000000000000004e", + "000000000000000000000000000000000000000000000000000000000000004f", + "0000000000000000000000000000000000000000000000000000000000000050", + "0000000000000000000000000000000000000000000000000000000000000051", + "0000000000000000000000000000000000000000000000000000000000000052", + "0000000000000000000000000000000000000000000000000000000000000053", + "0000000000000000000000000000000000000000000000000000000000000054", + "0000000000000000000000000000000000000000000000000000000000000055", + "0000000000000000000000000000000000000000000000000000000000000056", + "0000000000000000000000000000000000000000000000000000000000000057", + "0000000000000000000000000000000000000000000000000000000000000058", + "0000000000000000000000000000000000000000000000000000000000000059", + "000000000000000000000000000000000000000000000000000000000000005a", + "000000000000000000000000000000000000000000000000000000000000005b", + "000000000000000000000000000000000000000000000000000000000000005c", + "000000000000000000000000000000000000000000000000000000000000005d", + "000000000000000000000000000000000000000000000000000000000000005e", + "000000000000000000000000000000000000000000000000000000000000005f", + "0000000000000000000000000000000000000000000000000000000000000060", + "0000000000000000000000000000000000000000000000000000000000000061", + "0000000000000000000000000000000000000000000000000000000000000062", + "0000000000000000000000000000000000000000000000000000000000000063", + "0000000000000000000000000000000000000000000000000000000000000064", + "0000000000000000000000000000000000000000000000000000000000000065", + "0000000000000000000000000000000000000000000000000000000000000066", + "0000000000000000000000000000000000000000000000000000000000000067", + "0000000000000000000000000000000000000000000000000000000000000068", + "0000000000000000000000000000000000000000000000000000000000000069", + "000000000000000000000000000000000000000000000000000000000000006a", + "000000000000000000000000000000000000000000000000000000000000006b", + "000000000000000000000000000000000000000000000000000000000000006c", + "000000000000000000000000000000000000000000000000000000000000006d", + "000000000000000000000000000000000000000000000000000000000000006e", + "000000000000000000000000000000000000000000000000000000000000006f", + "0000000000000000000000000000000000000000000000000000000000000070", + "0000000000000000000000000000000000000000000000000000000000000071", + "0000000000000000000000000000000000000000000000000000000000000072", + "0000000000000000000000000000000000000000000000000000000000000073", + "0000000000000000000000000000000000000000000000000000000000000074", + "0000000000000000000000000000000000000000000000000000000000000075", + "0000000000000000000000000000000000000000000000000000000000000076", + "0000000000000000000000000000000000000000000000000000000000000077", + "0000000000000000000000000000000000000000000000000000000000000078", + "0000000000000000000000000000000000000000000000000000000000000079", + "000000000000000000000000000000000000000000000000000000000000007a", + "000000000000000000000000000000000000000000000000000000000000007b", + "000000000000000000000000000000000000000000000000000000000000007c", + "000000000000000000000000000000000000000000000000000000000000007d", + "000000000000000000000000000000000000000000000000000000000000007e", + "000000000000000000000000000000000000000000000000000000000000007f", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000081", + "0000000000000000000000000000000000000000000000000000000000000082", + "0000000000000000000000000000000000000000000000000000000000000083", + "0000000000000000000000000000000000000000000000000000000000000084", + "0000000000000000000000000000000000000000000000000000000000000085", + "0000000000000000000000000000000000000000000000000000000000000086", + "0000000000000000000000000000000000000000000000000000000000000087", + "0000000000000000000000000000000000000000000000000000000000000088", + "0000000000000000000000000000000000000000000000000000000000000089", + "000000000000000000000000000000000000000000000000000000000000008a", + "000000000000000000000000000000000000000000000000000000000000008b", + "000000000000000000000000000000000000000000000000000000000000008c", + "000000000000000000000000000000000000000000000000000000000000008d", + "000000000000000000000000000000000000000000000000000000000000008e", + "000000000000000000000000000000000000000000000000000000000000008f", + "0000000000000000000000000000000000000000000000000000000000000090", + "0000000000000000000000000000000000000000000000000000000000000091", + "0000000000000000000000000000000000000000000000000000000000000092", + "0000000000000000000000000000000000000000000000000000000000000093", + "0000000000000000000000000000000000000000000000000000000000000094", + "0000000000000000000000000000000000000000000000000000000000000095", + "0000000000000000000000000000000000000000000000000000000000000096", + "0000000000000000000000000000000000000000000000000000000000000097", + "0000000000000000000000000000000000000000000000000000000000000098", + "0000000000000000000000000000000000000000000000000000000000000099", + "000000000000000000000000000000000000000000000000000000000000009a", + "000000000000000000000000000000000000000000000000000000000000009b", + "000000000000000000000000000000000000000000000000000000000000009c", + "000000000000000000000000000000000000000000000000000000000000009d", + "000000000000000000000000000000000000000000000000000000000000009e", + "000000000000000000000000000000000000000000000000000000000000009f", + "00000000000000000000000000000000000000000000000000000000000000a0", + "00000000000000000000000000000000000000000000000000000000000000a1", + "00000000000000000000000000000000000000000000000000000000000000a2", + "00000000000000000000000000000000000000000000000000000000000000a3", + "00000000000000000000000000000000000000000000000000000000000000a4", + "00000000000000000000000000000000000000000000000000000000000000a5", + "00000000000000000000000000000000000000000000000000000000000000a6", + "00000000000000000000000000000000000000000000000000000000000000a7", + "00000000000000000000000000000000000000000000000000000000000000a8", + "00000000000000000000000000000000000000000000000000000000000000a9", + "00000000000000000000000000000000000000000000000000000000000000aa", + "00000000000000000000000000000000000000000000000000000000000000ab", + "00000000000000000000000000000000000000000000000000000000000000ac", + "00000000000000000000000000000000000000000000000000000000000000ad", + "00000000000000000000000000000000000000000000000000000000000000ae", + "00000000000000000000000000000000000000000000000000000000000000af", + "00000000000000000000000000000000000000000000000000000000000000b0", + "00000000000000000000000000000000000000000000000000000000000000b1", + "00000000000000000000000000000000000000000000000000000000000000b2", + "00000000000000000000000000000000000000000000000000000000000000b3", + "00000000000000000000000000000000000000000000000000000000000000b4", + "00000000000000000000000000000000000000000000000000000000000000b5", + "00000000000000000000000000000000000000000000000000000000000000b6", + "00000000000000000000000000000000000000000000000000000000000000b7", + "00000000000000000000000000000000000000000000000000000000000000b8", + "00000000000000000000000000000000000000000000000000000000000000b9", + "00000000000000000000000000000000000000000000000000000000000000ba", + "00000000000000000000000000000000000000000000000000000000000000bb", + "00000000000000000000000000000000000000000000000000000000000000bc", + "00000000000000000000000000000000000000000000000000000000000000bd", + "00000000000000000000000000000000000000000000000000000000000000be", + "00000000000000000000000000000000000000000000000000000000000000bf", + "00000000000000000000000000000000000000000000000000000000000000c0", + "00000000000000000000000000000000000000000000000000000000000000c1", + "00000000000000000000000000000000000000000000000000000000000000c2", + "00000000000000000000000000000000000000000000000000000000000000c3", + "00000000000000000000000000000000000000000000000000000000000000c4", + "00000000000000000000000000000000000000000000000000000000000000c5", + "00000000000000000000000000000000000000000000000000000000000000c6", + "00000000000000000000000000000000000000000000000000000000000000c7", + "00000000000000000000000000000000000000000000000000000000000000c8", + "00000000000000000000000000000000000000000000000000000000000000c9", + "00000000000000000000000000000000000000000000000000000000000000ca", + "00000000000000000000000000000000000000000000000000000000000000cb", + "00000000000000000000000000000000000000000000000000000000000000cc", + "00000000000000000000000000000000000000000000000000000000000000cd", + "00000000000000000000000000000000000000000000000000000000000000ce", + "00000000000000000000000000000000000000000000000000000000000000cf", + "00000000000000000000000000000000000000000000000000000000000000d0", + "00000000000000000000000000000000000000000000000000000000000000d1", + "00000000000000000000000000000000000000000000000000000000000000d2", + "00000000000000000000000000000000000000000000000000000000000000d3", + "00000000000000000000000000000000000000000000000000000000000000d4", + "00000000000000000000000000000000000000000000000000000000000000d5", + "00000000000000000000000000000000000000000000000000000000000000d6", + "00000000000000000000000000000000000000000000000000000000000000d7", + "00000000000000000000000000000000000000000000000000000000000000d8", + "00000000000000000000000000000000000000000000000000000000000000d9", + "00000000000000000000000000000000000000000000000000000000000000da", + "00000000000000000000000000000000000000000000000000000000000000db", + "00000000000000000000000000000000000000000000000000000000000000dc", + "00000000000000000000000000000000000000000000000000000000000000dd", + "00000000000000000000000000000000000000000000000000000000000000de", + "00000000000000000000000000000000000000000000000000000000000000df", + "00000000000000000000000000000000000000000000000000000000000000e0", + "00000000000000000000000000000000000000000000000000000000000000e1", + "00000000000000000000000000000000000000000000000000000000000000e2", + "00000000000000000000000000000000000000000000000000000000000000e3", + "00000000000000000000000000000000000000000000000000000000000000e4", + "00000000000000000000000000000000000000000000000000000000000000e5", + "00000000000000000000000000000000000000000000000000000000000000e6", + "00000000000000000000000000000000000000000000000000000000000000e7", + "00000000000000000000000000000000000000000000000000000000000000e8", + "00000000000000000000000000000000000000000000000000000000000000e9", + "00000000000000000000000000000000000000000000000000000000000000ea", + "00000000000000000000000000000000000000000000000000000000000000eb", + "00000000000000000000000000000000000000000000000000000000000000ec", + "00000000000000000000000000000000000000000000000000000000000000ed", + "00000000000000000000000000000000000000000000000000000000000000ee", + "00000000000000000000000000000000000000000000000000000000000000ef", + "00000000000000000000000000000000000000000000000000000000000000f0", + "00000000000000000000000000000000000000000000000000000000000000f1", + "00000000000000000000000000000000000000000000000000000000000000f2", + "00000000000000000000000000000000000000000000000000000000000000f3", + "00000000000000000000000000000000000000000000000000000000000000f4", + "00000000000000000000000000000000000000000000000000000000000000f5", + "00000000000000000000000000000000000000000000000000000000000000f6", + "00000000000000000000000000000000000000000000000000000000000000f7", + "00000000000000000000000000000000000000000000000000000000000000f8", + "00000000000000000000000000000000000000000000000000000000000000f9", + "00000000000000000000000000000000000000000000000000000000000000fa", + "00000000000000000000000000000000000000000000000000000000000000fb", + "00000000000000000000000000000000000000000000000000000000000000fc", + "00000000000000000000000000000000000000000000000000000000000000fd", + "00000000000000000000000000000000000000000000000000000000000000fe", + "00000000000000000000000000000000000000000000000000000000000000ff" + ], + "expected": null + }, + { + "description": "256 secrets should pass)", + "secrets": [ + "0000000000000000000000000000000000000000000000000000000000000000", + "0000000000000000000000000000000000000000000000000000000000000001", + "0000000000000000000000000000000000000000000000000000000000000002", + "0000000000000000000000000000000000000000000000000000000000000003", + "0000000000000000000000000000000000000000000000000000000000000004", + "0000000000000000000000000000000000000000000000000000000000000005", + "0000000000000000000000000000000000000000000000000000000000000006", + "0000000000000000000000000000000000000000000000000000000000000007", + "0000000000000000000000000000000000000000000000000000000000000008", + "0000000000000000000000000000000000000000000000000000000000000009", + "000000000000000000000000000000000000000000000000000000000000000a", + "000000000000000000000000000000000000000000000000000000000000000b", + "000000000000000000000000000000000000000000000000000000000000000c", + "000000000000000000000000000000000000000000000000000000000000000d", + "000000000000000000000000000000000000000000000000000000000000000e", + "000000000000000000000000000000000000000000000000000000000000000f", + "0000000000000000000000000000000000000000000000000000000000000010", + "0000000000000000000000000000000000000000000000000000000000000011", + "0000000000000000000000000000000000000000000000000000000000000012", + "0000000000000000000000000000000000000000000000000000000000000013", + "0000000000000000000000000000000000000000000000000000000000000014", + "0000000000000000000000000000000000000000000000000000000000000015", + "0000000000000000000000000000000000000000000000000000000000000016", + "0000000000000000000000000000000000000000000000000000000000000017", + "0000000000000000000000000000000000000000000000000000000000000018", + "0000000000000000000000000000000000000000000000000000000000000019", + "000000000000000000000000000000000000000000000000000000000000001a", + "000000000000000000000000000000000000000000000000000000000000001b", + "000000000000000000000000000000000000000000000000000000000000001c", + "000000000000000000000000000000000000000000000000000000000000001d", + "000000000000000000000000000000000000000000000000000000000000001e", + "000000000000000000000000000000000000000000000000000000000000001f", + "0000000000000000000000000000000000000000000000000000000000000020", + "0000000000000000000000000000000000000000000000000000000000000021", + "0000000000000000000000000000000000000000000000000000000000000022", + "0000000000000000000000000000000000000000000000000000000000000023", + "0000000000000000000000000000000000000000000000000000000000000024", + "0000000000000000000000000000000000000000000000000000000000000025", + "0000000000000000000000000000000000000000000000000000000000000026", + "0000000000000000000000000000000000000000000000000000000000000027", + "0000000000000000000000000000000000000000000000000000000000000028", + "0000000000000000000000000000000000000000000000000000000000000029", + "000000000000000000000000000000000000000000000000000000000000002a", + "000000000000000000000000000000000000000000000000000000000000002b", + "000000000000000000000000000000000000000000000000000000000000002c", + "000000000000000000000000000000000000000000000000000000000000002d", + "000000000000000000000000000000000000000000000000000000000000002e", + "000000000000000000000000000000000000000000000000000000000000002f", + "0000000000000000000000000000000000000000000000000000000000000030", + "0000000000000000000000000000000000000000000000000000000000000031", + "0000000000000000000000000000000000000000000000000000000000000032", + "0000000000000000000000000000000000000000000000000000000000000033", + "0000000000000000000000000000000000000000000000000000000000000034", + "0000000000000000000000000000000000000000000000000000000000000035", + "0000000000000000000000000000000000000000000000000000000000000036", + "0000000000000000000000000000000000000000000000000000000000000037", + "0000000000000000000000000000000000000000000000000000000000000038", + "0000000000000000000000000000000000000000000000000000000000000039", + "000000000000000000000000000000000000000000000000000000000000003a", + "000000000000000000000000000000000000000000000000000000000000003b", + "000000000000000000000000000000000000000000000000000000000000003c", + "000000000000000000000000000000000000000000000000000000000000003d", + "000000000000000000000000000000000000000000000000000000000000003e", + "000000000000000000000000000000000000000000000000000000000000003f", + "0000000000000000000000000000000000000000000000000000000000000040", + "0000000000000000000000000000000000000000000000000000000000000041", + "0000000000000000000000000000000000000000000000000000000000000042", + "0000000000000000000000000000000000000000000000000000000000000043", + "0000000000000000000000000000000000000000000000000000000000000044", + "0000000000000000000000000000000000000000000000000000000000000045", + "0000000000000000000000000000000000000000000000000000000000000046", + "0000000000000000000000000000000000000000000000000000000000000047", + "0000000000000000000000000000000000000000000000000000000000000048", + "0000000000000000000000000000000000000000000000000000000000000049", + "000000000000000000000000000000000000000000000000000000000000004a", + "000000000000000000000000000000000000000000000000000000000000004b", + "000000000000000000000000000000000000000000000000000000000000004c", + "000000000000000000000000000000000000000000000000000000000000004d", + "000000000000000000000000000000000000000000000000000000000000004e", + "000000000000000000000000000000000000000000000000000000000000004f", + "0000000000000000000000000000000000000000000000000000000000000050", + "0000000000000000000000000000000000000000000000000000000000000051", + "0000000000000000000000000000000000000000000000000000000000000052", + "0000000000000000000000000000000000000000000000000000000000000053", + "0000000000000000000000000000000000000000000000000000000000000054", + "0000000000000000000000000000000000000000000000000000000000000055", + "0000000000000000000000000000000000000000000000000000000000000056", + "0000000000000000000000000000000000000000000000000000000000000057", + "0000000000000000000000000000000000000000000000000000000000000058", + "0000000000000000000000000000000000000000000000000000000000000059", + "000000000000000000000000000000000000000000000000000000000000005a", + "000000000000000000000000000000000000000000000000000000000000005b", + "000000000000000000000000000000000000000000000000000000000000005c", + "000000000000000000000000000000000000000000000000000000000000005d", + "000000000000000000000000000000000000000000000000000000000000005e", + "000000000000000000000000000000000000000000000000000000000000005f", + "0000000000000000000000000000000000000000000000000000000000000060", + "0000000000000000000000000000000000000000000000000000000000000061", + "0000000000000000000000000000000000000000000000000000000000000062", + "0000000000000000000000000000000000000000000000000000000000000063", + "0000000000000000000000000000000000000000000000000000000000000064", + "0000000000000000000000000000000000000000000000000000000000000065", + "0000000000000000000000000000000000000000000000000000000000000066", + "0000000000000000000000000000000000000000000000000000000000000067", + "0000000000000000000000000000000000000000000000000000000000000068", + "0000000000000000000000000000000000000000000000000000000000000069", + "000000000000000000000000000000000000000000000000000000000000006a", + "000000000000000000000000000000000000000000000000000000000000006b", + "000000000000000000000000000000000000000000000000000000000000006c", + "000000000000000000000000000000000000000000000000000000000000006d", + "000000000000000000000000000000000000000000000000000000000000006e", + "000000000000000000000000000000000000000000000000000000000000006f", + "0000000000000000000000000000000000000000000000000000000000000070", + "0000000000000000000000000000000000000000000000000000000000000071", + "0000000000000000000000000000000000000000000000000000000000000072", + "0000000000000000000000000000000000000000000000000000000000000073", + "0000000000000000000000000000000000000000000000000000000000000074", + "0000000000000000000000000000000000000000000000000000000000000075", + "0000000000000000000000000000000000000000000000000000000000000076", + "0000000000000000000000000000000000000000000000000000000000000077", + "0000000000000000000000000000000000000000000000000000000000000078", + "0000000000000000000000000000000000000000000000000000000000000079", + "000000000000000000000000000000000000000000000000000000000000007a", + "000000000000000000000000000000000000000000000000000000000000007b", + "000000000000000000000000000000000000000000000000000000000000007c", + "000000000000000000000000000000000000000000000000000000000000007d", + "000000000000000000000000000000000000000000000000000000000000007e", + "000000000000000000000000000000000000000000000000000000000000007f", + "0000000000000000000000000000000000000000000000000000000000000080", + "0000000000000000000000000000000000000000000000000000000000000081", + "0000000000000000000000000000000000000000000000000000000000000082", + "0000000000000000000000000000000000000000000000000000000000000083", + "0000000000000000000000000000000000000000000000000000000000000084", + "0000000000000000000000000000000000000000000000000000000000000085", + "0000000000000000000000000000000000000000000000000000000000000086", + "0000000000000000000000000000000000000000000000000000000000000087", + "0000000000000000000000000000000000000000000000000000000000000088", + "0000000000000000000000000000000000000000000000000000000000000089", + "000000000000000000000000000000000000000000000000000000000000008a", + "000000000000000000000000000000000000000000000000000000000000008b", + "000000000000000000000000000000000000000000000000000000000000008c", + "000000000000000000000000000000000000000000000000000000000000008d", + "000000000000000000000000000000000000000000000000000000000000008e", + "000000000000000000000000000000000000000000000000000000000000008f", + "0000000000000000000000000000000000000000000000000000000000000090", + "0000000000000000000000000000000000000000000000000000000000000091", + "0000000000000000000000000000000000000000000000000000000000000092", + "0000000000000000000000000000000000000000000000000000000000000093", + "0000000000000000000000000000000000000000000000000000000000000094", + "0000000000000000000000000000000000000000000000000000000000000095", + "0000000000000000000000000000000000000000000000000000000000000096", + "0000000000000000000000000000000000000000000000000000000000000097", + "0000000000000000000000000000000000000000000000000000000000000098", + "0000000000000000000000000000000000000000000000000000000000000099", + "000000000000000000000000000000000000000000000000000000000000009a", + "000000000000000000000000000000000000000000000000000000000000009b", + "000000000000000000000000000000000000000000000000000000000000009c", + "000000000000000000000000000000000000000000000000000000000000009d", + "000000000000000000000000000000000000000000000000000000000000009e", + "000000000000000000000000000000000000000000000000000000000000009f", + "00000000000000000000000000000000000000000000000000000000000000a0", + "00000000000000000000000000000000000000000000000000000000000000a1", + "00000000000000000000000000000000000000000000000000000000000000a2", + "00000000000000000000000000000000000000000000000000000000000000a3", + "00000000000000000000000000000000000000000000000000000000000000a4", + "00000000000000000000000000000000000000000000000000000000000000a5", + "00000000000000000000000000000000000000000000000000000000000000a6", + "00000000000000000000000000000000000000000000000000000000000000a7", + "00000000000000000000000000000000000000000000000000000000000000a8", + "00000000000000000000000000000000000000000000000000000000000000a9", + "00000000000000000000000000000000000000000000000000000000000000aa", + "00000000000000000000000000000000000000000000000000000000000000ab", + "00000000000000000000000000000000000000000000000000000000000000ac", + "00000000000000000000000000000000000000000000000000000000000000ad", + "00000000000000000000000000000000000000000000000000000000000000ae", + "00000000000000000000000000000000000000000000000000000000000000af", + "00000000000000000000000000000000000000000000000000000000000000b0", + "00000000000000000000000000000000000000000000000000000000000000b1", + "00000000000000000000000000000000000000000000000000000000000000b2", + "00000000000000000000000000000000000000000000000000000000000000b3", + "00000000000000000000000000000000000000000000000000000000000000b4", + "00000000000000000000000000000000000000000000000000000000000000b5", + "00000000000000000000000000000000000000000000000000000000000000b6", + "00000000000000000000000000000000000000000000000000000000000000b7", + "00000000000000000000000000000000000000000000000000000000000000b8", + "00000000000000000000000000000000000000000000000000000000000000b9", + "00000000000000000000000000000000000000000000000000000000000000ba", + "00000000000000000000000000000000000000000000000000000000000000bb", + "00000000000000000000000000000000000000000000000000000000000000bc", + "00000000000000000000000000000000000000000000000000000000000000bd", + "00000000000000000000000000000000000000000000000000000000000000be", + "00000000000000000000000000000000000000000000000000000000000000bf", + "00000000000000000000000000000000000000000000000000000000000000c0", + "00000000000000000000000000000000000000000000000000000000000000c1", + "00000000000000000000000000000000000000000000000000000000000000c2", + "00000000000000000000000000000000000000000000000000000000000000c3", + "00000000000000000000000000000000000000000000000000000000000000c4", + "00000000000000000000000000000000000000000000000000000000000000c5", + "00000000000000000000000000000000000000000000000000000000000000c6", + "00000000000000000000000000000000000000000000000000000000000000c7", + "00000000000000000000000000000000000000000000000000000000000000c8", + "00000000000000000000000000000000000000000000000000000000000000c9", + "00000000000000000000000000000000000000000000000000000000000000ca", + "00000000000000000000000000000000000000000000000000000000000000cb", + "00000000000000000000000000000000000000000000000000000000000000cc", + "00000000000000000000000000000000000000000000000000000000000000cd", + "00000000000000000000000000000000000000000000000000000000000000ce", + "00000000000000000000000000000000000000000000000000000000000000cf", + "00000000000000000000000000000000000000000000000000000000000000d0", + "00000000000000000000000000000000000000000000000000000000000000d1", + "00000000000000000000000000000000000000000000000000000000000000d2", + "00000000000000000000000000000000000000000000000000000000000000d3", + "00000000000000000000000000000000000000000000000000000000000000d4", + "00000000000000000000000000000000000000000000000000000000000000d5", + "00000000000000000000000000000000000000000000000000000000000000d6", + "00000000000000000000000000000000000000000000000000000000000000d7", + "00000000000000000000000000000000000000000000000000000000000000d8", + "00000000000000000000000000000000000000000000000000000000000000d9", + "00000000000000000000000000000000000000000000000000000000000000da", + "00000000000000000000000000000000000000000000000000000000000000db", + "00000000000000000000000000000000000000000000000000000000000000dc", + "00000000000000000000000000000000000000000000000000000000000000dd", + "00000000000000000000000000000000000000000000000000000000000000de", + "00000000000000000000000000000000000000000000000000000000000000df", + "00000000000000000000000000000000000000000000000000000000000000e0", + "00000000000000000000000000000000000000000000000000000000000000e1", + "00000000000000000000000000000000000000000000000000000000000000e2", + "00000000000000000000000000000000000000000000000000000000000000e3", + "00000000000000000000000000000000000000000000000000000000000000e4", + "00000000000000000000000000000000000000000000000000000000000000e5", + "00000000000000000000000000000000000000000000000000000000000000e6", + "00000000000000000000000000000000000000000000000000000000000000e7", + "00000000000000000000000000000000000000000000000000000000000000e8", + "00000000000000000000000000000000000000000000000000000000000000e9", + "00000000000000000000000000000000000000000000000000000000000000ea", + "00000000000000000000000000000000000000000000000000000000000000eb", + "00000000000000000000000000000000000000000000000000000000000000ec", + "00000000000000000000000000000000000000000000000000000000000000ed", + "00000000000000000000000000000000000000000000000000000000000000ee", + "00000000000000000000000000000000000000000000000000000000000000ef", + "00000000000000000000000000000000000000000000000000000000000000f0", + "00000000000000000000000000000000000000000000000000000000000000f1", + "00000000000000000000000000000000000000000000000000000000000000f2", + "00000000000000000000000000000000000000000000000000000000000000f3", + "00000000000000000000000000000000000000000000000000000000000000f4", + "00000000000000000000000000000000000000000000000000000000000000f5", + "00000000000000000000000000000000000000000000000000000000000000f6", + "00000000000000000000000000000000000000000000000000000000000000f7", + "00000000000000000000000000000000000000000000000000000000000000f8", + "00000000000000000000000000000000000000000000000000000000000000f9", + "00000000000000000000000000000000000000000000000000000000000000fa", + "00000000000000000000000000000000000000000000000000000000000000fb", + "00000000000000000000000000000000000000000000000000000000000000fc", + "00000000000000000000000000000000000000000000000000000000000000fd", + "00000000000000000000000000000000000000000000000000000000000000fe" + ], + "expected": "ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000f0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000013000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000150000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001700000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001d000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000001f0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002100000000000000000000000000000000000000000000000000000000000000220000000000000000000000000000000000000000000000000000000000000023000000000000000000000000000000000000000000000000000000000000002400000000000000000000000000000000000000000000000000000000000000250000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000002700000000000000000000000000000000000000000000000000000000000000280000000000000000000000000000000000000000000000000000000000000029000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000002b000000000000000000000000000000000000000000000000000000000000002c000000000000000000000000000000000000000000000000000000000000002d000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000002f0000000000000000000000000000000000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000003100000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000033000000000000000000000000000000000000000000000000000000000000003400000000000000000000000000000000000000000000000000000000000000350000000000000000000000000000000000000000000000000000000000000036000000000000000000000000000000000000000000000000000000000000003700000000000000000000000000000000000000000000000000000000000000380000000000000000000000000000000000000000000000000000000000000039000000000000000000000000000000000000000000000000000000000000003a000000000000000000000000000000000000000000000000000000000000003b000000000000000000000000000000000000000000000000000000000000003c000000000000000000000000000000000000000000000000000000000000003d000000000000000000000000000000000000000000000000000000000000003e000000000000000000000000000000000000000000000000000000000000003f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000043000000000000000000000000000000000000000000000000000000000000004400000000000000000000000000000000000000000000000000000000000000450000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000004700000000000000000000000000000000000000000000000000000000000000480000000000000000000000000000000000000000000000000000000000000049000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000004b000000000000000000000000000000000000000000000000000000000000004c000000000000000000000000000000000000000000000000000000000000004d000000000000000000000000000000000000000000000000000000000000004e000000000000000000000000000000000000000000000000000000000000004f0000000000000000000000000000000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000000005100000000000000000000000000000000000000000000000000000000000000520000000000000000000000000000000000000000000000000000000000000053000000000000000000000000000000000000000000000000000000000000005400000000000000000000000000000000000000000000000000000000000000550000000000000000000000000000000000000000000000000000000000000056000000000000000000000000000000000000000000000000000000000000005700000000000000000000000000000000000000000000000000000000000000580000000000000000000000000000000000000000000000000000000000000059000000000000000000000000000000000000000000000000000000000000005a000000000000000000000000000000000000000000000000000000000000005b000000000000000000000000000000000000000000000000000000000000005c000000000000000000000000000000000000000000000000000000000000005d000000000000000000000000000000000000000000000000000000000000005e000000000000000000000000000000000000000000000000000000000000005f0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006100000000000000000000000000000000000000000000000000000000000000620000000000000000000000000000000000000000000000000000000000000063000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000650000000000000000000000000000000000000000000000000000000000000066000000000000000000000000000000000000000000000000000000000000006700000000000000000000000000000000000000000000000000000000000000680000000000000000000000000000000000000000000000000000000000000069000000000000000000000000000000000000000000000000000000000000006a000000000000000000000000000000000000000000000000000000000000006b000000000000000000000000000000000000000000000000000000000000006c000000000000000000000000000000000000000000000000000000000000006d000000000000000000000000000000000000000000000000000000000000006e000000000000000000000000000000000000000000000000000000000000006f0000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000000000007100000000000000000000000000000000000000000000000000000000000000720000000000000000000000000000000000000000000000000000000000000073000000000000000000000000000000000000000000000000000000000000007400000000000000000000000000000000000000000000000000000000000000750000000000000000000000000000000000000000000000000000000000000076000000000000000000000000000000000000000000000000000000000000007700000000000000000000000000000000000000000000000000000000000000780000000000000000000000000000000000000000000000000000000000000079000000000000000000000000000000000000000000000000000000000000007a000000000000000000000000000000000000000000000000000000000000007b000000000000000000000000000000000000000000000000000000000000007c000000000000000000000000000000000000000000000000000000000000007d000000000000000000000000000000000000000000000000000000000000007e000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000008100000000000000000000000000000000000000000000000000000000000000820000000000000000000000000000000000000000000000000000000000000083000000000000000000000000000000000000000000000000000000000000008400000000000000000000000000000000000000000000000000000000000000850000000000000000000000000000000000000000000000000000000000000086000000000000000000000000000000000000000000000000000000000000008700000000000000000000000000000000000000000000000000000000000000880000000000000000000000000000000000000000000000000000000000000089000000000000000000000000000000000000000000000000000000000000008a000000000000000000000000000000000000000000000000000000000000008b000000000000000000000000000000000000000000000000000000000000008c000000000000000000000000000000000000000000000000000000000000008d000000000000000000000000000000000000000000000000000000000000008e000000000000000000000000000000000000000000000000000000000000008f0000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000009100000000000000000000000000000000000000000000000000000000000000920000000000000000000000000000000000000000000000000000000000000093000000000000000000000000000000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000950000000000000000000000000000000000000000000000000000000000000096000000000000000000000000000000000000000000000000000000000000009700000000000000000000000000000000000000000000000000000000000000980000000000000000000000000000000000000000000000000000000000000099000000000000000000000000000000000000000000000000000000000000009a000000000000000000000000000000000000000000000000000000000000009b000000000000000000000000000000000000000000000000000000000000009c000000000000000000000000000000000000000000000000000000000000009d000000000000000000000000000000000000000000000000000000000000009e000000000000000000000000000000000000000000000000000000000000009f00000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a100000000000000000000000000000000000000000000000000000000000000a200000000000000000000000000000000000000000000000000000000000000a300000000000000000000000000000000000000000000000000000000000000a400000000000000000000000000000000000000000000000000000000000000a500000000000000000000000000000000000000000000000000000000000000a600000000000000000000000000000000000000000000000000000000000000a700000000000000000000000000000000000000000000000000000000000000a800000000000000000000000000000000000000000000000000000000000000a900000000000000000000000000000000000000000000000000000000000000aa00000000000000000000000000000000000000000000000000000000000000ab00000000000000000000000000000000000000000000000000000000000000ac00000000000000000000000000000000000000000000000000000000000000ad00000000000000000000000000000000000000000000000000000000000000ae00000000000000000000000000000000000000000000000000000000000000af00000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000000b100000000000000000000000000000000000000000000000000000000000000b200000000000000000000000000000000000000000000000000000000000000b300000000000000000000000000000000000000000000000000000000000000b400000000000000000000000000000000000000000000000000000000000000b500000000000000000000000000000000000000000000000000000000000000b600000000000000000000000000000000000000000000000000000000000000b700000000000000000000000000000000000000000000000000000000000000b800000000000000000000000000000000000000000000000000000000000000b900000000000000000000000000000000000000000000000000000000000000ba00000000000000000000000000000000000000000000000000000000000000bb00000000000000000000000000000000000000000000000000000000000000bc00000000000000000000000000000000000000000000000000000000000000bd00000000000000000000000000000000000000000000000000000000000000be00000000000000000000000000000000000000000000000000000000000000bf00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000c100000000000000000000000000000000000000000000000000000000000000c200000000000000000000000000000000000000000000000000000000000000c300000000000000000000000000000000000000000000000000000000000000c400000000000000000000000000000000000000000000000000000000000000c500000000000000000000000000000000000000000000000000000000000000c600000000000000000000000000000000000000000000000000000000000000c700000000000000000000000000000000000000000000000000000000000000c800000000000000000000000000000000000000000000000000000000000000c900000000000000000000000000000000000000000000000000000000000000ca00000000000000000000000000000000000000000000000000000000000000cb00000000000000000000000000000000000000000000000000000000000000cc00000000000000000000000000000000000000000000000000000000000000cd00000000000000000000000000000000000000000000000000000000000000ce00000000000000000000000000000000000000000000000000000000000000cf00000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000000d100000000000000000000000000000000000000000000000000000000000000d200000000000000000000000000000000000000000000000000000000000000d300000000000000000000000000000000000000000000000000000000000000d400000000000000000000000000000000000000000000000000000000000000d500000000000000000000000000000000000000000000000000000000000000d600000000000000000000000000000000000000000000000000000000000000d700000000000000000000000000000000000000000000000000000000000000d800000000000000000000000000000000000000000000000000000000000000d900000000000000000000000000000000000000000000000000000000000000da00000000000000000000000000000000000000000000000000000000000000db00000000000000000000000000000000000000000000000000000000000000dc00000000000000000000000000000000000000000000000000000000000000dd00000000000000000000000000000000000000000000000000000000000000de00000000000000000000000000000000000000000000000000000000000000df00000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000e100000000000000000000000000000000000000000000000000000000000000e200000000000000000000000000000000000000000000000000000000000000e300000000000000000000000000000000000000000000000000000000000000e400000000000000000000000000000000000000000000000000000000000000e500000000000000000000000000000000000000000000000000000000000000e600000000000000000000000000000000000000000000000000000000000000e700000000000000000000000000000000000000000000000000000000000000e800000000000000000000000000000000000000000000000000000000000000e900000000000000000000000000000000000000000000000000000000000000ea00000000000000000000000000000000000000000000000000000000000000eb00000000000000000000000000000000000000000000000000000000000000ec00000000000000000000000000000000000000000000000000000000000000ed00000000000000000000000000000000000000000000000000000000000000ee00000000000000000000000000000000000000000000000000000000000000ef00000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000f100000000000000000000000000000000000000000000000000000000000000f200000000000000000000000000000000000000000000000000000000000000f300000000000000000000000000000000000000000000000000000000000000f400000000000000000000000000000000000000000000000000000000000000f500000000000000000000000000000000000000000000000000000000000000f600000000000000000000000000000000000000000000000000000000000000f700000000000000000000000000000000000000000000000000000000000000f800000000000000000000000000000000000000000000000000000000000000f900000000000000000000000000000000000000000000000000000000000000fa00000000000000000000000000000000000000000000000000000000000000fb00000000000000000000000000000000000000000000000000000000000000fc00000000000000000000000000000000000000000000000000000000000000fd00000000000000000000000000000000000000000000000000000000000000fe" + } +] diff --git a/bip-encrypted-backup/test_vectors/keys_types.json b/bip-encrypted-backup/test_vectors/keys_types.json new file mode 100644 index 0000000000..2f2d1f1555 --- /dev/null +++ b/bip-encrypted-backup/test_vectors/keys_types.json @@ -0,0 +1,27 @@ +[ + { + "description": "Xpub with origin and multipath", + "key": "[58b7f8dc/48'/1'/0'/2']tpubDEPBvXvhta3pjVaKokqC3eeMQnszj9ehFaA2zD5nSdkaccwGAizu8jVB2NeSpvmP2P52MBoZvNCixqXRJnTyXx51FQzARR63tjxQSyP3Btw/<0;1>/*", + "expected": "ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708" + }, + { + "description": "Xpub with origin and w/o multipath", + "key": "[d4ab66f1/48'/1'/1'/2']tpubDFTxBKyUCgkwp5enwZh3t2FJ5AMJqmCWoh1NRT13qNYQb1iKTUrAG6u5gpsDYhG8cZGXouYWuQtzcuSVjPStTc4dwU6JqPMFtgaLGvSQXhi", + "expected": "8e886919a6b72579a28bd292505d2afd41c1b5012414c5e24d7b59f4abdfc0ce" + }, + { + "description": "Compressed public key", + "key": "02ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708", + "expected": "ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708" + }, + { + "description": "X only public key", + "key": "ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708", + "expected": "ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708" + }, + { + "description": "Uncompressed public key", + "key": "04ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b517089e956909c4c07e8529f45f3ff8904d28df5a181619e21bdf748a896322530039", + "expected": "ebd252ca0877aae09b9d058219682775aa3cbcd049c12f07832f2cf6a3b51708" + } +]