Repository: LNP-BP/client_side_validation (language: rust)

Issue:
broken MerkleBlock conceal procedure
Executing rgb-lib tests we found an issue that sometimes happens and seems very similar to https://github.com/RGB-WG/rgb-node/issues/208, but I'm not sure it's the same.

The error we receive is `MerkleBlock conceal procedure is broken` and comes from `~/.cargo/git/checkouts/client_side_validation-8dff74d720902144/46cb8a7/commit_verify/src/mpc/block.rs:418:21`.

@dr-orlovsky could you please investigate this?



Discussion / hints:

Fix patch:
diff --git a/Cargo.lock b/Cargo.lock
index a193470f..ca3b56c0 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
 
 [[package]]
 name = "aho-corasick"
-version = "1.0.1"
+version = "1.0.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04"
+checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41"
 dependencies = [
  "memchr",
 ]
@@ -18,7 +18,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f26966af46e0d200e8bf2b7f16230997c1c3f2d141bc27ccc091c012ed527b58"
 dependencies = [
  "amplify_apfloat",
- "amplify_derive 3.0.0",
+ "amplify_derive 3.0.1",
  "amplify_num",
  "amplify_syn",
  "ascii",
@@ -42,14 +42,14 @@ dependencies = [
 
 [[package]]
 name = "amplify_derive"
-version = "3.0.0"
+version = "3.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "580f12b79a9e10cfa8d2515128d83a53f387e290096a75904c92b8a2a4d542a6"
+checksum = "c87df0f28e6eb1f2d355f29ba6793fa9ca643967528609608d5cbd70bd68f9d1"
 dependencies = [
  "amplify_syn",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 1.0.109",
 ]
 
 [[package]]
@@ -61,7 +61,7 @@ dependencies = [
  "amplify_syn",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 1.0.109",
 ]
 
 [[package]]
@@ -75,13 +75,13 @@ dependencies = [
 
 [[package]]
 name = "amplify_syn"
-version = "2.0.0"
+version = "2.0.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29b08d74fda406d5a94abfdcdb91ba13bb06562ccf0a4581867fa924ca242b01"
+checksum = "7736fb8d473c0d83098b5bac44df6a561e20470375cd8bcae30516dc889fd62a"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 1.0.109",
 ]
 
 [[package]]
@@ -92,15 +92,15 @@ checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
 
 [[package]]
 name = "arrayref"
-version = "0.3.6"
+version = "0.3.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
+checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
 
 [[package]]
 name = "arrayvec"
-version = "0.7.2"
+version = "0.7.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
+checksum = "8868f09ff8cea88b079da74ae569d9b8c62a23c68c746240b704ee6f7525c89c"
 
 [[package]]
 name = "ascii"
@@ -113,13 +113,13 @@ dependencies = [
 
 [[package]]
 name = "async-trait"
-version = "0.1.66"
+version = "0.1.68"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc"
+checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.18",
 ]
 
 [[package]]
@@ -130,9 +130,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
 
 [[package]]
 name = "baid58"
-version = "0.3.1"
+version = "0.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5dce38f6b284b55ab61c1efe2143ac5ca2fcc6090536884e55921f4e002894de"
+checksum = "29eb856caa83b642563396407c1deb5331acd62d9d91cd5a5d0dcab4a825ad4b"
 dependencies = [
  "base58",
  "blake3",
@@ -147,9 +147,9 @@ checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581"
 
 [[package]]
 name = "base64"
-version = "0.21.0"
+version = "0.21.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
+checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d"
 
 [[package]]
 name = "bitflags"
@@ -159,9 +159,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
 
 [[package]]
 name = "blake3"
-version = "1.3.3"
+version = "1.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42ae2468a89544a466886840aa467a25b766499f4f04bf7d9fcd10ecee9fccef"
+checksum = "729b71f35bd3fa1a4c86b85d32c8b9069ea7fe14f7a53cfabb65f62d4265b888"
 dependencies = [
  "arrayref",
  "arrayvec",
@@ -173,18 +173,18 @@ dependencies = [
 
 [[package]]
 name = "block-buffer"
-version = "0.10.3"
+version = "0.10.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
 dependencies = [
  "generic-array",
 ]
 
 [[package]]
 name = "bumpalo"
-version = "3.12.0"
+version = "3.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
+checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1"
 
 [[package]]
 name = "byteorder"
@@ -206,7 +206,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
 
 [[package]]
 name = "client_side_validation"
-version = "0.10.2"
+version = "0.10.3"
 dependencies = [
  "commit_verify",
  "serde",
@@ -224,17 +224,18 @@ dependencies = [
  "proc-macro2",
  "quote",
  "strict_encoding",
- "syn",
+ "syn 1.0.109",
 ]
 
 [[package]]
 name = "commit_verify"
-version = "0.10.2"
+version = "0.10.3"
 dependencies = [
  "amplify",
  "commit_encoding_derive",
  "rand",
  "serde",
+ "sha2",
  "strict_encoding",
  "strict_types",
 ]
@@ -263,9 +264,18 @@ dependencies = [
 
 [[package]]
 name = "constant_time_eq"
-version = "0.2.4"
+version = "0.2.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3ad85c1f65dc7b37604eb0e89748faf0b9653065f2a8ef69f96a687ec1e9279"
+checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6"
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c"
+dependencies = [
+ "libc",
+]
 
 [[package]]
 name = "crunchy"
@@ -291,9 +301,9 @@ checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
 
 [[package]]
 name = "digest"
-version = "0.10.6"
+version = "0.10.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
 dependencies = [
  "block-buffer",
  "crypto-common",
@@ -335,9 +345,9 @@ dependencies = [
 
 [[package]]
 name = "generic-array"
-version = "0.14.6"
+version = "0.14.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
 dependencies = [
  "typenum",
  "version_check",
@@ -354,9 +364,9 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
-version = "0.2.8"
+version = "0.2.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31"
+checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
 dependencies = [
  "cfg-if",
  "libc",
@@ -395,9 +405,9 @@ dependencies = [
 
 [[package]]
 name = "indexmap"
-version = "1.9.2"
+version = "1.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
+checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
 dependencies = [
  "autocfg",
  "hashbrown",
@@ -417,18 +427,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
 
 [[package]]
 name = "libc"
-version = "0.2.139"
+version = "0.2.146"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
+checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
 
 [[package]]
 name = "log"
-version = "0.4.17"
+version = "0.4.19"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
-dependencies = [
- "cfg-if",
-]
+checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
 
 [[package]]
 name = "memchr"
@@ -467,9 +474,9 @@ dependencies = [
 
 [[package]]
 name = "once_cell"
-version = "1.17.1"
+version = "1.18.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
+checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
 
 [[package]]
 name = "paste"
@@ -485,18 +492,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
 
 [[package]]
 name = "proc-macro2"
-version = "1.0.51"
+version = "1.0.60"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
+checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406"
 dependencies = [
  "unicode-ident",
 ]
 
 [[package]]
 name = "quote"
-version = "1.0.23"
+version = "1.0.28"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
+checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
 dependencies = [
  "proc-macro2",
 ]
@@ -553,9 +560,9 @@ dependencies = [
 
 [[package]]
 name = "regex"
-version = "1.8.1"
+version = "1.8.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370"
+checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f"
 dependencies = [
  "aho-corasick",
  "memchr",
@@ -564,9 +571,9 @@ dependencies = [
 
 [[package]]
 name = "regex-syntax"
-version = "0.7.1"
+version = "0.7.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
+checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78"
 
 [[package]]
 name = "rustfix"
@@ -594,29 +601,29 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
 
 [[package]]
 name = "serde"
-version = "1.0.154"
+version = "1.0.164"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e"
+checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
 dependencies = [
  "serde_derive",
 ]
 
 [[package]]
 name = "serde_derive"
-version = "1.0.154"
+version = "1.0.164"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217"
+checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.18",
 ]
 
 [[package]]
 name = "serde_json"
-version = "1.0.94"
+version = "1.0.97"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
+checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a"
 dependencies = [
  "itoa",
  "ryu",
@@ -635,9 +642,9 @@ dependencies = [
 
 [[package]]
 name = "serde_yaml"
-version = "0.9.19"
+version = "0.9.21"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f82e6c8c047aa50a7328632d067bcae6ef38772a79e28daf32f735e0e4f3dd10"
+checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c"
 dependencies = [
  "indexmap",
  "itoa",
@@ -646,6 +653,17 @@ dependencies = [
  "unsafe-libyaml",
 ]
 
+[[package]]
+name = "sha2"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8"
+dependencies = [
+ "cfg-if",
+ "cpufeatures",
+ "digest",
+]
+
 [[package]]
 name = "single_use_seals"
 version = "0.10.0"
@@ -656,9 +674,9 @@ dependencies = [
 
 [[package]]
 name = "strict_encoding"
-version = "2.2.0"
+version = "2.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6fff0b729ca136cddccc87481dd932a442133a12a490f349d67f5d4c20b421e5"
+checksum = "0be9dd3df80dc083d4e20ac87246a67f42b3a5016375ae5a48f292e85ccfb1bd"
 dependencies = [
  "amplify",
  "half",
@@ -675,21 +693,21 @@ dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 1.0.109",
 ]
 
 [[package]]
 name = "strict_types"
-version = "1.2.0"
+version = "1.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7af86f31fce50e8e4635509b6114c71aaa3a37cb3df1b8ea0ab5d5cf58afd688"
+checksum = "1e611df6ed5752860c760c94509b838cd225e9e9e5de301517db195cf6f1f2cd"
 dependencies = [
  "amplify",
  "baid58",
  "base64",
- "blake3",
  "half",
  "indexmap",
+ "sha2",
  "strict_encoding",
 ]
 
@@ -705,9 +723,9 @@ dependencies = [
 
 [[package]]
 name = "subtle"
-version = "2.4.1"
+version = "2.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
+checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
 
 [[package]]
 name = "syn"
@@ -720,6 +738,17 @@ dependencies = [
  "unicode-ident",
 ]
 
+[[package]]
+name = "syn"
+version = "2.0.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
 [[package]]
 name = "term"
 version = "0.7.0"
@@ -746,22 +775,22 @@ dependencies = [
 
 [[package]]
 name = "thiserror"
-version = "1.0.39"
+version = "1.0.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c"
+checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
 dependencies = [
  "thiserror-impl",
 ]
 
 [[package]]
 name = "thiserror-impl"
-version = "1.0.39"
+version = "1.0.40"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e"
+checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.18",
 ]
 
 [[package]]
@@ -781,9 +810,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba"
 
 [[package]]
 name = "unicode-ident"
-version = "1.0.8"
+version = "1.0.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
+checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
 
 [[package]]
 name = "unicode-width"
@@ -793,9 +822,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
 
 [[package]]
 name = "unsafe-libyaml"
-version = "0.2.7"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ad2024452afd3874bf539695e04af6732ba06517424dbf958fdb16a01f3bef6c"
+checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6"
 
 [[package]]
 name = "version_check"
@@ -811,9 +840,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
 
 [[package]]
 name = "wasm-bindgen"
-version = "0.2.84"
+version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
 dependencies = [
  "cfg-if",
  "wasm-bindgen-macro",
@@ -821,24 +850,24 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-backend"
-version = "0.2.84"
+version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
 dependencies = [
  "bumpalo",
  "log",
  "once_cell",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.18",
  "wasm-bindgen-shared",
 ]
 
 [[package]]
 name = "wasm-bindgen-macro"
-version = "0.2.84"
+version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
 dependencies = [
  "quote",
  "wasm-bindgen-macro-support",
@@ -846,22 +875,22 @@ dependencies = [
 
 [[package]]
 name = "wasm-bindgen-macro-support"
-version = "0.2.84"
+version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.18",
  "wasm-bindgen-backend",
  "wasm-bindgen-shared",
 ]
 
 [[package]]
 name = "wasm-bindgen-shared"
-version = "0.2.84"
+version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
 
 [[package]]
 name = "winapi"
diff --git a/Cargo.toml b/Cargo.toml
index dddc8350..369527d2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,7 +22,7 @@ license = "Apache-2.0"
 
 [package]
 name = "client_side_validation"
-version = "0.10.2"
+version = "0.10.3"
 description = "Client-side validation foundation library"
 keywords = ["lnp-bp", "smart-contracts", "blockchain"]
 categories = ["cryptography"]
@@ -40,7 +40,7 @@ name = "client_side_validation"
 path = "src/lib.rs"
 
 [dependencies]
-commit_verify = { version = "0.10.2", path = "./commit_verify", default-features = false }
+commit_verify = { version = "0.10.3", path = "./commit_verify", default-features = false }
 single_use_seals = { version = "0.10.0", path = "./single_use_seals" }
 serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true }
 
diff --git a/commit_verify/Cargo.toml b/commit_verify/Cargo.toml
index 4b8ce1d0..68795c94 100644
--- a/commit_verify/Cargo.toml
+++ b/commit_verify/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "commit_verify"
-version = "0.10.2"
+version = "0.10.3"
 description = "Commit-verify API for client-side validation"
 keywords = ["lnp-bp", "smart-contracts", "blockchain", "commitments"]
 categories = ["cryptography"]
@@ -24,8 +24,9 @@ required-features = ["stl"]
 [dependencies]
 amplify = { version = "4.0.0", features = ["hex", "apfloat"] }
 commit_encoding_derive = { version = "0.10.0", path = "derive" }
-strict_encoding = "2.2.0"
-strict_types = { version = "1.2.0", optional = true }
+strict_encoding = "2.3.0"
+strict_types = { version = "1.3.0", optional = true }
+sha2 = "0.10.6"
 rand = { version = "0.8.5", optional = true }
 serde_crate = { version = "1.0", package = "serde", optional = true }
 
diff --git a/commit_verify/src/bin/commit-stl.rs b/commit_verify/src/bin/commit-stl.rs
index a110722d..298f060f 100644
--- a/commit_verify/src/bin/commit-stl.rs
+++ b/commit_verify/src/bin/commit-stl.rs
@@ -13,7 +13,7 @@
 // software. If not, see <https://opensource.org/licenses/Apache-2.0>.
 
 use commit_verify::stl;
-use strict_types::typelib::parse_args;
+use strict_types::parse_args;
 
 fn main() {
     let lib = stl::commit_verify_stl();
diff --git a/commit_verify/src/commit.rs b/commit_verify/src/commit.rs
index b3ee5a8d..e0dba900 100644
--- a/commit_verify/src/commit.rs
+++ b/commit_verify/src/commit.rs
@@ -22,9 +22,11 @@
 //! Base commit-verify scheme interface.
 
 use amplify::Bytes32;
+use sha2::Sha256;
 use strict_encoding::{StrictEncode, StrictWriter};
 
-use crate::{CommitmentProtocol, Sha256};
+use crate::digest::DigestExt;
+use crate::CommitmentProtocol;
 
 /// Trait for commit-verify scheme. A message for the commitment may be any
 /// structure that can be represented as a byte array (i.e. implements
@@ -139,11 +141,12 @@ mod test {
     use core::hash::Hash;
 
     use amplify::confinement::SmallVec;
+    use sha2::Digest;
 
     use super::test_helpers::*;
     use super::*;
     use crate::test_helpers::gen_messages;
-    use crate::{Sha256, UntaggedProtocol};
+    use crate::UntaggedProtocol;
 
     #[derive(Debug, Display, Error)]
     #[display(Debug)]
@@ -154,7 +157,7 @@ mod test {
     impl<T> CommitVerify<T, UntaggedProtocol> for DummyHashCommitment
     where T: AsRef<[u8]>
     {
-        fn commit(msg: &T) -> Self { Self(Sha256::digest(msg.as_ref())) }
+        fn commit(msg: &T) -> Self { Self(Sha256::digest(msg.as_ref()).into()) }
     }
 
     #[test]
diff --git a/commit_verify/src/digest.rs b/commit_verify/src/digest.rs
new file mode 100644
index 00000000..e4f409b7
--- /dev/null
+++ b/commit_verify/src/digest.rs
@@ -0,0 +1,57 @@
+// Client-side-validation foundation libraries.
+//
+// SPDX-License-Identifier: Apache-2.0
+//
+// Written in 2019-2023 by
+//     Dr. Maxim Orlovsky <orlovsky@lnp-bp.org>
+//
+// Copyright (C) 2019-2023 LNP/BP Standards Association. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+use amplify::num::u24;
+pub use sha2::{Digest, Sha256};
+
+pub trait DigestExt: Digest {
+    fn from_tag(tag: impl AsRef<[u8]>) -> Self;
+    fn input_raw(&mut self, data: &[u8]);
+    fn input_with_len<const MAX: usize>(&mut self, data: &[u8]) {
+        let len = data.len();
+        match MAX {
+            0..=0xFF => self.input_raw(&(len as u8).to_le_bytes()),
+            0x100..=0xFFFF => self.input_raw(&(len as u16).to_le_bytes()),
+            0x10000..=0xFFFFFF => self.input_raw(&u24::with(len as u32).to_le_bytes()),
+            0x1000000..=0xFFFFFFFF => self.input_raw(&(len as u32).to_le_bytes()),
+            _ => panic!("data too large"),
+        }
+        self.input_raw(data);
+    }
+    fn finish(self) -> [u8; 32];
+}
+
+impl DigestExt for Sha256 {
+    fn from_tag(tag: impl AsRef<[u8]>) -> Self {
+        let mut tagger = Sha256::default();
+        tagger.update(tag);
+        let tag = tagger.finalize();
+
+        let mut engine = Sha256::default();
+        engine.update(tag);
+        engine.update(tag);
+        engine
+    }
+
+    fn input_raw(&mut self, data: &[u8]) { self.update(data); }
+
+    fn finish(self) -> [u8; 32] { self.finalize().into() }
+}
diff --git a/commit_verify/src/embed.rs b/commit_verify/src/embed.rs
index e74666c7..2d1859b5 100644
--- a/commit_verify/src/embed.rs
+++ b/commit_verify/src/embed.rs
@@ -281,12 +281,14 @@ pub(crate) mod test_helpers {
 mod test {
     use core::fmt::Debug;
 
-    use amplify::confinement::SmallVec;
+    use amplify::confinement::{SmallVec, U32};
+    use sha2::Sha256;
 
     use super::test_helpers::*;
     use super::*;
+    use crate::digest::DigestExt;
     use crate::test_helpers::gen_messages;
-    use crate::{ConvolveCommit, ConvolveCommitProof, Sha256};
+    use crate::{ConvolveCommit, ConvolveCommitProof};
 
     #[derive(Clone, PartialEq, Eq, Debug, Hash, Error, Display)]
     #[display("error")]
@@ -334,7 +336,7 @@ mod test {
         ) -> Result<(Self::Commitment, [u8; 32]), Self::CommitError> {
             let mut engine = Sha256::default();
             engine.input_raw(supplement);
-            engine.input_with_len(msg.as_ref());
+            engine.input_with_len::<U32>(msg.as_ref());
             Ok((engine.finish(), *supplement))
         }
     }
diff --git a/commit_verify/src/id.rs b/commit_verify/src/id.rs
index 1ba4454e..6ee26534 100644
--- a/commit_verify/src/id.rs
+++ b/commit_verify/src/id.rs
@@ -19,7 +19,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use crate::{CommitEncode, Sha256};
+use sha2::Sha256;
+
+use crate::digest::DigestExt;
+use crate::CommitEncode;
 
 /// High-level API used in client-side validation for producing a single
 /// commitment to the data, which includes running all necessary procedures like
diff --git a/commit_verify/src/lib.rs b/commit_verify/src/lib.rs
index f75ddefd..251e87ef 100644
--- a/commit_verify/src/lib.rs
+++ b/commit_verify/src/lib.rs
@@ -56,15 +56,15 @@ pub mod stl;
 
 pub mod merkle;
 pub mod mpc;
-mod sha256;
+mod digest;
 
 pub use commit::{CommitVerify, StrictEncodedProtocol, TryCommitVerify};
 pub use conceal::Conceal;
 pub use convolve::{ConvolveCommit, ConvolveCommitProof};
+pub use digest::{Digest, DigestExt, Sha256};
 pub use embed::{EmbedCommitProof, EmbedCommitVerify, VerifyEq};
 pub use encode::{strategies, CommitEncode, CommitStrategy};
 pub use id::CommitmentId;
-pub use sha256::Sha256;
 
 pub const LIB_NAME_COMMIT_VERIFY: &str = "CommitVerify";
 
diff --git a/commit_verify/src/merkle.rs b/commit_verify/src/merkle.rs
index 8533766d..12d1d77c 100644
--- a/commit_verify/src/merkle.rs
+++ b/commit_verify/src/merkle.rs
@@ -26,9 +26,11 @@ use std::io::Write;
 use amplify::confinement::Confined;
 use amplify::num::u4;
 use amplify::{Bytes32, Wrapper};
+use sha2::Sha256;
 
+use crate::digest::DigestExt;
 use crate::encode::{strategies, CommitStrategy};
-use crate::{CommitEncode, Sha256, LIB_NAME_COMMIT_VERIFY};
+use crate::{CommitEncode, LIB_NAME_COMMIT_VERIFY};
 
 /// Type of a merkle node branching.
 #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
diff --git a/commit_verify/src/mpc/tree.rs b/commit_verify/src/mpc/tree.rs
index c6b51b28..97de7643 100644
--- a/commit_verify/src/mpc/tree.rs
+++ b/commit_verify/src/mpc/tree.rs
@@ -123,6 +123,7 @@ mod commit {
 
             let mut depth = source.min_depth;
             loop {
+                map.clear();
                 let width = 2usize.pow(depth.to_u8() as u32) as u16;
                 if source.messages.iter().all(|(protocol, message)| {
                     let pos = protocol_id_pos(*protocol, width);
diff --git a/commit_verify/src/sha256.rs b/commit_verify/src/sha256.rs
deleted file mode 100644
index 7654a672..00000000
--- a/commit_verify/src/sha256.rs
+++ /dev/null
@@ -1,258 +0,0 @@
-// Bitcoin protocol primitives library.
-//
-// SPDX-License-Identifier: Apache-2.0
-//
-// Written in 2019-2023 by
-//     Dr Maxim Orlovsky <orlovsky@lnp-bp.org>
-//
-// Copyright (C) 2019-2023 LNP/BP Standards Association. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-use std::{cmp, io};
-
-const BLOCK_SIZE: usize = 64;
-
-macro_rules! ch ( ($x:expr, $y:expr, $z:expr) => ($z ^ ($x & ($y ^ $z))) );
-macro_rules! maj ( ($x:expr, $y:expr, $z:expr) => (($x & $y) | ($z & ($x | $y))) );
-macro_rules! _sigma0 ( ($x:expr) => ($x.rotate_left(30) ^ $x.rotate_left(19) ^ $x.rotate_left(10)) );
-macro_rules! _sigma1 ( ($x:expr) => ($x.rotate_left(26) ^ $x.rotate_left(21) ^ $x.rotate_left(7)) );
-macro_rules! sigma0  ( ($x:expr) => ($x.rotate_left(25) ^ $x.rotate_left(14) ^ ($x >> 3)) );
-macro_rules! sigma1  ( ($x:expr) => ($x.rotate_left(15) ^ $x.rotate_left(13) ^ ($x >> 10)) );
-
-macro_rules! round(
-    // first round
-    ($a:expr, $b:expr, $c:expr, $d:expr, $e:expr, $f:expr, $g:expr, $h:expr, $k:expr, $w:expr) => (
-        let t1 = $h.wrapping_add(_sigma1!($e)).wrapping_add(ch!($e, $f, $g)).wrapping_add($k).wrapping_add($w);
-        let t2 = _sigma0!($a).wrapping_add(maj!($a, $b, $c));
-        $d = $d.wrapping_add(t1);
-        $h = t1.wrapping_add(t2);
-    );
-    // later rounds we reassign $w before doing the first-round computation
-    ($a:expr, $b:expr, $c:expr, $d:expr, $e:expr, $f:expr, $g:expr, $h:expr, $k:expr, $w:expr, $w1:expr, $w2:expr, $w3:expr) => (
-        $w = $w.wrapping_add(sigma1!($w1)).wrapping_add($w2).wrapping_add(sigma0!($w3));
-        round!($a, $b, $c, $d, $e, $f, $g, $h, $k, $w);
-    )
-);
-
-/// Engine to compute SHA256 hash function.
-#[derive(Clone)]
-pub struct Sha256 {
-    buffer: [u8; BLOCK_SIZE],
-    h: [u32; 8],
-    length: usize,
-}
-
-impl Default for Sha256 {
-    fn default() -> Self {
-        Sha256 {
-            h: [
-                0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab,
-                0x5be0cd19,
-            ],
-            length: 0,
-            buffer: [0; BLOCK_SIZE],
-        }
-    }
-}
-
-impl Sha256 {
-    pub fn digest(inp: &[u8]) -> [u8; 32] {
-        let mut engine = Self::default();
-        engine.input_raw(inp);
-        engine.finish()
-    }
-
-    pub fn from_tag(midstate: [u8; 32]) -> Self {
-        let mut ret = [0; 8];
-        for (ret_val, midstate_bytes) in ret.iter_mut().zip(midstate[..].chunks_exact(4)) {
-            *ret_val = u32::from_be_bytes(midstate_bytes.try_into().expect("4 byte slice"));
-        }
-
-        Self {
-            buffer: [0; BLOCK_SIZE],
-            h: ret,
-            length: 64,
-        }
-    }
-
-    pub fn midstate(&self) -> [u8; 32] {
-        let mut ret = [0; 32];
-        for (val, ret_bytes) in self.h.iter().zip(ret.chunks_exact_mut(4)) {
-            ret_bytes.copy_from_slice(&val.to_be_bytes());
-        }
-        ret
-    }
-
-    pub fn input_raw(&mut self, mut inp: &[u8]) {
-        while !inp.is_empty() {
-            let buf_idx = self.length % BLOCK_SIZE;
-            let rem_len = BLOCK_SIZE - buf_idx;
-            let write_len = cmp::min(rem_len, inp.len());
-
-            self.buffer[buf_idx..buf_idx + write_len].copy_from_slice(&inp[..write_len]);
-            self.length += write_len;
-            if self.length % BLOCK_SIZE == 0 {
-                self.process_block();
-            }
-            inp = &inp[write_len..];
-        }
-    }
-
-    pub fn input_with_len(&mut self, inp: &[u8]) {
-        let len = inp.len();
-        match len {
-            0..=0xFC => {
-                self.input_raw(&[len as u8]);
-            }
-            0xFD..=0xFFFF => {
-                self.input_raw(&[0xFD]);
-                self.input_raw(&(len as u16).to_le_bytes());
-            }
-            0x10000..=0xFFFFFFFF => {
-                self.input_raw(&[0xFE]);
-                self.input_raw(&(len as u32).to_le_bytes());
-            }
-            _ => {
-                self.input_raw(&[0xFF]);
-                self.input_raw(&(len as u64).to_le_bytes());
-            }
-        };
-        self.input_raw(inp)
-    }
-
-    pub fn finish(mut self) -> [u8; 32] {
-        // pad buffer with a single 1-bit then all 0s, until there are exactly 8
-        // bytes remaining
-        let data_len = self.length as u64;
-
-        let zeroes = [0; BLOCK_SIZE - 8];
-        self.input_raw(&[0x80]);
-        if self.length % BLOCK_SIZE > zeroes.len() {
-            self.input_raw(&zeroes);
-        }
-        let pad_length = zeroes.len() - (self.length % BLOCK_SIZE);
-        self.input_raw(&zeroes[..pad_length]);
-        debug_assert_eq!(self.length % BLOCK_SIZE, zeroes.len());
-
-        self.input_raw(&(8 * data_len).to_be_bytes());
-        debug_assert_eq!(self.length % BLOCK_SIZE, 0);
-
-        self.midstate()
-    }
-
-    // Algorithm copied from libsecp256k1
-    fn process_block(&mut self) {
-        debug_assert_eq!(self.buffer.len(), BLOCK_SIZE);
-
-        let mut w = [0u32; 16];
-        for (w_val, buff_bytes) in w.iter_mut().zip(self.buffer.chunks_exact(4)) {
-            *w_val = u32::from_be_bytes(buff_bytes.try_into().expect("4 byte slice"));
-        }
-
-        let mut a = self.h[0];
-        let mut b = self.h[1];
-        let mut c = self.h[2];
-        let mut d = self.h[3];
-        let mut e = self.h[4];
-        let mut f = self.h[5];
-        let mut g = self.h[6];
-        let mut h = self.h[7];
-
-        round!(a, b, c, d, e, f, g, h, 0x428a2f98, w[0]);
-        round!(h, a, b, c, d, e, f, g, 0x71374491, w[1]);
-        round!(g, h, a, b, c, d, e, f, 0xb5c0fbcf, w[2]);
-        round!(f, g, h, a, b, c, d, e, 0xe9b5dba5, w[3]);
-        round!(e, f, g, h, a, b, c, d, 0x3956c25b, w[4]);
-        round!(d, e, f, g, h, a, b, c, 0x59f111f1, w[5]);
-        round!(c, d, e, f, g, h, a, b, 0x923f82a4, w[6]);
-        round!(b, c, d, e, f, g, h, a, 0xab1c5ed5, w[7]);
-        round!(a, b, c, d, e, f, g, h, 0xd807aa98, w[8]);
-        round!(h, a, b, c, d, e, f, g, 0x12835b01, w[9]);
-        round!(g, h, a, b, c, d, e, f, 0x243185be, w[10]);
-        round!(f, g, h, a, b, c, d, e, 0x550c7dc3, w[11]);
-        round!(e, f, g, h, a, b, c, d, 0x72be5d74, w[12]);
-        round!(d, e, f, g, h, a, b, c, 0x80deb1fe, w[13]);
-        round!(c, d, e, f, g, h, a, b, 0x9bdc06a7, w[14]);
-        round!(b, c, d, e, f, g, h, a, 0xc19bf174, w[15]);
-
-        round!(a, b, c, d, e, f, g, h, 0xe49b69c1, w[0], w[14], w[9], w[1]);
-        round!(h, a, b, c, d, e, f, g, 0xefbe4786, w[1], w[15], w[10], w[2]);
-        round!(g, h, a, b, c, d, e, f, 0x0fc19dc6, w[2], w[0], w[11], w[3]);
-        round!(f, g, h, a, b, c, d, e, 0x240ca1cc, w[3], w[1], w[12], w[4]);
-        round!(e, f, g, h, a, b, c, d, 0x2de92c6f, w[4], w[2], w[13], w[5]);
-        round!(d, e, f, g, h, a, b, c, 0x4a7484aa, w[5], w[3], w[14], w[6]);
-        round!(c, d, e, f, g, h, a, b, 0x5cb0a9dc, w[6], w[4], w[15], w[7]);
-        round!(b, c, d, e, f, g, h, a, 0x76f988da, w[7], w[5], w[0], w[8]);
-        round!(a, b, c, d, e, f, g, h, 0x983e5152, w[8], w[6], w[1], w[9]);
-        round!(h, a, b, c, d, e, f, g, 0xa831c66d, w[9], w[7], w[2], w[10]);
-        round!(g, h, a, b, c, d, e, f, 0xb00327c8, w[10], w[8], w[3], w[11]);
-        round!(f, g, h, a, b, c, d, e, 0xbf597fc7, w[11], w[9], w[4], w[12]);
-        round!(e, f, g, h, a, b, c, d, 0xc6e00bf3, w[12], w[10], w[5], w[13]);
-        round!(d, e, f, g, h, a, b, c, 0xd5a79147, w[13], w[11], w[6], w[14]);
-        round!(c, d, e, f, g, h, a, b, 0x06ca6351, w[14], w[12], w[7], w[15]);
-        round!(b, c, d, e, f, g, h, a, 0x14292967, w[15], w[13], w[8], w[0]);
-
-        round!(a, b, c, d, e, f, g, h, 0x27b70a85, w[0], w[14], w[9], w[1]);
-        round!(h, a, b, c, d, e, f, g, 0x2e1b2138, w[1], w[15], w[10], w[2]);
-        round!(g, h, a, b, c, d, e, f, 0x4d2c6dfc, w[2], w[0], w[11], w[3]);
-        round!(f, g, h, a, b, c, d, e, 0x53380d13, w[3], w[1], w[12], w[4]);
-        round!(e, f, g, h, a, b, c, d, 0x650a7354, w[4], w[2], w[13], w[5]);
-        round!(d, e, f, g, h, a, b, c, 0x766a0abb, w[5], w[3], w[14], w[6]);
-        round!(c, d, e, f, g, h, a, b, 0x81c2c92e, w[6], w[4], w[15], w[7]);
-        round!(b, c, d, e, f, g, h, a, 0x92722c85, w[7], w[5], w[0], w[8]);
-        round!(a, b, c, d, e, f, g, h, 0xa2bfe8a1, w[8], w[6], w[1], w[9]);
-        round!(h, a, b, c, d, e, f, g, 0xa81a664b, w[9], w[7], w[2], w[10]);
-        round!(g, h, a, b, c, d, e, f, 0xc24b8b70, w[10], w[8], w[3], w[11]);
-        round!(f, g, h, a, b, c, d, e, 0xc76c51a3, w[11], w[9], w[4], w[12]);
-        round!(e, f, g, h, a, b, c, d, 0xd192e819, w[12], w[10], w[5], w[13]);
-        round!(d, e, f, g, h, a, b, c, 0xd6990624, w[13], w[11], w[6], w[14]);
-        round!(c, d, e, f, g, h, a, b, 0xf40e3585, w[14], w[12], w[7], w[15]);
-        round!(b, c, d, e, f, g, h, a, 0x106aa070, w[15], w[13], w[8], w[0]);
-
-        round!(a, b, c, d, e, f, g, h, 0x19a4c116, w[0], w[14], w[9], w[1]);
-        round!(h, a, b, c, d, e, f, g, 0x1e376c08, w[1], w[15], w[10], w[2]);
-        round!(g, h, a, b, c, d, e, f, 0x2748774c, w[2], w[0], w[11], w[3]);
-        round!(f, g, h, a, b, c, d, e, 0x34b0bcb5, w[3], w[1], w[12], w[4]);
-        round!(e, f, g, h, a, b, c, d, 0x391c0cb3, w[4], w[2], w[13], w[5]);
-        round!(d, e, f, g, h, a, b, c, 0x4ed8aa4a, w[5], w[3], w[14], w[6]);
-        round!(c, d, e, f, g, h, a, b, 0x5b9cca4f, w[6], w[4], w[15], w[7]);
-        round!(b, c, d, e, f, g, h, a, 0x682e6ff3, w[7], w[5], w[0], w[8]);
-        round!(a, b, c, d, e, f, g, h, 0x748f82ee, w[8], w[6], w[1], w[9]);
-        round!(h, a, b, c, d, e, f, g, 0x78a5636f, w[9], w[7], w[2], w[10]);
-        round!(g, h, a, b, c, d, e, f, 0x84c87814, w[10], w[8], w[3], w[11]);
-        round!(f, g, h, a, b, c, d, e, 0x8cc70208, w[11], w[9], w[4], w[12]);
-        round!(e, f, g, h, a, b, c, d, 0x90befffa, w[12], w[10], w[5], w[13]);
-        round!(d, e, f, g, h, a, b, c, 0xa4506ceb, w[13], w[11], w[6], w[14]);
-        round!(c, d, e, f, g, h, a, b, 0xbef9a3f7, w[14], w[12], w[7], w[15]);
-        round!(b, c, d, e, f, g, h, a, 0xc67178f2, w[15], w[13], w[8], w[0]);
-
-        self.h[0] = self.h[0].wrapping_add(a);
-        self.h[1] = self.h[1].wrapping_add(b);
-        self.h[2] = self.h[2].wrapping_add(c);
-        self.h[3] = self.h[3].wrapping_add(d);
-        self.h[4] = self.h[4].wrapping_add(e);
-        self.h[5] = self.h[5].wrapping_add(f);
-        self.h[6] = self.h[6].wrapping_add(g);
-        self.h[7] = self.h[7].wrapping_add(h);
-    }
-}
-
-impl io::Write for Sha256 {
-    fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
-        self.input_raw(buf);
-        Ok(buf.len())
-    }
-
-    fn flush(&mut self) -> io::Result<()> { Ok(()) }
-}
diff --git a/commit_verify/src/stl.rs b/commit_verify/src/stl.rs
index 6075b2d7..ffd3b907 100644
--- a/commit_verify/src/stl.rs
+++ b/commit_verify/src/stl.rs
@@ -19,22 +19,21 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use strict_types::typelib::{LibBuilder, TranslateError};
-use strict_types::TypeLib;
+use strict_types::{CompileError, LibBuilder, TypeLib};
 
 use crate::{mpc, LIB_NAME_COMMIT_VERIFY};
 
 pub const LIB_ID_COMMIT_VERIFY: &str =
-    "expand_vertigo_billy_HmAmKqZJ7XKDsyamyaikTq3PXzWgWcuVMXwe13Hzxfq4";
+    "sensor_correct_total_6RNoZhpeu95My9KqGM7j8BcY4tcNa8rwAjXbXUGteuf9";
 
-fn _commit_verify_stl() -> Result<TypeLib, TranslateError> {
-    LibBuilder::new(libname!(LIB_NAME_COMMIT_VERIFY))
-        .transpile::<mpc::MerkleTree>()
-        .transpile::<mpc::MerkleBlock>()
-        .transpile::<mpc::MerkleProof>()
-        .compile(bset! {
-            strict_types::stl::std_stl().to_dependency()
-        })
+fn _commit_verify_stl() -> Result<TypeLib, CompileError> {
+    LibBuilder::new(libname!(LIB_NAME_COMMIT_VERIFY), tiny_bset! {
+        strict_types::stl::std_stl().to_dependency()
+    })
+    .transpile::<mpc::MerkleTree>()
+    .transpile::<mpc::MerkleBlock>()
+    .transpile::<mpc::MerkleProof>()
+    .compile()
 }
 
 pub fn commit_verify_stl() -> TypeLib {
diff --git a/stl/CommitVerify@0.1.0.sta b/stl/CommitVerify@0.1.0.sta
index b59de8c7..83de363c 100644
--- a/stl/CommitVerify@0.1.0.sta
+++ b/stl/CommitVerify@0.1.0.sta
@@ -1,28 +1,28 @@
 -----BEGIN STRICT TYPE LIB-----
-Id: expand_vertigo_billy_HmAmKqZJ7XKDsyamyaikTq3PXzWgWcuVMXwe13Hzxfq4
+Id: sensor_correct_total_6RNoZhpeu95My9KqGM7j8BcY4tcNa8rwAjXbXUGteuf9
 Name: CommitVerify
 Dependencies: 
-  Std@quota_conan_fashion_3TZmAPf8EkQZnbGS1g8uMGes6jEWPqNkFB6pLUKeoefg
-
-DENvbW1pdFZlcmlmeQEkhYSxoxven3UeExRBtABs37rRoj+RaIYnGgNPOFqz9wNT
-dGQHAAtNZXJrbGVCbG9jawYDBWRlcHRoAgJVNANTdGSniKNtbjXJRbIkhpFl8oRH
-EXhPVba0hLLyHzU5cXCthAxjcm9zc1NlY3Rpb24ACAEIVHJlZU5vZGW86hfSc7IB
-QzBDrYWweQS8Odm/gvvYoZJaFdIrSZVGIwAAAAAAAAAA//8AAAAAAAAHZW50cm9w
-eQAEAgAEbm9uZQAAAAEEc29tZQAFAQAACApNZXJrbGVOb2RlBQEABwAAQCAAC01l
-cmtsZVByb29mBgIDcG9zAAACBHBhdGgACAEKTWVya2xlTm9kZY9JHIljSS/G/SOo
-WUugR7vCS6bfYMS9cphJ3bPOsZXwAAAAAAAAAAD//wAAAAAAAApNZXJrbGVUcmVl
-BgQFZGVwdGgCAlU0A1N0ZKeIo21uNclFsiSGkWXyhEcReE9VtrSEsvIfNTlxcK2E
-B2VudHJvcHkAAAgIbWVzc2FnZXMACgcgAAEHTWVzc2FnZRQYwtY4UQTbtrXnnT9m
-mESVV7Qc5zMby9yhP42m8S+CAAAAAAAAAAD//wAAAAAAAANtYXAACgACAAUCAQpQ
-cm90b2NvbElkMCC4MEdDi82q2QhwVi/vZet0wC8WGQXUViMEeTgEFVYBB01lc3Nh
-Z2UUGMLWOFEE27a1550/ZphElVe0HOczG8vcoT+NpvEvggAAAAAAAAAA//8AAAAA
-AAAHTWVzc2FnZQUBAAcAAEAgAApQcm90b2NvbElkBQEABwAAQCAACFRyZWVOb2Rl
-BAIADWNvbmNlYWxlZE5vZGUABgIFZGVwdGgCAlU0A1N0ZKeIo21uNclFsiSGkWXy
-hEcReE9VtrSEsvIfNTlxcK2EBGhhc2gBCk1lcmtsZU5vZGWPSRyJY0kvxv0jqFlL
-oEe7wkum32DEvXKYSd2zzrGV8AEOY29tbWl0bWVudExlYWYABgIKcHJvdG9jb2xJ
-ZAEKUHJvdG9jb2xJZDAguDBHQ4vNqtkIcFYv72XrdMAvFhkF1FYjBHk4BBVWB21l
-c3NhZ2UBB01lc3NhZ2UUGMLWOFEE27a1550/ZphElVe0HOczG8vcoT+NpvEvgg==
+  Std@left_pierre_food_5cmoZctpx98FbTzWTArm3G53pMzUXuRPXmMhuCd8zyXb
 
+DENvbW1pdFZlcmlmeQFEmLwV+shMOSrCdItrzFm26d5WHbcOcsiPPhNvMEQWZgNT
+dGQBA1N0ZAEAnhTM5rGFzKR3ukRjS/osWHGpfgwyt67B32qUUiqTGccCVTQHAAtN
+ZXJrbGVCbG9jawYDBWRlcHRoAkSYvBX6yEw5KsJ0i2vMWbbp3lYdtw5yyI8+E28w
+RBZmnhTM5rGFzKR3ukRjS/osWHGpfgwyt67B32qUUiqTGccMY3Jvc3NTZWN0aW9u
+AAgBCIUK/czywdQ0N8Bv04ybLPiWbgKWYBns3aJpB6+EsBsAAAAAAAAAAP//AAAA
+AAAAB2VudHJvcHkABAIABG5vbmUAAAABBHNvbWUABQEAAAgKTWVya2xlTm9kZQUB
+AAcAAEAgAAtNZXJrbGVQcm9vZgYCA3BvcwAAAgRwYXRoAAgBVY03B/hFhlOA7sxB
+VSTopJlgUdOUgkPxlPfxkVcj6eYAAAAAAAAAAP//AAAAAAAACk1lcmtsZVRyZWUG
+BAVkZXB0aAJEmLwV+shMOSrCdItrzFm26d5WHbcOcsiPPhNvMEQWZp4UzOaxhcyk
+d7pEY0v6LFhxqX4MMreuwd9qlFIqkxnHB2VudHJvcHkAAAgIbWVzc2FnZXMACgcg
+AAE1N6lRFcjqhdxS96uB8nFlUQUmU5RCV6+JE+h71Jux0wAAAAAAAAAA//8AAAAA
+AAADbWFwAAoAAgAFAgEwlX7mHWE0WbsFCOThrz1qIb/W+/sdMYKneeVFdOBWsQE1
+N6lRFcjqhdxS96uB8nFlUQUmU5RCV6+JE+h71Jux0wAAAAAAAAAA//8AAAAAAAAH
+TWVzc2FnZQUBAAcAAEAgAApQcm90b2NvbElkBQEABwAAQCAACFRyZWVOb2RlBAIA
+DWNvbmNlYWxlZE5vZGUABgIFZGVwdGgCRJi8FfrITDkqwnSLa8xZtuneVh23DnLI
+jz4TbzBEFmaeFMzmsYXMpHe6RGNL+ixYcal+DDK3rsHfapRSKpMZxwRoYXNoAVWN
+Nwf4RYZTgO7MQVUk6KSZYFHTlIJD8ZT38ZFXI+nmAQ5jb21taXRtZW50TGVhZgAG
+Agpwcm90b2NvbElkATCVfuYdYTRZuwUI5OGvPWohv9b7+x0xgqd55UV04FaxB21l
+c3NhZ2UBNTepURXI6oXcUvergfJxZVEFJlOUQleviRPoe9SbsdM=
 
 -----END STRICT TYPE LIB-----
 
diff --git a/stl/CommitVerify@0.1.0.stl b/stl/CommitVerify@0.1.0.stl
index 24680ecd..383a6391 100644
Binary files a/stl/CommitVerify@0.1.0.stl and b/stl/CommitVerify@0.1.0.stl differ
diff --git a/stl/CommitVerify@0.1.0.sty b/stl/CommitVerify@0.1.0.sty
index 2efec6a3..4b6b31dc 100644
--- a/stl/CommitVerify@0.1.0.sty
+++ b/stl/CommitVerify@0.1.0.sty
@@ -1,5 +1,5 @@
 {-
-  Id: expand_vertigo_billy_HmAmKqZJ7XKDsyamyaikTq3PXzWgWcuVMXwe13Hzxfq4
+  Id: sensor_correct_total_6RNoZhpeu95My9KqGM7j8BcY4tcNa8rwAjXbXUGteuf9
   Name: CommitVerify
   Version: 0.1.0
   Description: Client-side-validation deterministic commitments
@@ -8,22 +8,32 @@
   License: Apache-2.0
 -}
 
-typelib CommitVerify -- expand_vertigo_billy_HmAmKqZJ7XKDsyamyaikTq3PXzWgWcuVMXwe13Hzxfq4
+typelib CommitVerify
 
-import quota_conan_fashion_3TZmAPf8EkQZnbGS1g8uMGes6jEWPqNkFB6pLUKeoefg as Std
+import left_pierre_food_5cmoZctpx98FbTzWTArm3G53pMzUXuRPXmMhuCd8zyXb as Std
+-- Imports:
+-- U4 := LemonMimosaOrder0Be5p7K6Qec6irJPaXb91KNSg5S9bQRAbCaa88E1MmFTC
 
 
-data MerkleBlock      :: depth Std.U4
+
+-- GammaOreganoPercent0AQM6QXoLnc4uaWWEG1LotnkWXuSqc2p6kPRVuSBJ4Pa8
+data MerkleBlock      :: depth Std.U4 {- LemonMimosaOrder0Be5p7K6Qec6irJPaXb91KNSg5S9bQRAbCaa88E1MmFTC -}
                        , crossSection [TreeNode]
                        , entropy U64?
+-- BazaarOrchidJacket06kxYeCatpncbA9UiTdsFbxbxJdU56x6MdmTRkEeGAv6R
 data MerkleNode       :: [Byte ^ 32]
+-- ApolloTeacherData0Febuvcuc9aB7ggdYN2snGcS8T2qbsC9KhV7BcAUEuM8G
 data MerkleProof      :: pos U16, path [MerkleNode]
-data MerkleTree       :: depth Std.U4
+-- SunsetDerbyLotus0FRXLDrgJRdG69ACAX7wUTwFjAGgjm99CjF7jZGN8sYv8
+data MerkleTree       :: depth Std.U4 {- LemonMimosaOrder0Be5p7K6Qec6irJPaXb91KNSg5S9bQRAbCaa88E1MmFTC -}
                        , entropy U64
                        , messages {[Byte ^ 32] -> Message}
                        , map {U16 -> ProtocolId, Message}
+-- LondonMagnetCake04ajqScXjJ6wQ5af2zgBFzzP7k1qzD6DXXU28taQidCcA
 data Message          :: [Byte ^ 32]
+-- IndigoBuenosFriday04GenVCt5Xq6xtnJDjT98FehgCS8rTmwEzbjwGkaUVjHz
 data ProtocolId       :: [Byte ^ 32]
-data TreeNode         :: concealedNode (depth Std.U4, hash MerkleNode)
+-- ProteinBonusSmart0CLZUZvDSrWd85s7CaYnGikoTAHgihGTY7ApULVJ7Pvjq
+data TreeNode         :: concealedNode (depth Std.U4 {- LemonMimosaOrder0Be5p7K6Qec6irJPaXb91KNSg5S9bQRAbCaa88E1MmFTC -}, hash MerkleNode)
                        | commitmentLeaf (protocolId ProtocolId, message Message)
 


Test patch: