What changed, and why it matters
This commit only fixes and adds unit tests. It changes test-only dependencies, adds new test cases for Bitcoin address encoding and Zcash address generation/PCZT signing, and slightly adjusts code-coverage thresholds in CI. There is no change to production firmware behavior, no bug fix in shipped code, and no security-relevant change visible in the diff.
No security action required; treat as routine test/CI maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit is a test-maintenance patch. It enables the multi_coins (or cypherpunk for monero) feature on keystore dev-dependencies across many Rust app crates, adds a #[cfg(test)] module for Bitcoin address encoding tests, and adds #[cfg(test)] additional tests in zcash/src/lib.rs and zcash/src/pczt/sign.rs. CI coverage thresholds are nudged up by 1-3 percentage points. No runtime code paths are modified.
Changed components
rust/apps/*/Cargo.toml dev-dependenciesrust/apps/bitcoin/src/addresses/encoding.rs (tests only)rust/apps/zcash/src/lib.rs (tests only)rust/apps/zcash/src/pczt/sign.rs (tests only).github/workflows/rust-bitcoin-checks.yml.github/workflows/rust-zcash-checks.ymlInspect captured patch +219 / −14
diff --git a/.github/workflows/rust-bitcoin-checks.yml b/.github/workflows/rust-bitcoin-checks.yml
index 9950fc6..423f899 100644
--- a/.github/workflows/rust-bitcoin-checks.yml
+++ b/.github/workflows/rust-bitcoin-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/bitcoin
- run: cd rust/apps/bitcoin && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 74 --fail-under-functions 78 --fail-under-lines 86 --ignore-filename-regex 'keystore/*|utils/*'
+ run: cd rust/apps/bitcoin && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 74 --fail-under-functions 79 --fail-under-lines 86 --ignore-filename-regex 'keystore/*|utils/*'
diff --git a/.github/workflows/rust-zcash-checks.yml b/.github/workflows/rust-zcash-checks.yml
index 8abe4e4..64ff85a 100644
--- a/.github/workflows/rust-zcash-checks.yml
+++ b/.github/workflows/rust-zcash-checks.yml
@@ -24,4 +24,4 @@ jobs:
uses: taiki-e/install-action@cargo-llvm-cov
- name: Run rust/apps/zcash
- run: cd rust/apps/zcash && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 69 --fail-under-functions 67 --fail-under-lines 74 --ignore-filename-regex 'keystore/*|utils/*|zcash_vendor/*'
+ run: cd rust/apps/zcash && cargo +nightly-2025-05-01 llvm-cov --fail-under-regions 70 --fail-under-functions 71 --fail-under-lines 77 --ignore-filename-regex 'keystore/*|utils/*|zcash_vendor/*'
diff --git a/rust/apps/aptos/Cargo.toml b/rust/apps/aptos/Cargo.toml
index 860e622..1281a35 100644
--- a/rust/apps/aptos/Cargo.toml
+++ b/rust/apps/aptos/Cargo.toml
@@ -18,7 +18,7 @@ hex = { workspace = true }
cryptoxide = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/arweave/Cargo.toml b/rust/apps/arweave/Cargo.toml
index 9005d48..115b22d 100644
--- a/rust/apps/arweave/Cargo.toml
+++ b/rust/apps/arweave/Cargo.toml
@@ -25,7 +25,7 @@ thiserror = { workspace = true }
zeroize = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/avalanche/Cargo.toml b/rust/apps/avalanche/Cargo.toml
index 72dc042..cf4c01b 100644
--- a/rust/apps/avalanche/Cargo.toml
+++ b/rust/apps/avalanche/Cargo.toml
@@ -30,7 +30,7 @@ std = []
testnet = []
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/bitcoin/Cargo.toml b/rust/apps/bitcoin/Cargo.toml
index 8887227..a17409d 100644
--- a/rust/apps/bitcoin/Cargo.toml
+++ b/rust/apps/bitcoin/Cargo.toml
@@ -29,7 +29,7 @@ default = ["std"]
std = []
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/bitcoin/src/addresses/encoding.rs b/rust/apps/bitcoin/src/addresses/encoding.rs
index e50d413..c6cd731 100644
--- a/rust/apps/bitcoin/src/addresses/encoding.rs
+++ b/rust/apps/bitcoin/src/addresses/encoding.rs
@@ -201,3 +201,142 @@ impl<'a> fmt::Display for DOGEAddressEncoding<'a> {
}
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use alloc::string::ToString;
+ use bitcoin::hashes::{hash160, Hash};
+ use bitcoin::{PubkeyHash, ScriptHash, WitnessProgram, WitnessVersion};
+
+ fn p2pkh_payload(hex_path: &str) -> Payload {
+ let bytes = hex::decode(hex_path).expect("Invalid hex");
+ let hash = hash160::Hash::from_slice(&bytes).expect("Invalid hash");
+ Payload::P2pkh {
+ pubkey_hash: PubkeyHash::from(hash),
+ }
+ }
+
+ fn p2sh_payload(hex_path: &str) -> Payload {
+ let bytes = hex::decode(hex_path).expect("Invalid hex");
+ let hash = hash160::Hash::from_slice(&bytes).expect("Invalid hash");
+ Payload::P2sh {
+ script_hash: ScriptHash::from(hash),
+ }
+ }
+
+ fn segwit_payload(version: WitnessVersion, hex_path: &str) -> Payload {
+ let bytes = hex::decode(hex_path).expect("Invalid hex");
+ let witness_program =
+ WitnessProgram::new(version, &bytes).expect("Invalid witness program");
+ Payload::Segwit { witness_program }
+ }
+
+ #[test]
+ fn test_btc_encoding() {
+ // BTC P2PKH: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
+ let p2pkh = p2pkh_payload("62e907b15cbf27d5425399ebf6f0fb50ebb88f18");
+ let btc_encoding = BTCAddressEncoding {
+ payload: &p2pkh,
+ p2pkh_prefix: 0x00,
+ p2sh_prefix: 0x05,
+ bech32_hrp: "bc",
+ };
+ assert_eq!(
+ btc_encoding.to_string(),
+ "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
+ );
+
+ // BTC P2SH: 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy
+ let p2sh = p2sh_payload("b472a266d0bd89c13706a4132cc6a64f852e5519");
+ let btc_encoding = BTCAddressEncoding {
+ payload: &p2sh,
+ p2pkh_prefix: 0x00,
+ p2sh_prefix: 0x05,
+ bech32_hrp: "bc",
+ };
+ // Generated address from the given hash
+ assert_eq!(
+ btc_encoding.to_string(),
+ "3J98t1WpEZ73CNmQvieacj3En2FD1ds8xP"
+ );
+
+ // BTC Segwit: bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq
+ let segwit = segwit_payload(
+ WitnessVersion::V0,
+ "751e76e8199196d454941c45d1b3a323f1433bd6",
+ );
+ let btc_encoding = BTCAddressEncoding {
+ payload: &segwit,
+ p2pkh_prefix: 0x00,
+ p2sh_prefix: 0x05,
+ bech32_hrp: "bc",
+ };
+ // Lowercase by default (Display)
+ assert_eq!(
+ btc_encoding.to_string(),
+ "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
+ );
+ // Check alternate (uppercase)
+ assert_eq!(
+ format!("{:#}", btc_encoding),
+ "BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4"
+ );
+ }
+
+ #[test]
+ fn test_ltc_encoding() {
+ let p2pkh = p2pkh_payload("62e907b15cbf27d5425399ebf6f0fb50ebb88f18");
+ let ltc_encoding = LTCAddressEncoding {
+ payload: &p2pkh,
+ p2pkh_prefix: 0x30,
+ p2sh_prefix: 0x32,
+ bech32_hrp: "ltc",
+ };
+ assert_eq!(
+ ltc_encoding.to_string(),
+ "LUEweDxDA4WhvWiNXXSxjM9CYzHPJv4QQF"
+ );
+ }
+
+ #[test]
+ fn test_doge_encoding() {
+ let p2pkh = p2pkh_payload("62e907b15cbf27d5425399ebf6f0fb50ebb88f18");
+ let doge_encoding = DOGEAddressEncoding {
+ payload: &p2pkh,
+ p2pkh_prefix: 0x1E,
+ p2sh_prefix: 0x16,
+ };
+ assert_eq!(
+ doge_encoding.to_string(),
+ "DEA5vGb2NpAwCiCp5yTE16F3DueQUVivQp"
+ );
+ }
+
+ #[test]
+ fn test_zec_encoding() {
+ let p2pkh = p2pkh_payload("62e907b15cbf27d5425399ebf6f0fb50ebb88f18");
+ let zec_encoding = ZECAddressEncoding {
+ payload: &p2pkh,
+ p2pkh_prefix_byte0: 0x1C,
+ p2pkh_prefix_byte1: 0xB8,
+ };
+ assert_eq!(
+ zec_encoding.to_string(),
+ "t1StbPM4X3j4FGM57HpGnb9BMbS7C1nFW1r"
+ );
+ }
+
+ #[test]
+ fn test_bch_encoding() {
+ let p2pkh = p2pkh_payload("62e907b15cbf27d5425399ebf6f0fb50ebb88f18");
+ let bch_encoding = BCHAddressEncoding {
+ payload: &p2pkh,
+ p2pkh_prefix: 0x00,
+ };
+ assert_eq!(
+ bch_encoding.to_string(),
+ "qp3wjpa3tjlj042z2wv7hahsldgwhwy0rq9sywjpyy"
+ );
+ }
+}
diff --git a/rust/apps/cardano/Cargo.toml b/rust/apps/cardano/Cargo.toml
index a9ef9d5..3a748ff 100644
--- a/rust/apps/cardano/Cargo.toml
+++ b/rust/apps/cardano/Cargo.toml
@@ -17,7 +17,7 @@ thiserror = { workspace = true }
bitcoin = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
bech32 = { workspace = true }
[dependencies.cardano-serialization-lib]
diff --git a/rust/apps/cosmos/Cargo.toml b/rust/apps/cosmos/Cargo.toml
index e403dc3..79da736 100644
--- a/rust/apps/cosmos/Cargo.toml
+++ b/rust/apps/cosmos/Cargo.toml
@@ -23,7 +23,7 @@ cryptoxide = { workspace = true }
rust_tools = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[features]
default = ["std"]
diff --git a/rust/apps/ethereum/Cargo.toml b/rust/apps/ethereum/Cargo.toml
index 02eb1af..5932f57 100644
--- a/rust/apps/ethereum/Cargo.toml
+++ b/rust/apps/ethereum/Cargo.toml
@@ -25,7 +25,7 @@ rsa = { workspace = true }
ur-registry = { workspace = true }
[dev-dependencies]
-keystore = { path = "../../keystore" }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/iota/Cargo.toml b/rust/apps/iota/Cargo.toml
index 36a7041..3dbf80f 100644
--- a/rust/apps/iota/Cargo.toml
+++ b/rust/apps/iota/Cargo.toml
@@ -11,5 +11,8 @@ hex = { workspace = true }
cryptoxide = { workspace = true }
thiserror = { workspace = true }
+[dev-dependencies]
+keystore = { workspace = true, features = ["multi_coins"] }
+
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/monero/Cargo.toml b/rust/apps/monero/Cargo.toml
index fe6deb2..9281903 100644
--- a/rust/apps/monero/Cargo.toml
+++ b/rust/apps/monero/Cargo.toml
@@ -23,5 +23,8 @@ cuprate-cryptonight = { git = "https://github.com/KeystoneHQ/cuprate", default-f
monero-serai = { git = "https://github.com/KeystoneHQ/serai", default-features = false }
monero-wallet = { git = "https://github.com/KeystoneHQ/serai", default-features = false }
+[dev-dependencies]
+keystore = { workspace = true, features = ["cypherpunk"] }
+
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/near/Cargo.toml b/rust/apps/near/Cargo.toml
index 299e262..637ac5a 100644
--- a/rust/apps/near/Cargo.toml
+++ b/rust/apps/near/Cargo.toml
@@ -21,7 +21,7 @@ base64 = { workspace = true }
bitcoin = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/solana/Cargo.toml b/rust/apps/solana/Cargo.toml
index 553d157..7747641 100644
--- a/rust/apps/solana/Cargo.toml
+++ b/rust/apps/solana/Cargo.toml
@@ -31,6 +31,9 @@ borsh = { version = "1.5.1", default-features = false, features = [
bitcoin = { workspace = true }
ur-registry = { workspace = true }
+[dev-dependencies]
+keystore = { workspace = true, features = ["multi_coins"] }
+
[features]
default = ["std"]
std = []
diff --git a/rust/apps/stellar/Cargo.toml b/rust/apps/stellar/Cargo.toml
index 4fba2a2..3dba156 100644
--- a/rust/apps/stellar/Cargo.toml
+++ b/rust/apps/stellar/Cargo.toml
@@ -13,5 +13,8 @@ thiserror = { workspace = true }
cryptoxide = { workspace = true }
base64 = { workspace = true }
+[dev-dependencies]
+keystore = { workspace = true, features = ["multi_coins"] }
+
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/sui/Cargo.toml b/rust/apps/sui/Cargo.toml
index a9e2022..23401af 100644
--- a/rust/apps/sui/Cargo.toml
+++ b/rust/apps/sui/Cargo.toml
@@ -19,7 +19,7 @@ bitcoin = { workspace = true }
thiserror = { workspace = true }
[dev-dependencies]
-keystore = { path = "../../keystore" }
+keystore = { workspace = true, features = ["multi_coins"] }
[features]
default = ["std"]
diff --git a/rust/apps/ton/Cargo.toml b/rust/apps/ton/Cargo.toml
index 748597c..23c0b13 100644
--- a/rust/apps/ton/Cargo.toml
+++ b/rust/apps/ton/Cargo.toml
@@ -29,7 +29,7 @@ zeroize = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
anyhow = "*"
urlencoding = "2.1.3"
diff --git a/rust/apps/tron/Cargo.toml b/rust/apps/tron/Cargo.toml
index 6aea451..5274608 100644
--- a/rust/apps/tron/Cargo.toml
+++ b/rust/apps/tron/Cargo.toml
@@ -20,7 +20,7 @@ ur-registry = { workspace = true }
thiserror = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[build-dependencies]
prost-build = { version = "0.11.8" }
diff --git a/rust/apps/wallets/Cargo.toml b/rust/apps/wallets/Cargo.toml
index 5b6dc43..53cbc87 100644
--- a/rust/apps/wallets/Cargo.toml
+++ b/rust/apps/wallets/Cargo.toml
@@ -17,5 +17,8 @@ cryptoxide = { workspace = true }
serde_json = { workspace = true }
zcash_vendor = { workspace = true }
+[dev-dependencies]
+keystore ={ workspace = true, features = ["multi_coins"]}
+
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/xrp/Cargo.toml b/rust/apps/xrp/Cargo.toml
index 1c91a38..b59cd42 100644
--- a/rust/apps/xrp/Cargo.toml
+++ b/rust/apps/xrp/Cargo.toml
@@ -20,7 +20,7 @@ serde_json = { workspace = true }
thiserror = { workspace = true }
[dev-dependencies]
-keystore = { workspace = true }
+keystore = { workspace = true, features = ["multi_coins"] }
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
\ No newline at end of file
diff --git a/rust/apps/zcash/src/lib.rs b/rust/apps/zcash/src/lib.rs
index 4e32674..c0c7a9d 100644
--- a/rust/apps/zcash/src/lib.rs
+++ b/rust/apps/zcash/src/lib.rs
@@ -150,6 +150,29 @@ pub fn parse_pczt_cypherpunk<P: consensus::Parameters>(
pczt::parse::parse_pczt_cypherpunk(params, seed_fingerprint, &ufvk, &pczt)
}
+#[cfg(test)]
+mod additional_tests {
+ use super::*;
+ use zcash_vendor::zcash_protocol::consensus::MAIN_NETWORK;
+
+ #[test]
+ fn test_get_address() {
+ let ufvk_text = "uview10zf3gnxd08cne6g7ryh6lln79duzsayg0qxktvyc3l6uutfk0agmyclm5g82h5z0lqv4c2gzp0eu0qc0nxzurxhj4ympwn3gj5c3dc9g7ca4eh3q09fw9kka7qplzq0wnauekf45w9vs4g22khtq57sc8k6j6s70kz0rtqlyat6zsjkcqfrlm9quje8vzszs8y9mjvduf7j2vx329hk2v956g6svnhqswxfp3n760mw233w7ffgsja2szdhy5954hsfldalf28wvav0tctxwkmkgrk43tq2p7sqchzc6";
+ let addr = get_address(&MAIN_NETWORK, ufvk_text).expect("should generate address");
+ // We can print this address to see what it is, and then pin it in the test.
+ // For now, let's just assert it is valid and not empty.
+ assert!(!addr.is_empty());
+ assert!(addr.starts_with("u1")); // Mainnet unified address starts with u1
+ }
+
+ #[test]
+ fn test_get_address_invalid_ufvk() {
+ let ufvk_text = "invalid_ufvk";
+ let result = get_address(&MAIN_NETWORK, ufvk_text);
+ assert!(result.is_err());
+ }
+}
+
#[cfg(feature = "multi_coins")]
pub fn parse_pczt_multi_coins<P: consensus::Parameters>(
params: &P,
diff --git a/rust/apps/zcash/src/pczt/sign.rs b/rust/apps/zcash/src/pczt/sign.rs
index ee85b91..0134843 100644
--- a/rust/apps/zcash/src/pczt/sign.rs
+++ b/rust/apps/zcash/src/pczt/sign.rs
@@ -184,3 +184,31 @@ pub fn sign_pczt(pczt: Pczt, seed: &[u8]) -> crate::Result<Vec<u8>> {
Ok(signed_pczt.serialize())
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_sign_pczt_invalid_seed_fingerprint() {
+ // A valid PCZT hex string found in the codebase
+ let pczt_hex = "50435a5401000000058ace9cb502d5a09cc70c0100f083ae0185010000000180ade2041976a91467f7aa14f177a7e0058c66c7242e086488bd3d1088ac000001237431544d4c4a376b324e344e6172716b3546643575556f38324e58534d624b5267436300000000fbc2f4300c01f0b7820d00e3347c8da4ee614674376cbc45359daa54f9b5493e010000000000000000000000000000000000000000000000000000000000000000024d2eeb083d7c168f64239c3186d53c72e2b1a3a5140f5250f0963689c08cd61c0999baea13f0be05dc6a2554bb2f8f093f4d20911202567a5ab9fd17bce5142b3f79838a71d14757fcff03ba16486a3efb26c9773ec9596821d1e5f32039fe220001d5d3506f152f62c45198446223abf29e06da700990a779fb60a460712fb666a0ff1fab61e2b2b3566b263d0180b6dc05014b2225d5521d6dbb55ae03d22567ce98b242ba5520bc4e2493ec36fb9211c6350194215c2aa089dfa317c61bab4b9747f4e45abca855e45e00710a3dc5caa40a570186f6f9e818f6674c2df92918a55d20f340944de5c67c1c4a9ee347c2c2d6d71d4753d765f2859a3157f7b05cc3bc7089e3f2c9d5abb3fcb1708e74c790985d3dd90cfe2ed03276dfda527c6e8c08d9a1fdeedcb6aef59d9e5bf0ae5d9477ed030001872727f23f40a96896b66d04de905791bae2bc7ee9dc1f4e4ec5ae493dc2fc1001afb475105f1f5b477c52aa3c32ccf131b0c556b80f55ac555460e6b5148bf85303a0808080088581808008808080800800002585b32c42aa5a12b2763953f09aafed13450eda0c416e32d0978260c4171c375413b91e25fa826399623b6716ae8bbb0b4a1099de22478944627af7e5969aa0c404ffab4d35664c1dafd2d2c0cecf4fb3c8b054179f84b2d35d207077b3d256b429acdee34963c573b55ae20fffce73e0e3e575c8fde9d115e7ffab50b3bee60d2436b72c17677e1d7db141fafa72c7f89002908a7a8de3320e5ad3d1ed0bb545235e136904c5c5e4adfa5a100420ceb2196e5e197e919aeaeefa7cb2a1d98e011539af52d618bfb3ba1dfc2d2c01e9bd67523bb6787eb5a0d28e30ad483c6303efd4796795082cc67ea94ba8548a33da1a5ec7c56174bd6b260f548e83a924b7cdd32980ca489b44e981aa1d81cefe2581eebf3a585fb80542aea4a27862f593203b560a412ba4e737c8f678f239f3d1d07c5a82367435f0a0921c46600eb4f6f7387b3cb5984af98b1337f5148ad6388b62dab7cdc48c66ff81685894c2d1d0fe41716b7cb457fb5bd6ff13e321d2f91c15d431f942d7869955dfeadfff61638266ba38d7ba4db7ffe5ee03550d345715cebd9b378181b5769c22e1b20328165da02eeb5d246c70c008ac0c7f7b1bba2cf8270f013eb99cbc5d534270180f34892fdf08d8c16c518d8b7f62d832d676c65fcae34c640ff30d5bd9d65afeab509117a98374b4b9b016228a65bdd803d6c601d2ad6a654c2fe4487d9c7b088d886c36a6afe63d33f8c474f096500acabbb63968e7408c620cc8139331cf7227e9bdbf4b7bae292e15d310e66186b730f28d0515ac5bb71fcc5de09995fe89d005cc2c7afd0fb8f01b315815d38366ebeb6de9ed565b5d1f2ce14b7795b9ad784851f357beacc454be41aaec506f0148461ba5907043ab8618114bbbede979d7f0e0e0af914750df648079e3625e4f309d13ff74d4ada783203bb3652137abd8327cdd06b9332591c9abdcc0cc16f7fec2e0afd849bef8927b3b0ceeca2b90af7611875b78cf525852ee83e10c8f4cb2c80045cbf33c0801a55eeb15c9dca6e53b3dde8a12daf820f1f76624ee48e3128aaa0ef6f6fb32a0303d89e88be288be1b92a301e893790179ec07711e275f48de2f5f8e0ee7b000091c9d96159746d46f353e67463d7052000000000118c5796d39cd2bc56b0a062c20ebd32feb0b57cc231c262d6703520f8de603211edcf51f6084e3288cbdb02957a02cd68fb84973a6a98260fb60f30951dedb2e1240275687c0bd82a2653a2c212bd3c0ea75cd294f5a4d31dcf507c15461402760282899f6b560858c0b6bd95c708f62d1e856480a52401d0d7d6a642fa1c2a10176072c6147735b785ea4ad9276378885704a44c6246f4630ef1df59438562e055bba6c1411a790727ab27421e6c418df8b65cb636d6786ce9e5b632659f5d32401caffe6271e2d77d8634e67a116926d7566b5eb2f2aadba6498d7a1e120f27f52379bb3f8781090ae47e30b0100011a78b2abbab21b29d79141fdff8a389c2eacde5be75c69ae4c4fabc175aec10a0142b202630def2df1f7cd23fcf362c68194829282c57b0c4d5f0ca023b51a571f01bd466676b53cfc27ba4a94bb4ab3ed19d8db336042e09e1e756b560b5ce7fc05d5dc3269236828f541662db5bfd4ab6e07c4dac2682906ee85eca2d12b6522013dd286fc499141cfebfb53175ea4321e08e8a504604bbc2e9d3e59706a1fa439000130febcd5d0c57c6e3780d6fe1f6c07f01a9d5d7a053ac5562f29304418d33a20000000f7fa16a612e422c34d61c44ae692b255c921239547172fcd26519928a3abb10d22548d840b466f1fed5ccb4c442d97b4b59d1a728455ee1598bae8e316f819bac404c9112693c57e0733d550ddc984d82ecc9047721e7e7bc6f283ba00852e49a4d3cda4dad343a366650b1d75b26025eadc5200113ebcc2a4a7db9ac2291083d76e7a8c04831764caf35e4c18bfc58e58699b4a651ca3686a95a6db7133611b5ce80a14225cdac643311869ea0c4a6d760379f285fa9c396c435361044da7e077f236d589a3eb962129988ea6ccde694cb72fa986748fc106981320f478a1c5402fe75a26dee31ec9fad4240aa19932fa8361c43798aa381c63b0c0b17657ccf37792a28456cfe6562e15d9e4aa26ed2660b6c8fc8a92cd352a6025dabcbed5eba82d88b9df3ba73270ff2f9c44fca8b0c1df8ed4cbfa2a4ebe7d0bcc6e5ce73e43b51e054860d7939ca13d77813b372070fd24cdd9c0e2fad7567471c0279bba19a76f0cdbd3107220821dd676c1df6524c15b87c1318eda418d65f8c66d2a77a65f6894199d44611e60c0291c330d1692bd521aef0e316e2b3f8c377b0d6873b3b645196ba74a79c6e0509869ac66276c3e2dfefd54a12365b5945406e7b673321ed36e89a14a194ae8b864e9ac4684655bae7fcd3123a226f282ac6ac82ca88d6a383d8be90f87f4cb85225f697932abfb4c05cda3b6dadb003621fee663f3fcb8f1c96320a3f148bc106ec231961a8f5142dd614317eef16b81492668a8b8795b85d7b0f737fa8d79e9dc3d78840d158a73dc6d1700ce3a8de2a9f93ff1bc8108703b94fd5bd230a19dd0fd821b832d3508b335e07bac28e95c3ab0eb637334bf166fa2a440ea35c0372bb5a745ee86c727a80f0d0d080fef6642ae7aae1407d6a25c3050c498a52ae300105bded1f19829b10df00e7ba301a9aef2c99ad7c5338b0e259ab97ea852630606b8d59709ca067d32698c8761e0f7d5b76ac07d4860b0fe2992010ba88827bb37cf4e3436488580e79101b366d454f29aa2bdf76725130baa08b38af3a71c251521809c84fe3d086943f39f01d760884b6342fac60c010001c54930d4f4f9946dfe91ac3e94cf5b513871c4a5c0c21137959482da796d2d280000000001c4666732084baff2e402ed7d3e457303c73b77dbd4aa5bc943ac7ca96f3779070398a2e304004aed48232c44dbd0b0b5404063ecc4679436f28c6251cbba91e29388fcd98d0e0001dc2be19f4118dbb7500df3a95e304733b247cea7f8c681f6aaafceb8fc1d7d28";
+ let pczt_bytes = hex::decode(pczt_hex).unwrap();
+ let pczt = Pczt::parse(&pczt_bytes).unwrap();
+
+ // Random seed, should mismatch the seed fingerprint in PCZT
+ let seed = hex::decode("d561f5aba9db8b100a9a84197322e522f952171a388ad74eaab1ab9db815be3335c3099a0a2bb0fee57e630db5ed7251412b6bd4b905cf518627411fee3f32dd").unwrap();
+
+ // Should return a successfull result but with redacted information
+ // In the current logic, if keys don't match, it returns Ok and does not sign, but redactor still runs.
+ let result = sign_pczt(pczt, &seed);
+ assert!(result.is_ok());
+
+ let signed_pczt = result.unwrap();
+ // Verify result is a valid PCZT
+ assert!(Pczt::parse(&signed_pczt).is_ok());
+
+ // Verify redaction occurred (size should be smaller as witness data is removed)
+ assert!(signed_pczt.len() < pczt_bytes.len());
+ }
+}
Why this scored 14/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.