diff --git a/.gitignore b/.gitignore index e2a470c..64b74c2 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,6 @@ node_modules/ # Backup files *.bak *.backup + +# Rust +target/** diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..80f311d --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,836 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "base58ck" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" +dependencies = [ + "bitcoin-internals", + "bitcoin_hashes", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "bech32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" + +[[package]] +name = "bitcoin" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e499f9fc0407f50fe98af744ab44fa67d409f76b6772e1689ec8485eb0c0f66" +dependencies = [ + "base58ck", + "bech32", + "bitcoin-internals", + "bitcoin-io", + "bitcoin-units", + "bitcoin_hashes", + "hex-conservative", + "hex_lit", + "secp256k1", +] + +[[package]] +name = "bitcoin-internals" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" + +[[package]] +name = "bitcoin-io" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" + +[[package]] +name = "bitcoin-private" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" + +[[package]] +name = "bitcoin-units" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" +dependencies = [ + "bitcoin-internals", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "cc" +version = "1.2.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "clap" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elements" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b2569d3495bfdfce36c504fd4d78752ff4a7699f8a33e6f3ee523bddf9f6ad" +dependencies = [ + "bech32", + "bitcoin", + "secp256k1-zkp", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "ghost-cell" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8449d342b1c67f49169e92e71deb7b9b27f30062301a16dbc27a4cc8d2351b7" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex-conservative" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "js-sys" +version = "0.3.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "libc" +version = "0.2.183" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "miniscript" +version = "12.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487906208f38448e186e3deb02f2b8ef046a9078b0de00bdb28bf4fb9b76951c" +dependencies = [ + "bech32", + "bitcoin", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "santiago" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de36022292bc2086eb8f55bffa460fef3475e4459b478820711f4c421feb87ec" +dependencies = [ + "regex", +] + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "bitcoin_hashes", + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-zkp" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52a44aed3002b5ae975f8624c5df3a949cfbf00479e18778b6058fcd213b76e3" +dependencies = [ + "bitcoin-private", + "rand", + "secp256k1", + "secp256k1-zkp-sys", +] + +[[package]] +name = "secp256k1-zkp-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57f08b2d0b143a22e07f798ae4f0ab20d5590d7c68e0d090f2088a48a21d1654" +dependencies = [ + "cc", + "secp256k1-sys", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "simplicity-lang" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e57bd4d84853974a212eab24ed89da54f49fbccf5e33e93bcd29f0a6591cd5" +dependencies = [ + "bitcoin", + "bitcoin_hashes", + "byteorder", + "elements", + "getrandom", + "ghost-cell", + "hex-conservative", + "miniscript", + "santiago", + "simplicity-sys", +] + +[[package]] +name = "simplicity-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3401ee7331f183a5458c0f5a4b3d5d00bde0fd12e2e03728c537df34efae289" +dependencies = [ + "bitcoin_hashes", + "cc", +] + +[[package]] +name = "simplicityhl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aa7477fc9bfef4cc53ae969db00539f0e67af38156822ac79662513d04f6fee" +dependencies = [ + "base64", + "clap", + "either", + "getrandom", + "itertools", + "miniscript", + "pest", + "pest_derive", + "serde", + "serde_json", + "simplicity-lang", +] + +[[package]] +name = "simplicityhl-docs" +version = "0.1.0" +dependencies = [ + "clap", + "serde", + "serde_json", + "simplicityhl", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zerocopy" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2578b716f8a7a858b7f02d5bd870c14bf4ddbbcf3a4c05414ba6503640505e3" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e6cc098ea4d3bd6246687de65af3f920c430e236bee1e3bf2e441463f08a02f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b93692c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "simplicityhl-docs" +version = "0.1.0" +description = "Documentation for SimplicityHL language." +include= ["jets.json"] +edition = "2021" +rust-version = "1.79.0" + +[dependencies] +clap = { version = "4.5.61", features = ["derive"]} +serde = { version = "1.0.188", features = ["derive"]} +serde_json = { version = "1.0.105"} +simplicityhl = "0.4.1" + +[lib] +path = "./docs_crate/lib.rs" + +[[bin]] +name = "simplicityhl-docs-bin" +path = "./docs_crate/main.rs" + diff --git a/docs_crate/jet.rs b/docs_crate/jet.rs new file mode 100644 index 0000000..9fcd258 --- /dev/null +++ b/docs_crate/jet.rs @@ -0,0 +1,1823 @@ +use simplicityhl::simplicity::jet::Elements; + +/// Interface for providing information about jets. +pub trait JetInfo { + /// The description of the jet. + fn description(&self) -> String; + + /// Information about the section to which the jet belongs. + fn section_info(&self) -> String; + + /// Indicates whether the jet is deprecated. + fn is_deprecated(&self) -> bool; +} + +impl JetInfo for Elements { + fn description(&self) -> String { + match self { + Elements::All8 => "Check if the value is `u8::MAX`.", + Elements::All16 => "Check if the value is `u16::MAX`.", + Elements::All32 => "Check if the value is `u32::MAX`.", + Elements::All64 => "Check if the value is `u64::MAX`.", + Elements::And1 => "Bitwise AND of two 1-bit values.", + Elements::And8 => "Bitwise AND of two 8-bit values.", + Elements::And16 => "Bitwise AND of two 16-bit values.", + Elements::And32 => "Bitwise AND of two 32-bit values", + Elements::And64 => "Bitwise AND of two 64-bit values", + Elements::Ch1 => "Bitwise CHOICE of a bit and two 1-bit values. If the bit is true, then take the first value, else take the second value.", + Elements::Ch8 => "Bitwise CHOICE of a bit and two 8-bit values. If the bit is true, then take the first value, else take the second value.", + Elements::Ch16 => "Bitwise CHOICE of a bit and two 16-bit values. If the bit is true, then take the first value, else take the second value.", + Elements::Ch32 => "Bitwise CHOICE of a bit and two 32-bit values. If the bit is true, then take the first value, else take the second value.", + Elements::Ch64 => "Bitwise CHOICE of a bit and two 64-bit values. If the bit is true, then take the first value, else take the second value.", + Elements::Complement1 => "Bitwise NOT of a 1-bit value.", + Elements::Complement8 => "Bitwise NOT of an 8-bit value.", + Elements::Complement16 => "Bitwise NOT of a 16-bit value.", + Elements::Complement32 => "Bitwise NOT of a 32-bit value.", + Elements::Complement64 => "Bitwise NOT of a 64-bit value.", + Elements::Eq1 => "Check if two 1-bit values are equal.", + Elements::Eq8 => "Check if two 8-bit values are equal.", + Elements::Eq16 => "Check if two 16-bit values are equal.", + Elements::Eq32 => "Check if two 32-bit values are equal.", + Elements::Eq64 => "Check if two 64-bit values are equal.", + Elements::Eq256 => "Check if two 256-bit values are equal.", + Elements::FullLeftShift8_1 => "Helper for left-shifting bits. The bits are shifted from a 1-bit value into an 8-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullLeftShift8_2 => "Helper for left-shifting bits. The bits are shifted from a 2-bit value into an 8-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullLeftShift8_4 => "Helper for left-shifting bits. The bits are shifted from a 4-bit value into an 8-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullLeftShift16_1 => "Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 16-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullLeftShift16_2 => "Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 16-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullLeftShift16_4 => "Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 16-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullLeftShift16_8 => "Helper for left-shifting bits. The bits are shifted from an 8-bit value into a 16-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullLeftShift32_1 => "Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 32-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullLeftShift32_2 => "Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 32-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullLeftShift32_4 => "Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 32-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullLeftShift32_8 => "Helper for left-shifting bits. The bits are shifted from an 8-bit value into a 32-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullLeftShift32_16 => "Helper for left-shifting bits. The bits are shifted from a 16-bit value into a 32-bit value. Return the shifted value and the 16 bits that were shifted out.", + Elements::FullLeftShift64_1 => "Helper for left-shifting bits. The bits are shifted from a 1-bit value into a 64-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullLeftShift64_2 => "Helper for left-shifting bits. The bits are shifted from a 2-bit value into a 64-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullLeftShift64_4 => "Helper for left-shifting bits. The bits are shifted from a 4-bit value into a 64-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullLeftShift64_8 => "Helper for left-shifting bits. The bits are shifted from an 8-bit value into a 64-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullLeftShift64_16 => "Helper for left-shifting bits. The bits are shifted from a 16-bit value into a 64-bit value. Return the shifted value and the 16 bits that were shifted out.", + Elements::FullLeftShift64_32 => "Helper for left-shifting bits. The bits are shifted from a 32-bit value into a 64-bit value. Return the shifted value and the 32 bits that were shifted out.", + Elements::FullRightShift8_1 => "Helper for right-shifting bits. The bits are shifted from a 1-bit value into an 8-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullRightShift8_2 => "Helper for right-shifting bits. The bits are shifted from a 2-bit value into an 8-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullRightShift8_4 => "Helper for right-shifting bits. The bits are shifted from a 4-bit value into an 8-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullRightShift16_1 => "Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 16-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullRightShift16_2 => "Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 16-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullRightShift16_4 => "Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 16-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullRightShift16_8 => "Helper for right-shifting bits. The bits are shifted from an 8-bit value into a 16-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullRightShift32_1 => "Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 32-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullRightShift32_2 => "Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 32-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullRightShift32_4 => "Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 32-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullRightShift32_8 => "Helper for right-shifting bits. The bits are shifted from an 8-bit value into a 32-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullRightShift32_16 => "Helper for right-shifting bits. The bits are shifted from a 16-bit value into a 32-bit value. Return the shifted value and the 16 bits that were shifted out.", + Elements::FullRightShift64_1 => "Helper for right-shifting bits. The bits are shifted from a 1-bit value into a 64-bit value. Return the shifted value and the 1 bit that was shifted out.", + Elements::FullRightShift64_2 => "Helper for right-shifting bits. The bits are shifted from a 2-bit value into a 64-bit value. Return the shifted value and the 2 bits that were shifted out.", + Elements::FullRightShift64_4 => "Helper for right-shifting bits. The bits are shifted from a 4-bit value into a 64-bit value. Return the shifted value and the 4 bits that were shifted out.", + Elements::FullRightShift64_8 => "Helper for right-shifting bits. The bits are shifted from an 8-bit value into a 64-bit value. Return the shifted value and the 8 bits that were shifted out.", + Elements::FullRightShift64_16 => "Helper for right-shifting bits. The bits are shifted from a 16-bit value into a 64-bit value. Return the shifted value and the 16 bits that were shifted out.", + Elements::FullRightShift64_32 => "Helper for right-shifting bits. The bits are shifted from a 32-bit value into a 64-bit value. Return the shifted value and the 32 bits that were shifted out.", + Elements::High1 => "Return `u1::MAX` = 1.", + Elements::High8 => "Return `u8::MAX`.", + Elements::High16 => "Return `u16::MAX`.", + Elements::High32 => "Return `u32::MAX`.", + Elements::High64 => "Return `u64::MAX`.", + Elements::LeftExtend1_8 => "Extend a 1-bit value to an 8-bit value by padding its left with the MSB.", + Elements::LeftExtend1_16 => "Extend a 1-bit value to a 16-bit value by padding its left with the MSB.", + Elements::LeftExtend1_32 => "Extend a 1-bit value to a 32-bit value by padding its left with the MSB.", + Elements::LeftExtend1_64 => "Extend a 1-bit value to a 64-bit value by padding its left with the MSB.", + Elements::LeftExtend8_16 => "Extend an 8-bit value to a 16-bit value by padding its left with the MSB.", + Elements::LeftExtend8_32 => "Extend an 8-bit value to a 32-bit value by padding its left with the MSB.", + Elements::LeftExtend8_64 => "Extend an 8-bit value to a 64-bit value by padding its left with the MSB.", + Elements::LeftExtend16_32 => "Extend a 16-bit value to a 32-bit value by padding its left with the MSB.", + Elements::LeftExtend16_64 => "Extend a 16-bit value to a 64-bit value by padding its left with the MSB.", + Elements::LeftExtend32_64 => "Extend a 32-bit value to a 64-bit value by padding its left with the MSB.", + Elements::LeftPadHigh1_8 => "Extend a 1-bit value to an 8-bit value by padding its left with ones.", + Elements::LeftPadHigh1_16 => "Extend a 1-bit value to a 16-bit value by padding its left with ones.", + Elements::LeftPadHigh1_32 => "Extend a 1-bit value to a 32-bit value by padding its left with ones.", + Elements::LeftPadHigh1_64 => "Extend a 1-bit value to a 64-bit value by padding its left with ones.", + Elements::LeftPadHigh8_16 => "Extend an 8-bit value to a 16-bit value by padding its left with ones.", + Elements::LeftPadHigh8_32 => "Extend an 8-bit value to a 32-bit value by padding its left with ones.", + Elements::LeftPadHigh8_64 => "Extend an 8-bit value to a 64-bit value by padding its left with ones.", + Elements::LeftPadHigh16_32 => "Extend a 16-bit value to a 32-bit value by padding its left with ones.", + Elements::LeftPadHigh16_64 => "Extend a 16-bit value to a 64-bit value by padding its left with ones.", + Elements::LeftPadHigh32_64 => "Extend a 32-bit value to a 64-bit value by padding its left with ones.", + Elements::LeftPadLow1_8 => "Extend a 1-bit value to an 8-bit value by padding its left with zeroes.", + Elements::LeftPadLow1_16 => "Extend a 1-bit value to a 16-bit value by padding its left with zeroes.", + Elements::LeftPadLow1_32 => "Extend a 1-bit value to a 32-bit value by padding its left with zeroes.", + Elements::LeftPadLow1_64 => "Extend a 1-bit value to a 64-bit value by padding its left with zeroes.", + Elements::LeftPadLow8_16 => "Extend an 8-bit value to a 16-bit value by padding its left with zeroes.", + Elements::LeftPadLow8_32 => "Extend an 8-bit value to a 32-bit value by padding its left with zeroes.", + Elements::LeftPadLow8_64 => "Extend an 8-bit value to a 64-bit value by padding its left with zeroes.", + Elements::LeftPadLow16_32 => "Extend a 16-bit value to a 32-bit value by padding its left with zeroes.", + Elements::LeftPadLow16_64 => "Extend a 16-bit value to a 64-bit value by padding its left with zeroes.", + Elements::LeftPadLow32_64 => "Extend a 32-bit value to a 64-bit value by padding its left with zeroes.", + Elements::LeftRotate8 => "Left-rotate an 8-bit value by the given amount.", + Elements::LeftRotate16 => "Left-rotate a 16-bit value by the given amount.", + Elements::LeftRotate32 => "Left-rotate a 32-bit value by the given amount.", + Elements::LeftRotate64 => "Left-rotate a 64-bit value by the given amount.", + Elements::LeftShift8 => "Left-shift an 8-bit value by the given amount. Bits are filled with zeroes.", + Elements::LeftShift16 => "Left-shift a 16-bit value by the given amount. Bits are filled with zeroes.", + Elements::LeftShift32 => "Left-shift a 32-bit value by the given amount. Bits are filled with zeroes.", + Elements::LeftShift64 => "Left-shift a 64-bit value by the given amount. Bits are filled with zeroes.", + Elements::LeftShiftWith8 => "Left-shift an 8-bit value by the given amount. Bits are filled with the given bit.", + Elements::LeftShiftWith16 => "Left-shift a 16-bit value by the given amount. Bits are filled with the given bit.", + Elements::LeftShiftWith32 => "Left-shift a 32-bit value by the given amount. Bits are filled with the given bit.", + Elements::LeftShiftWith64 => "Left-shift a 64-bit value by the given amount. Bits are filled with the given bit.", + Elements::Leftmost8_1 => "Return the most significant 1 bit of an 8-bit value.", + Elements::Leftmost8_2 => "Return the most significant 2 bits of an 8-bit value.", + Elements::Leftmost8_4 => "Return the most significant 4 bits of an 8-bit value.", + Elements::Leftmost16_1 => "Return the most significant 1 bit of a 16-bit value.", + Elements::Leftmost16_2 => "Return the most significant 2 bits of a 16-bit value.", + Elements::Leftmost16_4 => "Return the most significant 4 bits of a 16-bit value.", + Elements::Leftmost16_8 => "Return the most significant 8 bits of a 16-bit value.", + Elements::Leftmost32_1 => "Return the most significant 1 bit of a 32-bit value.", + Elements::Leftmost32_2 => "Return the most significant 2 bits of a 32-bit value.", + Elements::Leftmost32_4 => "Return the most significant 4 bits of a 32-bit value.", + Elements::Leftmost32_8 => "Return the most significant 8 bits of a 32-bit value.", + Elements::Leftmost32_16 => "Return the most significant 16 bits of a 32-bit value.", + Elements::Leftmost64_1 => "Return the most significant 1 bit of a 64-bit value.", + Elements::Leftmost64_2 => "Return the most significant 2 bits of a 64-bit value.", + Elements::Leftmost64_4 => "Return the most significant 4 bits of a 64-bit value.", + Elements::Leftmost64_8 => "Return the most significant 8 bits of a 64-bit value.", + Elements::Leftmost64_16 => "Return the most significant 16 bits of a 64-bit value.", + Elements::Leftmost64_32 => "Return the most significant 32 bits of a 64-bit value.", + Elements::Low1 => "Return `u1::MIN` = 0.", + Elements::Low8 => "Return `u8::MIN` = 0.", + Elements::Low16 => "Return `u16::MIN` = 0.", + Elements::Low32 => "Return `u32::MIN` = 0.", + Elements::Low64 => "Return `u64::MIN` = 0.", + Elements::Maj1 => "Bitwise MAJORITY of three 1-bit values. The output bit is false if two or more input bits are false, and true otherwise.", + Elements::Maj8 => "Bitwise MAJORITY of three 8-bit values. The output bit is false if two or more input bits are false, and true otherwise.", + Elements::Maj16 => "Bitwise MAJORITY of three 16-bit values. The output bit is false if two or more input bits are false, and true otherwise.", + Elements::Maj32 => "Bitwise MAJORITY of three 32-bit values. The output bit is false if two or more input bits are false, and true otherwise.", + Elements::Maj64 => "Bitwise MAJORITY of three 64-bit values. The output bit is false if two or more input bits are false, and true otherwise.", + Elements::Or1 => "Bitwise OR of two 1-bit values.", + Elements::Or8 => "Bitwise OR of two 8-bit values.", + Elements::Or16 => "Bitwise OR of two 16-bit values.", + Elements::Or32 => "Bitwise OR of two 32-bit values.", + Elements::Or64 => "Bitwise OR of two 64-bit values.", + Elements::RightExtend8_16 => "Extend an 8-bit value to a 16-bit value by padding its right with the MSB.", + Elements::RightExtend8_32 => "Extend an 8-bit value to a 32-bit value by padding its right with the MSB.", + Elements::RightExtend8_64 => "Extend an 8-bit value to a 64-bit value by padding its right with the MSB.", + Elements::RightExtend16_32 => "Extend a 16-bit value to a 32-bit value by padding its right with the MSB.", + Elements::RightExtend16_64 => "Extend a 16-bit value to a 64-bit value by padding its right with the MSB.", + Elements::RightExtend32_64 => "Extend a 16-bit value to a 64-bit value by padding its right with the MSB.", + Elements::RightPadHigh1_8 => "Extend a 1-bit value to an 8-bit value by padding its right with ones.", + Elements::RightPadHigh1_16 => "Extend a 1-bit value to a 16-bit value by padding its right with ones.", + Elements::RightPadHigh1_32 => "Extend a 1-bit value to a 32-bit value by padding its right with ones.", + Elements::RightPadHigh1_64 => "Extend a 1-bit value to a 64-bit value by padding its right with ones.", + Elements::RightPadHigh8_16 => "Extend an 8-bit value to a 16-bit value by padding its right with ones.", + Elements::RightPadHigh8_32 => "Extend an 8-bit value to a 32-bit value by padding its right with ones.", + Elements::RightPadHigh8_64 => "Extend a 1-bit value to a 64-bit value by padding its right with ones.", + Elements::RightPadHigh16_32 => "Extend a 16-bit value to a 32-bit value by padding its right with ones.", + Elements::RightPadHigh16_64 => "Extend a 16-bit value to a 64-bit value by padding its right with ones.", + Elements::RightPadHigh32_64 => "Extend a 32-bit value to a 64-bit value by padding its right with ones.", + Elements::RightPadLow1_8 => "Extend a 1-bit value to an 8-bit value by padding its right with zeroes.", + Elements::RightPadLow1_16 => "Extend a 1-bit value to a 16-bit value by padding its right with zeroes.", + Elements::RightPadLow1_32 => "Extend a 1-bit value to a 32-bit value by padding its right with zeroes.", + Elements::RightPadLow1_64 => "Extend a 1-bit value to a 64-bit value by padding its right with zeroes.", + Elements::RightPadLow8_16 => "Extend an 8-bit value to a 16-bit value by padding its right with zeroes.", + Elements::RightPadLow8_32 => "Extend an 8-bit value to a 32-bit value by padding its right with zeroes.", + Elements::RightPadLow8_64 => "Extend an 8-bit value to a 64-bit value by padding its right with zeroes.", + Elements::RightPadLow16_32 => "Extend a 16-bit value to a 32-bit value by padding its right with zeroes.", + Elements::RightPadLow16_64 => "Extend a 16-bit value to a 64-bit value by padding its right with zeroes.", + Elements::RightPadLow32_64 => "Extend a 32-bit value to a 64-bit value by padding its right with zeroes.", + Elements::RightRotate8 => "Right-rotate an 8-bit value by the given amount.", + Elements::RightRotate16 => "Right-rotate a 16-bit value by the given amount.", + Elements::RightRotate32 => "Right-rotate a 32-bit value by the given amount.", + Elements::RightRotate64 => "Right-rotate a 64-bit value by the given amount.", + Elements::RightShift8 => "Right-shift an 8-bit value by the given amount. Bits are filled with zeroes.", + Elements::RightShift16 => "Right-shift a 16-bit value by the given amount. Bits are filled with zeroes.", + Elements::RightShift32 => "Right-shift a 32-bit value by the given amount. Bits are filled with zeroes.", + Elements::RightShift64 => "Right-shift a 64-bit value by the given amount. Bits are filled with zeroes.", + Elements::RightShiftWith8 => "Right-shift an 8-bit value by the given amount. Bits are filled with the given bit.", + Elements::RightShiftWith16 => "Right-shift a 16-bit value by the given amount. Bits are filled with the given bit.", + Elements::RightShiftWith32 => "Right-shift a 32-bit value by the given amount. Bits are filled with the given bit.", + Elements::RightShiftWith64 => "Right-shift a 64-bit value by the given amount. Bits are filled with the given bit.", + Elements::Rightmost8_1 => "Return the least significant 1 bit of an 8-bit value.", + Elements::Rightmost8_2 => "Return the least significant 2 bits of an 8-bit value.", + Elements::Rightmost8_4 => "Return the least significant 4 bits of an 8-bit value.", + Elements::Rightmost16_1 => "Return the least significant 1 bit of a 16-bit value.", + Elements::Rightmost16_2 => "Return the least significant 2 bits of a 16-bit value.", + Elements::Rightmost16_4 => "Return the least significant 4 bits of a 16-bit value.", + Elements::Rightmost16_8 => "Return the least significant 8 bits of a 16-bit value.", + Elements::Rightmost32_1 => "Return the least significant 1 bit of a 32-bit value.", + Elements::Rightmost32_2 => "Return the least significant 2 bits of a 32-bit value.", + Elements::Rightmost32_4 => "Return the least significant 4 bits of a 32-bit value.", + Elements::Rightmost32_8 => "Return the least significant 8 bits of a 32-bit value.", + Elements::Rightmost32_16 => "Return the least significant 16 bits of a 32-bit value.", + Elements::Rightmost64_1 => "Return the least significant 1 bit of a 64-bit value.", + Elements::Rightmost64_2 => "Return the least significant 2 bits of a 64-bit value.", + Elements::Rightmost64_4 => "Return the least significant 4 bits of a 64-bit value.", + Elements::Rightmost64_8 => "Return the least significant 8 bits of a 64-bit value.", + Elements::Rightmost64_16 => "Return the least significant 16 bits of a 64-bit value.", + Elements::Rightmost64_32 => "Return the least significant 32 bits of a 64-bit value.", + Elements::Some1 => "Check if a 1-bit value is nonzero.", + Elements::Some8 => "Check if an 8-bit value is nonzero.", + Elements::Some16 => "Check if a 16-bit value is nonzero.", + Elements::Some32 => "Check if a 32-bit value is nonzero.", + Elements::Some64 => "Check if a 64-bit value is nonzero.", + Elements::Verify => +"Assert that a bit is true. + +## Panics +The assertion fails.", + Elements::Xor1 => "Bitwise XOR of two 1-bit values.", + Elements::Xor8 => "Bitwise XOR of two 8-bit values.", + Elements::Xor16 => "Bitwise XOR of two 16-bit values.", + Elements::Xor32 => "Bitwise XOR of two 32-bit values.", + Elements::Xor64 => "Bitwise XOR of two 64-bit values.", + Elements::XorXor1 => "Bitwise XOR of three 1-bit values.", + Elements::XorXor8 => "Bitwise XOR of three 8-bit values.", + Elements::XorXor16 => "Bitwise XOR of three 16-bit values.", + Elements::XorXor32 => "Bitwise XOR of three 32-bit values.", + Elements::XorXor64 => "Bitwise XOR of three 64-bit values.", + Elements::Add8 => "Add two integers and return the carry.", + Elements::Add16 => "Add two integers and return the carry.", + Elements::Add32 => "Add two integers and return the carry.", + Elements::Add64 => "Add two integers and return the carry.", + Elements::Decrement8 => "Decrement an integer by one and return the borrow bit.", + Elements::Decrement16 => "Decrement an integer by one and return the borrow bit.", + Elements::Decrement32 => "Decrement an integer by one and return the borrow bit.", + Elements::Decrement64 => "Decrement an integer by one and return the borrow bit.", + Elements::DivMod8 => "Divide the first integer by the second integer, and return the remainder.", + Elements::DivMod16 => "Divide the first integer by the second integer, and return the remainder.", + Elements::DivMod32 => "Divide the first integer by the second integer, and return the remainder.", + Elements::DivMod64 => "Divide the first integer by the second integer, and return the remainder.", + Elements::DivMod128_64 => +"Divide the 128-bit integer `a` by the 64-bit integer `b`. +Return a tuple of the quotient `q` and the remainder `r`. + +Use this jet to recursively define wide integer divisions. + +## Preconditions +1. `q` < 2^64 +2. 2^63 ≤ `b` + +Return `(u64::MAX, u64::MAX)` when the preconditions are not satisfied.", + Elements::Divide8 => "Divide the first integer by the second integer.", + Elements::Divide16 => "Divide the first integer by the second integer.", + Elements::Divide32 => "Divide the first integer by the second integer.", + Elements::Divide64 => "Divide the first integer by the second integer.", + Elements::Divides8 => "Check if the first integer is divisible by the second integer.", + Elements::Divides16 => "Check if the first integer is divisible by the second integer.", + Elements::Divides32 => "Check if the first integer is divisible by the second integer.", + Elements::Divides64 => "Check if the first integer is divisible by the second integer.", + Elements::FullAdd8 => "Add two integers. Take a carry-in and return a carry-out.", + Elements::FullAdd16 => "Add two integers. Take a carry-in and return a carry-out.", + Elements::FullAdd32 => "Add two integers. Take a carry-in and return a carry-out.", + Elements::FullAdd64 => "Add two integers. Take a carry-in and return a carry-out.", + Elements::FullDecrement8 => "Decrement an integer by one. Take a borrow-in and return a borrow-out.", + Elements::FullDecrement16 => "Decrement an integer by one. Take a borrow-in and return a borrow-out.", + Elements::FullDecrement32 => "Decrement an integer by one. Take a borrow-in and return a borrow-out.", + Elements::FullDecrement64 => "Decrement an integer by one. Take a borrow-in and return a borrow-out.", + Elements::FullIncrement8 => "Increment an integer by one. Take a carry-in and return a carry-out.", + Elements::FullIncrement16 => "Increment an integer by one. Take a carry-in and return a carry-out.", + Elements::FullIncrement32 => "Increment an integer by one. Take a carry-in and return a carry-out.", + Elements::FullIncrement64 => "Increment an integer by one. Take a carry-in and return a carry-out.", + Elements::FullMultiply8 => "Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.", + Elements::FullMultiply16 => "Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.", + Elements::FullMultiply32 => "Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.", + Elements::FullMultiply64 => "Helper for multiplying integers. Take the product of the first pair of integers and add the sum of the second pair.", + Elements::FullSubtract8 => "Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.", + Elements::FullSubtract16 => "Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.", + Elements::FullSubtract32 => "Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.", + Elements::FullSubtract64 => "Subtract the second integer from the first integer. Take a borrow-in and return a borrow-out.", + Elements::Increment8 => "Increment an integer by one and return the carry.", + Elements::Increment16 => "Increment an integer by one and return the carry.", + Elements::Increment32 => "Increment an integer by one and return the carry.", + Elements::Increment64 => "Increment an integer by one and return the carry.", + Elements::IsOne8 => "Check if an integer is one.", + Elements::IsOne16 => "Check if an integer is one.", + Elements::IsOne32 => "Check if an integer is one.", + Elements::IsOne64 => "Check if an integer is one.", + Elements::IsZero8 => "Check if an integer is zero.", + Elements::IsZero16 => "Check if an integer is zero.", + Elements::IsZero32 => "Check if an integer is zero.", + Elements::IsZero64 => "Check if an integer is zero.", + Elements::Le8 => "Check if an integer is less than or equal to another integer.", + Elements::Le16 => "Check if an integer is less than or equal to another integer.", + Elements::Le32 => "Check if an integer is less than or equal to another integer.", + Elements::Le64 => "Check if an integer is less than or equal to another integer.", + Elements::Lt8 => "Check if an integer is less than another integer.", + Elements::Lt16 => "Check if an integer is less than another integer.", + Elements::Lt32 => "Check if an integer is less than another integer.", + Elements::Lt64 => "Check if an integer is less than another integer.", + Elements::Max8 => "Return the bigger of two integers.", + Elements::Max16 => "Return the bigger of two integers.", + Elements::Max32 => "Return the bigger of two integers.", + Elements::Max64 => "Return the bigger of two integers.", + Elements::Median8 => "Return the median of three integers.", + Elements::Median16 => "Return the median of three integers.", + Elements::Median32 => "Return the median of three integers.", + Elements::Median64 => "Return the median of three integers.", + Elements::Min8 => "Return the smaller of two integers.", + Elements::Min16 => "Return the smaller of two integers.", + Elements::Min32 => "Return the smaller of two integers.", + Elements::Min64 => "Return the smaller of two integers.", + Elements::Modulo8 => "Compute the remainder after dividing both integers.", + Elements::Modulo16 => "Compute the remainder after dividing both integers.", + Elements::Modulo32 => "Compute the remainder after dividing both integers.", + Elements::Modulo64 => "Compute the remainder after dividing both integers.", + Elements::Multiply8 => "Multiply two integers. The output is a 16-bit integer.", + Elements::Multiply16 => "Multiply two integers. The output is a 32-bit integer.", + Elements::Multiply32 => "Multiply two integers. The output is a 64-bit integer.", + Elements::Multiply64 => "Multiply two integers. The output is a 128-bit integer.", + Elements::Negate8 => "Negate the integer (modulo 2⁸) and return the borrow bit.", + Elements::Negate16 => "Negate the integer (modulo 2¹⁶) and return the borrow bit.", + Elements::Negate32 => "Negate the integer (modulo 2³²) and return the borrow bit.", + Elements::Negate64 => "Negate the integer (modulo 2⁶⁴) and return the borrow bit.", + Elements::One8 => "Return 1 as an 8-bit integer.", + Elements::One16 => "Return 1 as a 16-bit integer.", + Elements::One32 => "Return 1 as a 32-bit integer.", + Elements::One64 => "Return 1 as a 64-bit integer.", + Elements::Subtract8 => "Subtract the second integer from the first integer, and return the borrow bit.", + Elements::Subtract16 => "Subtract the second integer from the first integer, and return the borrow bit.", + Elements::Subtract32 => "Subtract the second integer from the first integer, and return the borrow bit.", + Elements::Subtract64 => "Subtract the second integer from the first integer, and return the borrow bit.", + Elements::Sha256Block => "Update the given 256-bit midstate by running the SHA256 block compression function, using the given 512-bit block.", + Elements::Sha256Ctx8Add1 => "Add 1 byte to the SHA256 hash engine.", + Elements::Sha256Ctx8Add2 => "Add 2 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add4 => "Add 4 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add8 => "Add 8 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add16 => "Add 16 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add32 => "Add 32 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add64 => "Add 64 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add128 => "Add 128 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add256 => "Add 256 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Add512 => "Add 512 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8AddBuffer511 => "Add a list of less than 512 bytes to the SHA256 hash engine.", + Elements::Sha256Ctx8Finalize => "Produce a hash from the current state of the SHA256 hash engine.", + Elements::Sha256Ctx8Init => "Initialize a default SHA256 hash engine.", + Elements::Sha256Iv => "Return the SHA256 initial value.", + Elements::Decompress => +"Decompress a point into affine coordinates. + +- Return `None` if the x-coordinate is not on the curve. +- Return `Some(ge)` even if the x-coordinate is not normalized.", + Elements::FeAdd => "Add two field elements.", + Elements::FeInvert => "Compute the modular inverse of a field element.", + Elements::FeIsOdd => "Check if the canonical representative of the field element is odd.", + Elements::FeIsZero => "Check if the field element represents zero.", + Elements::FeMultiply => "Multiply two field elements.", + Elements::FeMultiplyBeta => "Multiply a field element by the canonical primitive cube root of unity (beta).", + Elements::FeNegate => "Negate a field element.", + Elements::FeNormalize => "Return the canonical representation of a field element.", + Elements::FeSquare => "Square a field element.", + Elements::FeSquareRoot => "Compute the modular square root of a field element if it exists.", + Elements::GeIsOnCurve => "Check if the given point satisfies the curve equation y² = x³ + 7.", + Elements::GejIsOnCurve => "Check if the given point satisfies the curve equation y² = x³ + 7.", + Elements::GeNegate => "Negate a point.", + Elements::GejNegate => "Negate a point.", + Elements::GejAdd => "Add two points.", + Elements::GejDouble => "Double a point. If the result is the point at infinity, it is returned in canonical form.", + Elements::GejEquiv => "Check if two points represent the same point.", + Elements::GejGeAdd => "Add two points. If the result is the point at infinity, it is returned in canonical form.", + Elements::GejGeAddEx => "Add two points. Also return the ration of the `a`s z-coordinate and the result's z-coordinate. If the result is the point at infinity, it is returned in canonical form.", + Elements::GejGeEquiv => "Check if two points represent the same point.", + Elements::GejInfinity => "Return the canonical representation of the point at infinity.", + Elements::GejIsInfinity => "Check if the point represents infinity.", + Elements::GejNormalize => "Convert the point into affine coordinates with canonical field representatives. If the result is the point at infinity, it is returned in canonical form.", + Elements::GejRescale => "Change the representatives of a point by multiplying the z-coefficient by the given value.", + Elements::GejXEquiv => "Check if the point represents an affine point with the given x-coordinate.", + Elements::GejYIsOdd => "Check if the point represents an affine point with odd y-coordinate.", + Elements::Generate => "Multiply the generator point with the given scalar.", + Elements::LinearCombination1 => "Compute the linear combination `b * a + c * g` for point `b` and scalars `a` and `c`, where `g` is the generator point.", + Elements::LinearVerify1 => +"Assert that a point `b` is equal to the linear combination `a.0 * a.1 + a.2 * g`, where `g` is the generator point. + +## Panics +The assertion fails.", + Elements::PointVerify1 => +"Assert that a point `b` is equal to the linear combination `a.0 * a.1 + a.2 * g`, where `g` is the generator point. + +## Panics +- The assertion fails. +- Fails if the points cannot be decompressed.", + Elements::ScalarAdd => "Add two scalars.", + Elements::ScalarInvert => "Compute the modular inverse of a scalar.", + Elements::ScalarIsZero => "Check if the scalar represents zero.", + Elements::ScalarMultiply => "Multiply two scalars.", + Elements::ScalarMultiplyLambda => "Multiply a scalar with the canonical primitive cube of unity (lambda)", + Elements::ScalarNegate => "Negate a scalar.", + Elements::ScalarNormalize => "Return the canonical representation of the scalar.", + Elements::ScalarSquare => "Square a scalar.", + Elements::Scale => "Multiply a point by a scalar.", + Elements::HashToCurve => +"A cryptographic hash function that results in a point on the secp256k1 curve. + +This matches the hash function used to map asset IDs to asset commitments.", + Elements::Swu => +"Algebraically distribute a field element over the secp256k1 curve as defined in +'Indifferentiable Hashing to Barreto-Naehrig Curves' by Pierre-Alain Fouque, Mehdi Tibouchi. + +While this by itself is not a cryptographic hash function, it can be used as a subroutine in a `hash_to_curve` function. However, the distribution only approaches uniformity when it is called twice.", + Elements::Bip0340Verify => +"Assert that a Schnorr signature matches a public key and message. + +## Panics +The assertion fails.", + Elements::CheckSigVerify => +"Assert that a Schnorr signature matches a public key and message, using a custom sighash mode. + +## Panics +The assertion fails. + +## Safety +This jet should not be used directly.", + Elements::ParseLock => "Parse an integer as a consensus-encoded Bitcoin lock time.", + Elements::ParseSequence => "Parse an integer as a consensus-encoded Bitcoin sequence number.", + Elements::TapdataInit => "Create a SHA256 context, initialized with a `TapData` tag.", + Elements::AnnexHash => +"Continue a SHA256 hash with an optional hash by appending the following: +- If there is no hash, then the byte `0x00`. +- If there is a hash, then the byte `0x01` followed by the given hash (32 bytes).", + Elements::AssetAmountHash => "Continue a SHA256 hash with the serialization of a confidential asset followed by the serialization of a amount.", + Elements::BuildTapbranch => +"Return the SHA256 hash of the following: +- The hash of the ASCII string `TapBranch/elements` (32 bytes). +- The lexicographically smaller of the two inputs (32 bytes). +- The hash of the ASCII string `TapBranch/elements` again (32 bytes). +- The lexicographically larger of the two inputs (32 bytes). + +This builds a taproot from two branches.", + Elements::BuildTapleafSimplicity => +"Return the SHA256 hash of the following: +- The hash of the ASCII string `TapLeaf/elements` (32 bytes). +- The hash of the ASCII string `TapLeaf/elements` again (32 bytes). +- The Simplicity leaf version `0xbe` (1 byte). +- The byte `0x20` (1 byte). +- The input CMR (32 bytes). + +This builds a tapleaf hash for a Simplicity program.", + Elements::BuildTaptweak => +"Implementation of `taproot_tweak_pubkey` from BIP-0341. + +## Panics +1. The input x-only public key is off curve or exceeds the field size. +2. The internal hash value `t` exceeds the secp256k1 group order. +3. The generated tweaked point is infinity, and thus has no valid x-only public key. + +Note that situations 2 and 3 are cryptographically impossible to occur.", + Elements::InputAmountsHash => "Return the SHA256 hash of the serialization of each input UTXO's asset and amount fields.", + Elements::InputAnnexesHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- If the input has no annex, or isn't a taproot spend, then the byte `0x00`. +- If the input has an annex, then the byte `0x01` followed by the SHA256 hash of the annex (32 bytes).", + Elements::InputOutpointsHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- If the input is not a pegin, then the byte `0x00`. +- If the input is a pegin, then the byte `0x01` followed by the parent chain's genesis hash (32 bytes). +- The input's serialized previous transaction ID (32 bytes). +- The input's previous transaction index in big endian format (4 bytes). + +IMPORTANT: the index is serialized in big endian format rather than little endian format.", + Elements::InputScriptSigsHash => +"Return the SHA256 hash of the concatenation of the SHA256 hash of each input's scriptSig. + +Note that if an input's UTXO uses segwit, then it's scriptSig will necessarily be the empty string. In such cases we still use the SHA256 hash of the empty string.", + Elements::InputScriptsHash => "Return the SHA256 hash of the concatenation of the SHA256 hash of each input UTXO's scriptPubKey.", + Elements::InputSequencesHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- The input's sequence number in big endian format (4 bytes). + +IMPORTANT: the sequence number is serialized in big endian format rather than little endian format.", + Elements::InputUtxoHash => +"Return the SHA256 hash of the following: +- The serialization of the input UTXO's asset and amount fields. +- The SHA256 hash of the input UTXO's scriptPubKey. + +Return `None` if the input does not exist.", + Elements::InputUtxosHash => +"Return the SHA256 hash of the following: +- The result of `input_amounts_hash` (32 bytes). +- The result of `input_scripts_hash` (32 bytes).", + Elements::InputHash => +"Return the SHA256 hash of the following: +- If the input is not a pegin, then the byte `0x00`. +- If the input is a pegin, then the byte `0x01` followed by the parent chain's genesis hash (32 bytes). +- The input's serialized previous transaction ID (32 bytes). +- The input's previous transaction index in big endian format (4 bytes). +- The input's sequence number in big endian format (4 bytes). +- If the input has no annex, or isn't a taproot spend, then the byte `0x00`. +- If the input has an annex, then the byte `0x01` followed by the SHA256 hash of the annex (32 bytes). + +Return `None` if the input does not exist.", + Elements::InputsHash => +"Return the SHA256 hash of the following: +- The result of `input_outpoints_hash` (32 bytes). +- The result of `input_sequences_hash` (32 bytes). +- The result of `input_annexes_hash` (32 bytes).", + Elements::IssuanceAssetAmountsHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- If the input has no issuance then two bytes `0x00 0x00`. +- If the input is has a new issuance then the byte `0x01` followed by a serialization of the calculated issued asset id (32 bytes) followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes). +- If the input is has a reissuance then the byte `0x01` followed by a serialization of the issued asset id +(32 bytes), followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes). + +IMPORTANT: If there is an issuance but there are no asset issued (i.e. the amount is null) we serialize the value as the explicit 0 amount, (i.e. `0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00`). + +Note, the issuance asset id is serialized in the same format as an explicit asset id would be.", + Elements::IssuanceBlindingEntropyHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- If the input has no issuance then the byte `0x00`. +- If the input is has a new issuance then the byte `0x01` followed by 32 `0x00` bytes and the new issuance's contract hash field (32 bytes). +- If the input is has reissuance then the byte `0x01` followed by a serialization of the reissuance's blinding nonce field (32 bytes) and the reissuance's entropy field (32 bytes). + +Note that if the issuance is a new issuance then the blinding nonce field is 32 `0x00` bytes and new issuance's contract hash.", + Elements::IssuanceRangeProofsHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- The SHA256 hash of the range proof of the input's issuance asset amount (32 bytes). +- The SHA256 hash of the range proof of the input's issuance token amount (32 bytes). + +Note that each the range proof is considered to be the empty string in the case there is no issuance, or if the asset or token amount doesn't exist (i.e is null). The SHA256 hash of the empty string is still used in these cases.", + Elements::IssuanceTokenAmountsHash => +"Return the SHA256 hash of the concatenation of the following for every input: +- If the input has no issuance then two bytes `0x00 0x00`. +- If the input is has a new issuance then the byte `0x01` followed by a serialization of the calculated issued token id (32 bytes) followed by the serialization of the (possibly confidential) issued token amount (9 bytes or 33 bytes). +- If the input is has a reissuance then the byte `0x01` followed by a serialization of the issued token id +(32 bytes), followed by the serialization of the explicit 0 amount (i.e `0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00`) (9 bytes). + +IMPORTANT: If there is an issuance but there are no tokens issued (i.e. the amount is null) we serialize the value as the explicit 0 amount, (i.e. `0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00`). + +Note, the issuance token id is serialized in the same format as an explicit asset id would be.", + Elements::IssuanceHash => +"Return the SHA256 hash of the following: +1. The asset issuance: +- If the input has no issuance then two bytes `0x00 0x00`. +- If the input is has a new issuance then the byte `0x01` followed by a serialization of the calculated issued asset id (32 bytes) followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes). +- If the input is has a reissuance then the byte `0x01` followed by a serialization of the issued asset id +(32 bytes), followed by the serialization of the (possibly confidential) issued asset amount (9 bytes or 33 bytes). +2. The token issuance: +- If the input has no issuance then two bytes `0x00 0x00`. +- If the input is has a new issuance then the byte `0x01` followed by a serialization of the calculated issued token id (32 bytes) followed by the serialization of the (possibly confidential) issued token amount (9 bytes or 33 bytes). +- If the input is has a reissuance then the byte `0x01` followed by a serialization of the issued token id (32 bytes), followed by the serialization of the explicit 0 amount (i.e `0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00`) (9 bytes). +3. The range proofs: +- The SHA256 hash of the range proof of the input's issuance asset amount (32 bytes). +- The SHA256 hash of the range proof of the input's issuance token amount (32 bytes). +4. The blinding entropy: +- If the input has no issuance then the byte `0x00`. +- If the input is has a new issuance then the byte `0x01` followed by 32 `0x00` bytes and the new issuance's contract hash field (32 bytes). +- If the input is has reissuance then the byte `0x01` followed by a serialization of the reissuance's blinding nonce field (32 bytes) and the reissuance's entropy field (32 bytes). + +Return `None` if the input does not exist.", + Elements::IssuancesHash => +"Return the SHA256 hash of the following: +- The result of `issuance_asset_amounts_hash` (32 bytes). +- The result of `issuance_token_amounts_hash` (32 bytes). +- The result of `issuance_range_proofs_hash` (32 bytes). +- The result of `issuance_blinding_entropy_hash` (32 bytes).", + Elements::NonceHash => "Continue the SHA256 hash with the serialization of an optional nonce.", + Elements::OutpointHash => +"Continue the SHA256 hash with an optional pegin and an outpoint by appending the following: +- If the input is not a pegin, then the byte `0x00`. +- If the input is a pegin, then the byte `0x01` followed by the given parent genesis hash (32 bytes). +- The input's previous transaction ID (32 bytes). +- The input's previous transaction index in big endian format (4 bytes).", + Elements::OutputAmountsHash => "Return the SHA256 hash of the serialization of each output's asset and amount fields.", + Elements::OutputNoncesHash => "Return the SHA256 hash of the serialization of each output's nonce field.", + Elements::OutputRangeProofsHash => +"Return the SHA256 hash of the concatenation of the SHA256 hash of each output's range proof. + +Note that if the output's amount is explicit then the range proof is considered the empty string.", + Elements::OutputScriptsHash => "Return the SHA256 hash of the concatenation of the SHA256 hash of each output's scriptPubKey.", + Elements::OutputSurjectionProofsHash => +"Return the SHA256 hash of the concatenation of the SHA256 hash of each output's surjection proof. + +Note that if the output's asset is explicit then the surjection proof is considered the empty string.", + Elements::OutputHash => +"Return the SHA256 hash of the following: +- The serialization of the output's asset and amount fields. +- The serialization of the output's nonce field. +- The SHA256 hash of the output's scriptPubKey. +- The SHA256 hash of the output's range proof. + +Return `None` if the output does not exist. + +Note: the result of `output_surjection_proofs_hash` is specifically excluded because surjection proofs are dependent on the inputs as well as the output.", + Elements::OutputsHash => +"Return the SHA256 hash of the following: +- The result of `output_amounts_hash` (32 bytes). +- The result of `output_nonces_hash` (32 bytes). +- The result of `output_scripts_hash` (32 bytes). +- The result of `output_range_proofs_hash` (32 bytes). + +Note: the result of `output_surjection_proofs_hash` is specifically excluded because surjection proofs are dependent on the inputs as well as the output. See also `tx_hash`.", + Elements::SigAllHash => +"Return the SHA256 hash of the following: +- The result of `genesis_block_hash` (32 bytes). +- The result of `genesis_block_hash` again (32 bytes). +- The result of `tx_hash` (32 bytes). +- The result of `tap_env_hash` (32 bytes). +- The result of `current_index` (Note: this is in big endian format) (4 bytes). + +Note: the two copies of the `genesis_block_hash` values effectively makes this result a BIP-340 style tagged hash.", + Elements::TapEnvHash => +"Return the SHA256 hash of the following: +- The result of `tapleaf_hash` (32 bytes). +- The result of `tappath_hash` (32 bytes). +- The result of `internal_key` (32 bytes).", + Elements::TapleafHash => +"Return the SHA256 hash of the following: +- The hash of the ASCII string `TapLeaf/elements` (32 bytes). +- The hash of the ASCII string `TapLeaf/elements` again (32 bytes). +- The result of `tapleaf_version` (1 byte). +- The byte `0x20` (1 byte). +- The result of `script_cmr` (32 bytes). + +Note: this matches Elements's modified BIP-0341 definition of tapleaf hash.", + Elements::TappathHash => +"Return a hash of the current input's control block excluding the leaf version and the taproot internal key. + +Using the notation of BIP-0341, it returns the SHA256 hash of c33: 33 + 32m.", + Elements::TxHash => +"Return the SHA256 hash of the following: +- The result of `version` (Note: this is in big endian format) (4 bytes). +- The result of `tx_lock_time` (Note: this is in big endian format) (4 bytes). +- The result of `inputs_hash` (32 bytes). +- The result of `outputs_hash` (32 bytes). +- The result of `issuances_hash` (32 bytes). +- The result of `output_surjection_proofs_hash` (32 bytes). +- The result of `input_utxos_hash` (32 bytes).", + Elements::CheckLockDistance => +"**Deprecated; do not use.** Assert that the value returned by `tx_lock_distance` is greater than or equal to the given value. + +## Panics +The assertion fails.", + Elements::CheckLockDuration => +"**Deprecated; do not use.** Assert that the value returned by `tx_lock_duration` is greater than or equal to the given value. + +## Panics +The assertion fails", + Elements::CheckLockHeight => +"Assert that the value returned by `tx_lock_height` is greater than or equal to the given value. + +## Panics +The assertion fails.", + Elements::CheckLockTime => +"Assert that the value returned by `tx_lock_time` is greater than or equal to the given value. + +## Panics +The assertion fails.", + Elements::TxIsFinal => "Check if the sequence numbers of all transaction inputs are at their maximum value.", + Elements::TxLockDistance => "**Deprecated; do not use.** If `version` returns 2 or greater, then return the greatest valid `Distance` value of any transaction input. Return zeroes otherwise.", + Elements::TxLockDuration => "**Deprecated; do not use.** If `version` returns 2 or greater, then return the greatest valid `Duration` value of any transaction input. Return zeroes otherwise.", + Elements::TxLockHeight => "If `tx_is_final` returns false, then try to parse the transaction's lock time as a `Height` value. Return zeroes otherwise.", + Elements::TxLockTime => "If `tx_is_final` returns false, then try to parse the transaction's lock time as a `Time` value. Return zeroes otherwise.", + Elements::CalculateAsset => "Calculate the issued asset id from a given entropy value.", + Elements::CalculateConfidentialToken => "Calculate the reissuance token id from a given entropy value for assets with confidential issued amounts.", + Elements::CalculateExplicitToken => "Calculate the reissuance token id from a given entropy value for assets with explicit issued amounts.", + Elements::CalculateIssuanceEntropy => +"Calculate the entropy value from a given outpoint and contract hash. + +This entropy value is used to compute issued asset and token IDs.", + Elements::Issuance => +"Return the kind of issuance of the input at the given index: +- Return `Some(Some(false))` if the input has new issuance. +- Return `Some(Some(true))` if the input has reissuance. +- Return `Some(None)` if the input has no issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceAsset => +"Return the ID of the issued asset of the input at the given index: +- Return `Some(Some(x))` if the input has issuance with asset id `x`. +- Return `Some(None)` if the input has no issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceEntropy => +"Return the issuance entropy of the input at the given index: +- Return `Some(Some(x))` if the input has reissuance with entropy `x` or if there is new issuance whose computed entropy is `x`. +- Return `Some(None)` if the input has no issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceToken => +"Return the reissuance token of the input at the given index: +- Return `Some(Some(x))` if the input has issuance with the reissuance token ID `x`. +- Return `Some(None)` if the input has no issuance. +- Return `None` if the input does not exist.", + Elements::LbtcAsset => "Return the asset for Liquid Bitcoin.", + Elements::CurrentAmount => "Return the `input_amount` at the `current_index`.", + Elements::CurrentAnnexHash => "Return the `input_annex_hash` at the `current_index`.", + Elements::CurrentAsset => "Return the `input_asset` at the `current_index`.", + Elements::CurrentIndex => "Return the index of the current txin.", + Elements::CurrentIssuanceAssetAmount => "Return the `issuance_asset_amount` at the `current_index`.", + Elements::CurrentIssuanceAssetProof => "Return the `issuance_asset_proof` at the `current_index`.", + Elements::CurrentIssuanceTokenAmount => "Return the `issuance_token_amount` at the `current_index`.", + Elements::CurrentIssuanceTokenProof => "Return the `issuance_token_proof` at the `current_index`.", + Elements::CurrentNewIssuanceContract => "Return the `new_issuance_contract` at the `current_index`.", + Elements::CurrentPegin => "Return the `input_pegin` at the `current_index`.", + Elements::CurrentPrevOutpoint => "Return the previous outpoint of the current txin.", + Elements::CurrentReissuanceBlinding => "Return the `reissuance_blinding` at the `current_index`.", + Elements::CurrentReissuanceEntropy => "Return the `reissuance_entropy` at the `current_index`.", + Elements::CurrentScriptHash => "Return the SHA256 hash of the scriptPubKey of the UTXO of the current txin.", + Elements::CurrentScriptSigHash => +"Return the SHA256 hash of the scriptSig of the current txin. + +SegWit UTXOs enforce scriptSig to be the empty string. In such cases, we return the SHA256 hash of the empty string.", + Elements::CurrentSequence => +"Return the nSequence of the current txin. + +Use this jet to obtain the raw, encoded sequence number. +Use `tx_lock_distance` to obtain a relative block height, or `tx_lock_duration` to obtain a relative UNIX timestamp, in a safe manner.", + Elements::GenesisBlockHash => "Return the SHA256 hash of the genesis block.", + Elements::InputAmount => +"Return the asset id and the asset amount at the given input index. + +Return `None` if the input does not exist.", + Elements::InputAnnexHash => +"Return the SHA256 hash of the annex at the given input: +- Return `Some(Some(x))` if the input has an annex that hashes to `x`. +- Return `Some(None)` if the input has no annex. +- Return `None` if the input does not exist.", + Elements::InputAsset => +"Return the asset id of the input at the given index. + +Return `None` if the input does not exist.", + Elements::InputPegin => +"Return the parent genesis block hash if the input at the given index is a peg-in. + +- Return `Some(None)` if the input is not a peg-in. +- Return `None` if the input does not exist.", + Elements::InputPrevOutpoint => +"Return the previous outpoint of the input at the given index. + +Return `None` if the input does not exist.", + Elements::InputScriptHash => +"Return the SHA256 hash of the scriptPubKey of the UTXO of the input at the given index. + +Return `None` if the input does not exist.", + Elements::InputScriptSigHash => +"Return the SHA256 hash of the scriptSigKey of the input at the given index. + +Return `None` if the input does not exist. + +SegWit UTXOs enforce scriptSig to be the empty string. In such cases, we return the SHA256 hash of the empty string.", + Elements::InputSequence => +"Return the nSequence of the input at the given index. + +Return `None` if the input does not exist.", + Elements::InternalKey => +"Return the internal key of the current input. + +We assume that Simplicity can be spent in Taproot outputs only, so there always exists an internal key.", + Elements::IssuanceAssetAmount => +"Return the possibly confidential amount of the issuance if the input at the given index has an issuance. + +- Return `Some(None)` if the input does not have an issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceAssetProof => +"Return the SHA256 hash of the range proof for the amount of the issuance at the given input index. + +- Return the hash of the empty string if the input does not have an issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceTokenAmount => +"Return the possibly confidential amount of the reissuance tokens if the input at the given index has an issuance. + +- Return `Some(Some(Right(0)))` if the input is itself a reissuance. +- Return `Some(None)` if the input does not have an issuance. +- Return `None` if the input does not exist.", + Elements::IssuanceTokenProof => +"Return the SHA256 hash of the range proof for the amount of the reissuance tokens at the given input index. + +- Return the hash of the empty string if the input does not have an issuance. +- Return `None` if the input does not exist.", + Elements::LockTime => "Return the lock time of the transaction.", + Elements::NewIssuanceContract => +"Return the contract hash for the new issuance at the given input index. + +- Return `Some(None)` if the input does not have a new issuance. +- Return `None` if the input does not exist.", + Elements::NumInputs => "Return the number of inputs of the transaction.", + Elements::NumOutputs => "Return the number of outputs of the transaction.", + Elements::OutputAmount => +"Return the asset amount of the output at the given index. +Return `None` if the output does not exist.", + Elements::OutputAsset => +"Return the asset id of the output at the given index. + +Return `None` if the output does not exist.", + Elements::OutputIsFee => +"Check if the output at the given index is a fee output. + +Return `None` if the output does not exist.", + Elements::OutputNonce => +"Return the nonce of the output at the given index. + +- Return `Some(None)` if the output does not have a nonce. +- Return `None` if the output does not exist.", + Elements::OutputNullDatum => +"Return the `b`-th entry of a null data (`OP_RETURN`) output at index `a`. + +- Return `Some(Some(Right(Right(x-1))))` if the entry is `OP_x` for `x` in the range 1..=16. +- Return `Some(Some(Right(Left(0))))` if the entry is `OP_1NEGATE`. +- Return `Some(Some(Right(Left(1))))` if the entry is `OP_RESERVED`. +- Return `Some(Some(Left((x, hash))))` if the entry is pushed data. `hash` is the SHA256 hash of the data pushed and `x` indicates how the data was pushed: +- `x == 0` means the push was an immediate 0 to 75 bytes. +- `x == 1` means the push was an `OP_PUSHDATA1`. +- `x == 2` means the push was an `OP_PUSHDATA2`. +- `x == 3` means the push was an `OP_PUSHDATA4`. +- Return `Some(None)` if the null data has fewer than `b` entries. +- Return `None` if the output is not a null data output. + +Use this jet to read peg-out data from an output.", + Elements::OutputRangeProof => +"Return the SHA256 hash of the range proof of the output at the given index. + +Return `None` if the output does not exist.", + Elements::OutputScriptHash => +"Return the SHA256 hash of the scriptPubKey of the output at the given index. + +Return `None` if the output does not exist.", + Elements::OutputSurjectionProof => +"Return the SHA256 hash of the surjection proof of the output at the given index. + +Return `None` if the output does not exist.", + Elements::ReissuanceBlinding => +"Return the blinding factor used for the reissuance at the given input index. + +- Return `Some(None)` if the input does not have a reissuance. +- Return `None` if the input does not exist.", + Elements::ReissuanceEntropy => +"Return the entropy used for the reissuance at the given input index. + +- Return `Some(None)` if the input does not have a reissuance. +- Return `None` if the input does not exist.", + Elements::ScriptCMR => +"Return the CMR of the Simplicity program in the current input. + +This is the CMR of the currently executed Simplicity program.", + Elements::TapleafVersion => +"Return the tap leaf version of the current input. + +We assume that Simplicity can be spent in Taproot outputs only, so there always exists a tap leaf.", + Elements::Tappath => +"Return the SHA256 hash of the tap path of the current input. + +We assume that Simplicity can be spent in Taproot outputs only, so there always exists a tap path.", + Elements::TotalFee => +"Return the total amount of fees paid to the given asset id. + +Return zero for any asset without fees.", + Elements::TransactionId => "Return the transaction ID.", + Elements::Version => "Return the version number of the transaction.", + }.to_string() + } + + fn section_info(&self) -> String { + match self { + Elements::All8 + | Elements::All16 + | Elements::All32 + | Elements::All64 + | Elements::And1 + | Elements::And8 + | Elements::And16 + | Elements::And32 + | Elements::And64 + | Elements::Ch1 + | Elements::Ch8 + | Elements::Ch16 + | Elements::Ch32 + | Elements::Ch64 + | Elements::Complement1 + | Elements::Complement8 + | Elements::Complement16 + | Elements::Complement32 + | Elements::Complement64 + | Elements::Eq1 + | Elements::Eq8 + | Elements::Eq16 + | Elements::Eq32 + | Elements::Eq64 + | Elements::Eq256 + | Elements::FullLeftShift8_1 + | Elements::FullLeftShift8_2 + | Elements::FullLeftShift8_4 + | Elements::FullLeftShift16_1 + | Elements::FullLeftShift16_2 + | Elements::FullLeftShift16_4 + | Elements::FullLeftShift16_8 + | Elements::FullLeftShift32_1 + | Elements::FullLeftShift32_2 + | Elements::FullLeftShift32_4 + | Elements::FullLeftShift32_8 + | Elements::FullLeftShift32_16 + | Elements::FullLeftShift64_1 + | Elements::FullLeftShift64_2 + | Elements::FullLeftShift64_4 + | Elements::FullLeftShift64_8 + | Elements::FullLeftShift64_16 + | Elements::FullLeftShift64_32 + | Elements::FullRightShift8_1 + | Elements::FullRightShift8_2 + | Elements::FullRightShift8_4 + | Elements::FullRightShift16_1 + | Elements::FullRightShift16_2 + | Elements::FullRightShift16_4 + | Elements::FullRightShift16_8 + | Elements::FullRightShift32_1 + | Elements::FullRightShift32_2 + | Elements::FullRightShift32_4 + | Elements::FullRightShift32_8 + | Elements::FullRightShift32_16 + | Elements::FullRightShift64_1 + | Elements::FullRightShift64_2 + | Elements::FullRightShift64_4 + | Elements::FullRightShift64_8 + | Elements::FullRightShift64_16 + | Elements::FullRightShift64_32 + | Elements::High1 + | Elements::High8 + | Elements::High16 + | Elements::High32 + | Elements::High64 + | Elements::LeftExtend1_8 + | Elements::LeftExtend1_16 + | Elements::LeftExtend1_32 + | Elements::LeftExtend1_64 + | Elements::LeftExtend8_16 + | Elements::LeftExtend8_32 + | Elements::LeftExtend8_64 + | Elements::LeftExtend16_32 + | Elements::LeftExtend16_64 + | Elements::LeftExtend32_64 + | Elements::LeftPadHigh1_8 + | Elements::LeftPadHigh1_16 + | Elements::LeftPadHigh1_32 + | Elements::LeftPadHigh1_64 + | Elements::LeftPadHigh8_16 + | Elements::LeftPadHigh8_32 + | Elements::LeftPadHigh8_64 + | Elements::LeftPadHigh16_32 + | Elements::LeftPadHigh16_64 + | Elements::LeftPadHigh32_64 + | Elements::LeftPadLow1_8 + | Elements::LeftPadLow1_16 + | Elements::LeftPadLow1_32 + | Elements::LeftPadLow1_64 + | Elements::LeftPadLow8_16 + | Elements::LeftPadLow8_32 + | Elements::LeftPadLow8_64 + | Elements::LeftPadLow16_32 + | Elements::LeftPadLow16_64 + | Elements::LeftPadLow32_64 + | Elements::LeftRotate8 + | Elements::LeftRotate16 + | Elements::LeftRotate32 + | Elements::LeftRotate64 + | Elements::LeftShift8 + | Elements::LeftShift16 + | Elements::LeftShift32 + | Elements::LeftShift64 + | Elements::LeftShiftWith8 + | Elements::LeftShiftWith16 + | Elements::LeftShiftWith32 + | Elements::LeftShiftWith64 + | Elements::Leftmost8_1 + | Elements::Leftmost8_2 + | Elements::Leftmost8_4 + | Elements::Leftmost16_1 + | Elements::Leftmost16_2 + | Elements::Leftmost16_4 + | Elements::Leftmost16_8 + | Elements::Leftmost32_1 + | Elements::Leftmost32_2 + | Elements::Leftmost32_4 + | Elements::Leftmost32_8 + | Elements::Leftmost32_16 + | Elements::Leftmost64_1 + | Elements::Leftmost64_2 + | Elements::Leftmost64_4 + | Elements::Leftmost64_8 + | Elements::Leftmost64_16 + | Elements::Leftmost64_32 + | Elements::Low1 + | Elements::Low8 + | Elements::Low16 + | Elements::Low32 + | Elements::Low64 + | Elements::Maj1 + | Elements::Maj8 + | Elements::Maj16 + | Elements::Maj32 + | Elements::Maj64 + | Elements::Or1 + | Elements::Or8 + | Elements::Or16 + | Elements::Or32 + | Elements::Or64 + | Elements::RightExtend8_16 + | Elements::RightExtend8_32 + | Elements::RightExtend8_64 + | Elements::RightExtend16_32 + | Elements::RightExtend16_64 + | Elements::RightExtend32_64 + | Elements::RightPadHigh1_8 + | Elements::RightPadHigh1_16 + | Elements::RightPadHigh1_32 + | Elements::RightPadHigh1_64 + | Elements::RightPadHigh8_16 + | Elements::RightPadHigh8_32 + | Elements::RightPadHigh8_64 + | Elements::RightPadHigh16_32 + | Elements::RightPadHigh16_64 + | Elements::RightPadHigh32_64 + | Elements::RightPadLow1_8 + | Elements::RightPadLow1_16 + | Elements::RightPadLow1_32 + | Elements::RightPadLow1_64 + | Elements::RightPadLow8_16 + | Elements::RightPadLow8_32 + | Elements::RightPadLow8_64 + | Elements::RightPadLow16_32 + | Elements::RightPadLow16_64 + | Elements::RightPadLow32_64 + | Elements::RightRotate8 + | Elements::RightRotate16 + | Elements::RightRotate32 + | Elements::RightRotate64 + | Elements::RightShift8 + | Elements::RightShift16 + | Elements::RightShift32 + | Elements::RightShift64 + | Elements::RightShiftWith8 + | Elements::RightShiftWith16 + | Elements::RightShiftWith32 + | Elements::RightShiftWith64 + | Elements::Rightmost8_1 + | Elements::Rightmost8_2 + | Elements::Rightmost8_4 + | Elements::Rightmost16_1 + | Elements::Rightmost16_2 + | Elements::Rightmost16_4 + | Elements::Rightmost16_8 + | Elements::Rightmost32_1 + | Elements::Rightmost32_2 + | Elements::Rightmost32_4 + | Elements::Rightmost32_8 + | Elements::Rightmost32_16 + | Elements::Rightmost64_1 + | Elements::Rightmost64_2 + | Elements::Rightmost64_4 + | Elements::Rightmost64_8 + | Elements::Rightmost64_16 + | Elements::Rightmost64_32 + | Elements::Some1 + | Elements::Some8 + | Elements::Some16 + | Elements::Some32 + | Elements::Some64 + | Elements::Verify + | Elements::Xor1 + | Elements::Xor8 + | Elements::Xor16 + | Elements::Xor32 + | Elements::Xor64 + | Elements::XorXor1 + | Elements::XorXor8 + | Elements::XorXor16 + | Elements::XorXor32 + | Elements::XorXor64 => "Multi-bit logic", + Elements::Add8 + | Elements::Add16 + | Elements::Add32 + | Elements::Add64 + | Elements::Decrement8 + | Elements::Decrement16 + | Elements::Decrement32 + | Elements::Decrement64 + | Elements::DivMod8 + | Elements::DivMod16 + | Elements::DivMod32 + | Elements::DivMod64 + | Elements::DivMod128_64 + | Elements::Divide8 + | Elements::Divide16 + | Elements::Divide32 + | Elements::Divide64 + | Elements::Divides8 + | Elements::Divides16 + | Elements::Divides32 + | Elements::Divides64 + | Elements::FullAdd8 + | Elements::FullAdd16 + | Elements::FullAdd32 + | Elements::FullAdd64 + | Elements::FullDecrement8 + | Elements::FullDecrement16 + | Elements::FullDecrement32 + | Elements::FullDecrement64 + | Elements::FullIncrement8 + | Elements::FullIncrement16 + | Elements::FullIncrement32 + | Elements::FullIncrement64 + | Elements::FullMultiply8 + | Elements::FullMultiply16 + | Elements::FullMultiply32 + | Elements::FullMultiply64 + | Elements::FullSubtract8 + | Elements::FullSubtract16 + | Elements::FullSubtract32 + | Elements::FullSubtract64 + | Elements::Increment8 + | Elements::Increment16 + | Elements::Increment32 + | Elements::Increment64 + | Elements::IsOne8 + | Elements::IsOne16 + | Elements::IsOne32 + | Elements::IsOne64 + | Elements::IsZero8 + | Elements::IsZero16 + | Elements::IsZero32 + | Elements::IsZero64 + | Elements::Le8 + | Elements::Le16 + | Elements::Le32 + | Elements::Le64 + | Elements::Lt8 + | Elements::Lt16 + | Elements::Lt32 + | Elements::Lt64 + | Elements::Max8 + | Elements::Max16 + | Elements::Max32 + | Elements::Max64 + | Elements::Median8 + | Elements::Median16 + | Elements::Median32 + | Elements::Median64 + | Elements::Min8 + | Elements::Min16 + | Elements::Min32 + | Elements::Min64 + | Elements::Modulo8 + | Elements::Modulo16 + | Elements::Modulo32 + | Elements::Modulo64 + | Elements::Multiply8 + | Elements::Multiply16 + | Elements::Multiply32 + | Elements::Multiply64 + | Elements::Negate8 + | Elements::Negate16 + | Elements::Negate32 + | Elements::Negate64 + | Elements::One8 + | Elements::One16 + | Elements::One32 + | Elements::One64 + | Elements::Subtract8 + | Elements::Subtract16 + | Elements::Subtract32 + | Elements::Subtract64 => "Arithmetic", + Elements::Sha256Block + | Elements::Sha256Ctx8Add1 + | Elements::Sha256Ctx8Add2 + | Elements::Sha256Ctx8Add4 + | Elements::Sha256Ctx8Add8 + | Elements::Sha256Ctx8Add16 + | Elements::Sha256Ctx8Add32 + | Elements::Sha256Ctx8Add64 + | Elements::Sha256Ctx8Add128 + | Elements::Sha256Ctx8Add256 + | Elements::Sha256Ctx8Add512 + | Elements::Sha256Ctx8AddBuffer511 + | Elements::Sha256Ctx8Finalize + | Elements::Sha256Ctx8Init + | Elements::Sha256Iv => "Hash functions", + Elements::Decompress + | Elements::FeAdd + | Elements::FeInvert + | Elements::FeIsOdd + | Elements::FeIsZero + | Elements::FeMultiply + | Elements::FeMultiplyBeta + | Elements::FeNegate + | Elements::FeNormalize + | Elements::FeSquare + | Elements::FeSquareRoot + | Elements::GeIsOnCurve + | Elements::GejIsOnCurve + | Elements::GeNegate + | Elements::GejNegate + | Elements::GejAdd + | Elements::GejDouble + | Elements::GejEquiv + | Elements::GejGeAdd + | Elements::GejGeAddEx + | Elements::GejGeEquiv + | Elements::GejInfinity + | Elements::GejIsInfinity + | Elements::GejNormalize + | Elements::GejRescale + | Elements::GejXEquiv + | Elements::GejYIsOdd + | Elements::Generate + | Elements::LinearCombination1 + | Elements::LinearVerify1 + | Elements::PointVerify1 + | Elements::ScalarAdd + | Elements::ScalarInvert + | Elements::ScalarIsZero + | Elements::ScalarMultiply + | Elements::ScalarMultiplyLambda + | Elements::ScalarNegate + | Elements::ScalarNormalize + | Elements::ScalarSquare + | Elements::Scale + | Elements::HashToCurve + | Elements::Swu => "Elliptic curve functions", + Elements::Bip0340Verify | Elements::CheckSigVerify => "Digital Signatures", + Elements::ParseLock | Elements::ParseSequence | Elements::TapdataInit => { + "Bitcoin (without primitives)" + } + Elements::AnnexHash + | Elements::AssetAmountHash + | Elements::BuildTapbranch + | Elements::BuildTapleafSimplicity + | Elements::BuildTaptweak + | Elements::InputAmountsHash + | Elements::InputAnnexesHash + | Elements::InputOutpointsHash + | Elements::InputScriptSigsHash + | Elements::InputScriptsHash + | Elements::InputSequencesHash + | Elements::InputUtxoHash + | Elements::InputUtxosHash + | Elements::InputHash + | Elements::InputsHash + | Elements::IssuanceAssetAmountsHash + | Elements::IssuanceBlindingEntropyHash + | Elements::IssuanceRangeProofsHash + | Elements::IssuanceTokenAmountsHash + | Elements::IssuanceHash + | Elements::IssuancesHash + | Elements::NonceHash + | Elements::OutpointHash + | Elements::OutputAmountsHash + | Elements::OutputNoncesHash + | Elements::OutputRangeProofsHash + | Elements::OutputScriptsHash + | Elements::OutputSurjectionProofsHash + | Elements::OutputHash + | Elements::OutputsHash + | Elements::SigAllHash + | Elements::TapEnvHash + | Elements::TapleafHash + | Elements::TappathHash + | Elements::TxHash => "Signature hash modes", + Elements::CheckLockDistance + | Elements::CheckLockDuration + | Elements::CheckLockHeight + | Elements::CheckLockTime + | Elements::TxIsFinal + | Elements::TxLockDistance + | Elements::TxLockDuration + | Elements::TxLockHeight + | Elements::TxLockTime => "Time locks", + Elements::CalculateAsset + | Elements::CalculateConfidentialToken + | Elements::CalculateExplicitToken + | Elements::CalculateIssuanceEntropy + | Elements::Issuance + | Elements::IssuanceAsset + | Elements::IssuanceEntropy + | Elements::IssuanceToken + | Elements::LbtcAsset => "Issuance", + Elements::CurrentAmount + | Elements::CurrentAnnexHash + | Elements::CurrentAsset + | Elements::CurrentIndex + | Elements::CurrentIssuanceAssetAmount + | Elements::CurrentIssuanceAssetProof + | Elements::CurrentIssuanceTokenAmount + | Elements::CurrentIssuanceTokenProof + | Elements::CurrentNewIssuanceContract + | Elements::CurrentPegin + | Elements::CurrentPrevOutpoint + | Elements::CurrentReissuanceBlinding + | Elements::CurrentReissuanceEntropy + | Elements::CurrentScriptHash + | Elements::CurrentScriptSigHash + | Elements::CurrentSequence + | Elements::GenesisBlockHash + | Elements::InputAmount + | Elements::InputAnnexHash + | Elements::InputAsset + | Elements::InputPegin + | Elements::InputPrevOutpoint + | Elements::InputScriptHash + | Elements::InputScriptSigHash + | Elements::InputSequence + | Elements::InternalKey + | Elements::IssuanceAssetAmount + | Elements::IssuanceAssetProof + | Elements::IssuanceTokenAmount + | Elements::IssuanceTokenProof + | Elements::LockTime + | Elements::NewIssuanceContract + | Elements::NumInputs + | Elements::NumOutputs + | Elements::OutputAmount + | Elements::OutputAsset + | Elements::OutputIsFee + | Elements::OutputNonce + | Elements::OutputNullDatum + | Elements::OutputRangeProof + | Elements::OutputScriptHash + | Elements::OutputSurjectionProof + | Elements::ReissuanceBlinding + | Elements::ReissuanceEntropy + | Elements::ScriptCMR + | Elements::TapleafVersion + | Elements::Tappath + | Elements::TotalFee + | Elements::TransactionId + | Elements::Version => "Transaction", + } + .to_string() + } + + fn is_deprecated(&self) -> bool { + matches!( + self, + Elements::CheckLockDistance + | Elements::CheckLockDuration + | Elements::TxLockDistance + | Elements::TxLockDuration + ) + } +} + +/// All [`Elements`] jets, sorted as in documentation. +pub const ALL_JETS_SORTED: [Elements; 471] = [ + Elements::All8, + Elements::All16, + Elements::All32, + Elements::All64, + Elements::And1, + Elements::And8, + Elements::And16, + Elements::And32, + Elements::And64, + Elements::Ch1, + Elements::Ch8, + Elements::Ch16, + Elements::Ch32, + Elements::Ch64, + Elements::Complement1, + Elements::Complement8, + Elements::Complement16, + Elements::Complement32, + Elements::Complement64, + Elements::Eq1, + Elements::Eq8, + Elements::Eq16, + Elements::Eq32, + Elements::Eq64, + Elements::Eq256, + Elements::FullLeftShift8_1, + Elements::FullLeftShift8_2, + Elements::FullLeftShift8_4, + Elements::FullLeftShift16_1, + Elements::FullLeftShift16_2, + Elements::FullLeftShift16_4, + Elements::FullLeftShift16_8, + Elements::FullLeftShift32_1, + Elements::FullLeftShift32_2, + Elements::FullLeftShift32_4, + Elements::FullLeftShift32_8, + Elements::FullLeftShift32_16, + Elements::FullLeftShift64_1, + Elements::FullLeftShift64_2, + Elements::FullLeftShift64_4, + Elements::FullLeftShift64_8, + Elements::FullLeftShift64_16, + Elements::FullLeftShift64_32, + Elements::FullRightShift8_1, + Elements::FullRightShift8_2, + Elements::FullRightShift8_4, + Elements::FullRightShift16_1, + Elements::FullRightShift16_2, + Elements::FullRightShift16_4, + Elements::FullRightShift16_8, + Elements::FullRightShift32_1, + Elements::FullRightShift32_2, + Elements::FullRightShift32_4, + Elements::FullRightShift32_8, + Elements::FullRightShift32_16, + Elements::FullRightShift64_1, + Elements::FullRightShift64_2, + Elements::FullRightShift64_4, + Elements::FullRightShift64_8, + Elements::FullRightShift64_16, + Elements::FullRightShift64_32, + Elements::High1, + Elements::High8, + Elements::High16, + Elements::High32, + Elements::High64, + Elements::LeftExtend1_8, + Elements::LeftExtend1_16, + Elements::LeftExtend1_32, + Elements::LeftExtend1_64, + Elements::LeftExtend8_16, + Elements::LeftExtend8_32, + Elements::LeftExtend8_64, + Elements::LeftExtend16_32, + Elements::LeftExtend16_64, + Elements::LeftExtend32_64, + Elements::LeftPadHigh1_8, + Elements::LeftPadHigh1_16, + Elements::LeftPadHigh1_32, + Elements::LeftPadHigh1_64, + Elements::LeftPadHigh8_16, + Elements::LeftPadHigh8_32, + Elements::LeftPadHigh8_64, + Elements::LeftPadHigh16_32, + Elements::LeftPadHigh16_64, + Elements::LeftPadHigh32_64, + Elements::LeftPadLow1_8, + Elements::LeftPadLow1_16, + Elements::LeftPadLow1_32, + Elements::LeftPadLow1_64, + Elements::LeftPadLow8_16, + Elements::LeftPadLow8_32, + Elements::LeftPadLow8_64, + Elements::LeftPadLow16_32, + Elements::LeftPadLow16_64, + Elements::LeftPadLow32_64, + Elements::LeftRotate8, + Elements::LeftRotate16, + Elements::LeftRotate32, + Elements::LeftRotate64, + Elements::LeftShift8, + Elements::LeftShift16, + Elements::LeftShift32, + Elements::LeftShift64, + Elements::LeftShiftWith8, + Elements::LeftShiftWith16, + Elements::LeftShiftWith32, + Elements::LeftShiftWith64, + Elements::Leftmost8_1, + Elements::Leftmost8_2, + Elements::Leftmost8_4, + Elements::Leftmost16_1, + Elements::Leftmost16_2, + Elements::Leftmost16_4, + Elements::Leftmost16_8, + Elements::Leftmost32_1, + Elements::Leftmost32_2, + Elements::Leftmost32_4, + Elements::Leftmost32_8, + Elements::Leftmost32_16, + Elements::Leftmost64_1, + Elements::Leftmost64_2, + Elements::Leftmost64_4, + Elements::Leftmost64_8, + Elements::Leftmost64_16, + Elements::Leftmost64_32, + Elements::Low1, + Elements::Low8, + Elements::Low16, + Elements::Low32, + Elements::Low64, + Elements::Maj1, + Elements::Maj8, + Elements::Maj16, + Elements::Maj32, + Elements::Maj64, + Elements::Or1, + Elements::Or8, + Elements::Or16, + Elements::Or32, + Elements::Or64, + Elements::RightExtend8_16, + Elements::RightExtend8_32, + Elements::RightExtend8_64, + Elements::RightExtend16_32, + Elements::RightExtend16_64, + Elements::RightExtend32_64, + Elements::RightPadHigh1_8, + Elements::RightPadHigh1_16, + Elements::RightPadHigh1_32, + Elements::RightPadHigh1_64, + Elements::RightPadHigh8_16, + Elements::RightPadHigh8_32, + Elements::RightPadHigh8_64, + Elements::RightPadHigh16_32, + Elements::RightPadHigh16_64, + Elements::RightPadHigh32_64, + Elements::RightPadLow1_8, + Elements::RightPadLow1_16, + Elements::RightPadLow1_32, + Elements::RightPadLow1_64, + Elements::RightPadLow8_16, + Elements::RightPadLow8_32, + Elements::RightPadLow8_64, + Elements::RightPadLow16_32, + Elements::RightPadLow16_64, + Elements::RightPadLow32_64, + Elements::RightRotate8, + Elements::RightRotate16, + Elements::RightRotate32, + Elements::RightRotate64, + Elements::RightShift8, + Elements::RightShift16, + Elements::RightShift32, + Elements::RightShift64, + Elements::RightShiftWith8, + Elements::RightShiftWith16, + Elements::RightShiftWith32, + Elements::RightShiftWith64, + Elements::Rightmost8_1, + Elements::Rightmost8_2, + Elements::Rightmost8_4, + Elements::Rightmost16_1, + Elements::Rightmost16_2, + Elements::Rightmost16_4, + Elements::Rightmost16_8, + Elements::Rightmost32_1, + Elements::Rightmost32_2, + Elements::Rightmost32_4, + Elements::Rightmost32_8, + Elements::Rightmost32_16, + Elements::Rightmost64_1, + Elements::Rightmost64_2, + Elements::Rightmost64_4, + Elements::Rightmost64_8, + Elements::Rightmost64_16, + Elements::Rightmost64_32, + Elements::Some1, + Elements::Some8, + Elements::Some16, + Elements::Some32, + Elements::Some64, + Elements::Verify, + Elements::Xor1, + Elements::Xor8, + Elements::Xor16, + Elements::Xor32, + Elements::Xor64, + Elements::XorXor1, + Elements::XorXor8, + Elements::XorXor16, + Elements::XorXor32, + Elements::XorXor64, + Elements::Add8, + Elements::Add16, + Elements::Add32, + Elements::Add64, + Elements::Decrement8, + Elements::Decrement16, + Elements::Decrement32, + Elements::Decrement64, + Elements::DivMod8, + Elements::DivMod16, + Elements::DivMod32, + Elements::DivMod64, + Elements::DivMod128_64, + Elements::Divide8, + Elements::Divide16, + Elements::Divide32, + Elements::Divide64, + Elements::Divides8, + Elements::Divides16, + Elements::Divides32, + Elements::Divides64, + Elements::FullAdd8, + Elements::FullAdd16, + Elements::FullAdd32, + Elements::FullAdd64, + Elements::FullDecrement8, + Elements::FullDecrement16, + Elements::FullDecrement32, + Elements::FullDecrement64, + Elements::FullIncrement8, + Elements::FullIncrement16, + Elements::FullIncrement32, + Elements::FullIncrement64, + Elements::FullMultiply8, + Elements::FullMultiply16, + Elements::FullMultiply32, + Elements::FullMultiply64, + Elements::FullSubtract8, + Elements::FullSubtract16, + Elements::FullSubtract32, + Elements::FullSubtract64, + Elements::Increment8, + Elements::Increment16, + Elements::Increment32, + Elements::Increment64, + Elements::IsOne8, + Elements::IsOne16, + Elements::IsOne32, + Elements::IsOne64, + Elements::IsZero8, + Elements::IsZero16, + Elements::IsZero32, + Elements::IsZero64, + Elements::Le8, + Elements::Le16, + Elements::Le32, + Elements::Le64, + Elements::Lt8, + Elements::Lt16, + Elements::Lt32, + Elements::Lt64, + Elements::Max8, + Elements::Max16, + Elements::Max32, + Elements::Max64, + Elements::Median8, + Elements::Median16, + Elements::Median32, + Elements::Median64, + Elements::Min8, + Elements::Min16, + Elements::Min32, + Elements::Min64, + Elements::Modulo8, + Elements::Modulo16, + Elements::Modulo32, + Elements::Modulo64, + Elements::Multiply8, + Elements::Multiply16, + Elements::Multiply32, + Elements::Multiply64, + Elements::Negate8, + Elements::Negate16, + Elements::Negate32, + Elements::Negate64, + Elements::One8, + Elements::One16, + Elements::One32, + Elements::One64, + Elements::Subtract8, + Elements::Subtract16, + Elements::Subtract32, + Elements::Subtract64, + Elements::Sha256Block, + Elements::Sha256Ctx8Add1, + Elements::Sha256Ctx8Add2, + Elements::Sha256Ctx8Add4, + Elements::Sha256Ctx8Add8, + Elements::Sha256Ctx8Add16, + Elements::Sha256Ctx8Add32, + Elements::Sha256Ctx8Add64, + Elements::Sha256Ctx8Add128, + Elements::Sha256Ctx8Add256, + Elements::Sha256Ctx8Add512, + Elements::Sha256Ctx8AddBuffer511, + Elements::Sha256Ctx8Finalize, + Elements::Sha256Ctx8Init, + Elements::Sha256Iv, + Elements::Decompress, + Elements::FeAdd, + Elements::FeInvert, + Elements::FeIsOdd, + Elements::FeIsZero, + Elements::FeMultiply, + Elements::FeMultiplyBeta, + Elements::FeNegate, + Elements::FeNormalize, + Elements::FeSquare, + Elements::FeSquareRoot, + Elements::GeIsOnCurve, + Elements::GejIsOnCurve, + Elements::GeNegate, + Elements::GejNegate, + Elements::GejAdd, + Elements::GejDouble, + Elements::GejEquiv, + Elements::GejGeAdd, + Elements::GejGeAddEx, + Elements::GejGeEquiv, + Elements::GejInfinity, + Elements::GejIsInfinity, + Elements::GejNormalize, + Elements::GejRescale, + Elements::GejXEquiv, + Elements::GejYIsOdd, + Elements::Generate, + Elements::LinearCombination1, + Elements::LinearVerify1, + Elements::PointVerify1, + Elements::ScalarAdd, + Elements::ScalarInvert, + Elements::ScalarIsZero, + Elements::ScalarMultiply, + Elements::ScalarMultiplyLambda, + Elements::ScalarNegate, + Elements::ScalarNormalize, + Elements::ScalarSquare, + Elements::Scale, + Elements::HashToCurve, + Elements::Swu, + Elements::Bip0340Verify, + Elements::CheckSigVerify, + Elements::ParseLock, + Elements::ParseSequence, + Elements::TapdataInit, + Elements::AnnexHash, + Elements::AssetAmountHash, + Elements::BuildTapbranch, + Elements::BuildTapleafSimplicity, + Elements::BuildTaptweak, + Elements::InputAmountsHash, + Elements::InputAnnexesHash, + Elements::InputOutpointsHash, + Elements::InputScriptSigsHash, + Elements::InputScriptsHash, + Elements::InputSequencesHash, + Elements::InputUtxoHash, + Elements::InputUtxosHash, + Elements::InputHash, + Elements::InputsHash, + Elements::IssuanceAssetAmountsHash, + Elements::IssuanceBlindingEntropyHash, + Elements::IssuanceRangeProofsHash, + Elements::IssuanceTokenAmountsHash, + Elements::IssuanceHash, + Elements::IssuancesHash, + Elements::NonceHash, + Elements::OutpointHash, + Elements::OutputAmountsHash, + Elements::OutputNoncesHash, + Elements::OutputRangeProofsHash, + Elements::OutputScriptsHash, + Elements::OutputSurjectionProofsHash, + Elements::OutputHash, + Elements::OutputsHash, + Elements::SigAllHash, + Elements::TapEnvHash, + Elements::TapleafHash, + Elements::TappathHash, + Elements::TxHash, + Elements::CheckLockDistance, + Elements::CheckLockDuration, + Elements::CheckLockHeight, + Elements::CheckLockTime, + Elements::TxIsFinal, + Elements::TxLockDistance, + Elements::TxLockDuration, + Elements::TxLockHeight, + Elements::TxLockTime, + Elements::CalculateAsset, + Elements::CalculateConfidentialToken, + Elements::CalculateExplicitToken, + Elements::CalculateIssuanceEntropy, + Elements::Issuance, + Elements::IssuanceAsset, + Elements::IssuanceEntropy, + Elements::IssuanceToken, + Elements::LbtcAsset, + Elements::CurrentAmount, + Elements::CurrentAnnexHash, + Elements::CurrentAsset, + Elements::CurrentIndex, + Elements::CurrentIssuanceAssetAmount, + Elements::CurrentIssuanceAssetProof, + Elements::CurrentIssuanceTokenAmount, + Elements::CurrentIssuanceTokenProof, + Elements::CurrentNewIssuanceContract, + Elements::CurrentPegin, + Elements::CurrentPrevOutpoint, + Elements::CurrentReissuanceBlinding, + Elements::CurrentReissuanceEntropy, + Elements::CurrentScriptHash, + Elements::CurrentScriptSigHash, + Elements::CurrentSequence, + Elements::GenesisBlockHash, + Elements::InputAmount, + Elements::InputAnnexHash, + Elements::InputAsset, + Elements::InputPegin, + Elements::InputPrevOutpoint, + Elements::InputScriptHash, + Elements::InputScriptSigHash, + Elements::InputSequence, + Elements::InternalKey, + Elements::IssuanceAssetAmount, + Elements::IssuanceAssetProof, + Elements::IssuanceTokenAmount, + Elements::IssuanceTokenProof, + Elements::LockTime, + Elements::NewIssuanceContract, + Elements::NumInputs, + Elements::NumOutputs, + Elements::OutputAmount, + Elements::OutputAsset, + Elements::OutputIsFee, + Elements::OutputNonce, + Elements::OutputNullDatum, + Elements::OutputRangeProof, + Elements::OutputScriptHash, + Elements::OutputSurjectionProof, + Elements::ReissuanceBlinding, + Elements::ReissuanceEntropy, + Elements::ScriptCMR, + Elements::TapleafVersion, + Elements::Tappath, + Elements::TotalFee, + Elements::TransactionId, + Elements::Version, +]; diff --git a/docs_crate/lib.rs b/docs_crate/lib.rs new file mode 100644 index 0000000..36f4677 --- /dev/null +++ b/docs_crate/lib.rs @@ -0,0 +1 @@ +pub mod jet; diff --git a/docs_crate/main.rs b/docs_crate/main.rs new file mode 100644 index 0000000..dfa858d --- /dev/null +++ b/docs_crate/main.rs @@ -0,0 +1,63 @@ +use clap::Parser; +use serde::Serialize; +use simplicityhl_docs::jet::JetInfo; +use std::fs; +use std::path::PathBuf; + +#[derive(Parser, Debug)] +#[command(name = "simplicityhl-docs-bin")] +#[command(about = "Generates SimplicityHL documentationa for a jets as a JSON file", long_about = None)] +struct Cli { + output_path: PathBuf, +} + +#[derive(Serialize)] +struct Data { + pub elements: Vec, +} + +#[derive(Serialize)] +struct JetObject { + pub haskell_name: String, + pub simplicityhl_name: String, + pub section: String, + pub input_type: String, + pub output_type: String, + pub description: String, + #[serde(skip_serializing_if = "std::ops::Not::not")] + pub deprecated: bool, +} + +fn main() -> Result<(), Box> { + let cli = Cli::parse(); + + let generated_elements: Vec = simplicityhl_docs::jet::ALL_JETS_SORTED + .into_iter() + .map(|jet| JetObject { + haskell_name: format!("{:?}", jet), + simplicityhl_name: jet.to_string(), + section: jet.section_info(), + input_type: simplicityhl::jet::source_type(jet) + .iter() + .map(|ty| ty.to_string()) + .collect::>() + .join(", "), + output_type: simplicityhl::jet::target_type(jet).to_string(), + description: jet.description(), + deprecated: jet.is_deprecated(), + }) + .collect(); + + let json_string = serde_json::to_string_pretty(&Data { + elements: generated_elements, + })?; + + fs::write(&cli.output_path, json_string)?; + + println!( + "Successfully wrote JSON data to: {}", + cli.output_path.display() + ); + + Ok(()) +} diff --git a/jets.json b/jets.json index 2f4c2df..07e0ee0 100644 --- a/jets.json +++ b/jets.json @@ -1621,7 +1621,7 @@ "simplicityhl_name": "verify", "section": "Multi-bit logic", "input_type": "bool", - "output_type": "unit", + "output_type": "()", "description": "Assert that a bit is true.\n\n## Panics\nThe assertion fails." }, { @@ -2508,7 +2508,7 @@ "haskell_name": "Sha256Ctx8Add64", "simplicityhl_name": "sha_256_ctx_8_add_64", "section": "Hash functions", - "input_type": "Ctx8, array(u8, 64)", + "input_type": "Ctx8, [u8; 64]", "output_type": "Ctx8", "description": "Add 64 bytes to the SHA256 hash engine." }, @@ -2516,7 +2516,7 @@ "haskell_name": "Sha256Ctx8Add128", "simplicityhl_name": "sha_256_ctx_8_add_128", "section": "Hash functions", - "input_type": "Ctx8, array(u8, 128)", + "input_type": "Ctx8, [u8; 128]", "output_type": "Ctx8", "description": "Add 128 bytes to the SHA256 hash engine." }, @@ -2524,7 +2524,7 @@ "haskell_name": "Sha256Ctx8Add256", "simplicityhl_name": "sha_256_ctx_8_add_256", "section": "Hash functions", - "input_type": "Ctx8, array(u8, 256)", + "input_type": "Ctx8, [u8; 256]", "output_type": "Ctx8", "description": "Add 256 bytes to the SHA256 hash engine." }, @@ -2532,7 +2532,7 @@ "haskell_name": "Sha256Ctx8Add512", "simplicityhl_name": "sha_256_ctx_8_add_512", "section": "Hash functions", - "input_type": "Ctx8, array(u8, 512)", + "input_type": "Ctx8, [u8; 512]", "output_type": "Ctx8", "description": "Add 512 bytes to the SHA256 hash engine." }, @@ -2540,7 +2540,7 @@ "haskell_name": "Sha256Ctx8AddBuffer511", "simplicityhl_name": "sha_256_ctx_8_add_buffer_511", "section": "Hash functions", - "input_type": "Ctx8, [u8; 512]", + "input_type": "Ctx8, List", "output_type": "Ctx8", "description": "Add a list of less than 512 bytes to the SHA256 hash engine." }, @@ -2805,7 +2805,7 @@ "simplicityhl_name": "linear_verify_1", "section": "Elliptic curve functions", "input_type": "((Scalar, Ge), Scalar), Ge", - "output_type": "unit", + "output_type": "()", "description": "Assert that a point `b` is equal to the linear combination `a.0 * a.1 + a.2 * g`, where `g` is the generator point.\n\n## Panics\nThe assertion fails." }, { @@ -2813,7 +2813,7 @@ "simplicityhl_name": "point_verify_1", "section": "Elliptic curve functions", "input_type": "((Scalar, Point), Scalar), Point", - "output_type": "unit", + "output_type": "()", "description": "Assert that a point `b` is equal to the linear combination `a.0 * a.1 + a.2 * g`, where `g` is the generator point.\n\n## Panics\n- The assertion fails.\n- Fails if the points cannot be decompressed." }, { @@ -2909,7 +2909,7 @@ "simplicityhl_name": "bip_0340_verify", "section": "Digital Signatures", "input_type": "(Pubkey, Message), Signature", - "output_type": "unit", + "output_type": "()", "description": "Assert that a Schnorr signature matches a public key and message.\n\n## Panics\nThe assertion fails." }, { @@ -2917,7 +2917,7 @@ "simplicityhl_name": "check_sig_verify", "section": "Digital Signatures", "input_type": "(Pubkey, Message64), Signature", - "output_type": "unit", + "output_type": "()", "description": "Assert that a Schnorr signature matches a public key and message, using a custom sighash mode.\n\n## Panics\nThe assertion fails.\n\n## Safety\nThis jet should not be used directly." }, { @@ -2925,7 +2925,7 @@ "simplicityhl_name": "parse_lock", "section": "Bitcoin (without primitives)", "input_type": "u32", - "output_type": "Either", + "output_type": "Either", "description": "Parse an integer as a consensus-encoded Bitcoin lock time." }, { @@ -2933,7 +2933,7 @@ "simplicityhl_name": "parse_sequence", "section": "Bitcoin (without primitives)", "input_type": "u32", - "output_type": "Option>", + "output_type": "Option>", "description": "Parse an integer as a consensus-encoded Bitcoin sequence number." }, { @@ -3229,7 +3229,7 @@ "simplicityhl_name": "check_lock_distance", "section": "Time locks", "input_type": "Distance", - "output_type": "unit", + "output_type": "()", "description": "**Deprecated; do not use.** Assert that the value returned by `tx_lock_distance` is greater than or equal to the given value.\n\n## Panics\nThe assertion fails.", "deprecated": true }, @@ -3238,7 +3238,7 @@ "simplicityhl_name": "check_lock_duration", "section": "Time locks", "input_type": "Duration", - "output_type": "unit", + "output_type": "()", "description": "**Deprecated; do not use.** Assert that the value returned by `tx_lock_duration` is greater than or equal to the given value.\n\n## Panics\nThe assertion fails", "deprecated": true }, @@ -3247,7 +3247,7 @@ "simplicityhl_name": "check_lock_height", "section": "Time locks", "input_type": "Height", - "output_type": "unit", + "output_type": "()", "description": "Assert that the value returned by `tx_lock_height` is greater than or equal to the given value.\n\n## Panics\nThe assertion fails." }, { @@ -3255,7 +3255,7 @@ "simplicityhl_name": "check_lock_time", "section": "Time locks", "input_type": "Time", - "output_type": "unit", + "output_type": "()", "description": "Assert that the value returned by `tx_lock_time` is greater than or equal to the given value.\n\n## Panics\nThe assertion fails." }, { @@ -3681,7 +3681,7 @@ "simplicityhl_name": "output_null_datum", "section": "Transaction", "input_type": "u32, u32", - "output_type": "Option>>>", + "output_type": "Option>>>", "description": "Return the `b`-th entry of a null data (`OP_RETURN`) output at index `a`.\n\n- Return `Some(Some(Right(Right(x-1))))` if the entry is `OP_x` for `x` in the range 1..=16.\n- Return `Some(Some(Right(Left(0))))` if the entry is `OP_1NEGATE`.\n- Return `Some(Some(Right(Left(1))))` if the entry is `OP_RESERVED`.\n- Return `Some(Some(Left((x, hash))))` if the entry is pushed data. `hash` is the SHA256 hash of the data pushed and `x` indicates how the data was pushed:\n- `x == 0` means the push was an immediate 0 to 75 bytes.\n- `x == 1` means the push was an `OP_PUSHDATA1`.\n- `x == 2` means the push was an `OP_PUSHDATA2`.\n- `x == 3` means the push was an `OP_PUSHDATA4`.\n- Return `Some(None)` if the null data has fewer than `b` entries.\n- Return `None` if the output is not a null data output.\n\nUse this jet to read peg-out data from an output." }, {