From 232d69aa39ab58958269ded614b57c59e58bc4dc Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 28 Nov 2021 12:11:55 +0100 Subject: [PATCH 1/4] Start of work on v0.6 branch --- Cargo.lock | 24 ++++++++++-------------- Cargo.toml | 8 ++++---- bech32/Cargo.toml | 4 ++-- chain/Cargo.toml | 8 ++++---- elgamal/Cargo.toml | 2 +- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3cf20122..adb0e537 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -102,9 +102,8 @@ checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" [[package]] name = "bitcoin" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a41df6ad9642c5c15ae312dd3d074de38fd3eb7cc87ad4ce10f90292a83fe4d" +version = "0.28.0" +source = "git+https://github.com/LNP-BP/rust-bitcoin?branch=taproot/all#ffad87681934371f9ab6492953f7ccf30cbcda75" dependencies = [ "bech32", "bitcoin_hashes", @@ -246,8 +245,7 @@ checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" [[package]] name = "encoding_derive_helpers" version = "1.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8af9b20816ac9126945a6ecc1e248c4a1edfeada329839cdca9c96581174bebb" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" dependencies = [ "amplify", "proc-macro2", @@ -348,7 +346,7 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lnpbp" -version = "0.5.0" +version = "0.6.0" dependencies = [ "amplify", "base58", @@ -365,7 +363,7 @@ dependencies = [ [[package]] name = "lnpbp_bech32" -version = "0.5.0" +version = "0.6.0" dependencies = [ "amplify", "bech32", @@ -379,7 +377,7 @@ dependencies = [ [[package]] name = "lnpbp_chain" -version = "0.5.0" +version = "0.6.0" dependencies = [ "amplify", "bitcoin", @@ -392,7 +390,7 @@ dependencies = [ [[package]] name = "lnpbp_elgamal" -version = "0.5.0" +version = "0.6.0" dependencies = [ "amplify", "bitcoin_hashes", @@ -707,9 +705,8 @@ dependencies = [ [[package]] name = "strict_encoding" -version = "1.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "441080358b7382cf0b4766e4253a77e1ee7ad17139a4f0b950993074acfb63dc" +version = "1.8.0" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" dependencies = [ "amplify", "bitcoin", @@ -721,8 +718,7 @@ dependencies = [ [[package]] name = "strict_encoding_derive" version = "1.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf87ccd517175354f494683b69b7703664cf49e6b82e78ff53e42bea0c17401" +source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" dependencies = [ "amplify_syn", "encoding_derive_helpers", diff --git a/Cargo.toml b/Cargo.toml index 52db7cfa..c47a0bf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp" -version = "0.5.0" +version = "0.6.0" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNP/BP Core Library implementing LNPBP specifications & standards" @@ -24,9 +24,9 @@ required-features = ["cli"] [dependencies] amplify = { version = "3.9.1", features = ["stringly_conversions", "std"] } -lnpbp_bech32 = { version = "0.5.0", path = "bech32" } -lnpbp_chain = { version = "0.5.0", path = "chain" } -lnpbp_elgamal = { version = "0.5.0", path = "elgamal", optional = true } +lnpbp_bech32 = { version = "0.6.0", path = "bech32" } +lnpbp_chain = { version = "0.6.0", path = "chain" } +lnpbp_elgamal = { version = "0.6.0", path = "elgamal", optional = true } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } # serde_with_macros = { version = "~1.2.0", optional = true } # Fix for the problem in 1.3.0 diff --git a/bech32/Cargo.toml b/bech32/Cargo.toml index f0906384..10946d16 100644 --- a/bech32/Cargo.toml +++ b/bech32/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp_bech32" -version = "0.5.0" +version = "0.6.0" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNPBP-14 implementation" @@ -13,7 +13,7 @@ edition = "2018" [dependencies] amplify = "3.8.1" bitcoin_hashes = "0.10.0" -strict_encoding = "1.7.4" +strict_encoding = { version = "1.8.0", git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } bech32 = "0.8.1" deflate = { version = "0.8.6", optional = true } inflate = { version = "0.4.5", optional = true } diff --git a/chain/Cargo.toml b/chain/Cargo.toml index ab3f8084..9b273eee 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp_chain" -version = "0.5.0" +version = "0.6.0" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNPBP library defining chain parameters" @@ -12,9 +12,9 @@ edition = "2018" [dependencies] amplify = "3.9.1" -bitcoin = "0.27.1" -bitcoin_hashes = "0.10.0" -strict_encoding = "1.7.4" +bitcoin_hashes = "0.10.0" # We need macro from here +bitcoin = { version = "0.28", git = "https://github.com/LNP-BP/rust-bitcoin", branch = "taproot/all" } +strict_encoding = { version = "1.8.0", git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } lazy_static = "1.4.0" # TODO: #213 Remove dependency diff --git a/elgamal/Cargo.toml b/elgamal/Cargo.toml index b935573e..4908d55d 100644 --- a/elgamal/Cargo.toml +++ b/elgamal/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp_elgamal" -version = "0.5.0" +version = "0.6.0" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNPBP-31: " From 8daef3ff2d1ac33ae9e96ef95a3a7d4138788f0b Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 28 Nov 2021 12:47:56 +0100 Subject: [PATCH 2/4] Lightning encoding for AssetId --- Cargo.lock | 42 +++++++++++++++++++++++++++++++++++++++++- chain/Cargo.toml | 1 + chain/src/lib.rs | 4 ++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index adb0e537..ebeb4a6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,6 +253,18 @@ dependencies = [ "syn", ] +[[package]] +name = "encoding_derive_helpers" +version = "1.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df85c511a2f01954d1fad7d7d20eeae1af35157fbaec35261c91fab53d76bb58" +dependencies = [ + "amplify", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "fnv" version = "1.0.7" @@ -338,6 +350,33 @@ version = "0.2.108" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" +[[package]] +name = "lightning_encoding" +version = "0.6.0" +source = "git+https://github.com/LNP-BP/lnp-core?branch=v0.6#8d61df6f109428da1dd7cd7fc86d50659bcf89ce" +dependencies = [ + "amplify", + "bitcoin", + "bitcoin_hashes", + "chrono", + "lightning_encoding_derive", + "secp256k1", + "strict_encoding", +] + +[[package]] +name = "lightning_encoding_derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cc5449b552f69a6cf6f1c580c0444018f9b592edf0119cf66cc3fc3caf62744" +dependencies = [ + "amplify_syn", + "encoding_derive_helpers 1.7.5", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "linked-hash-map" version = "0.5.4" @@ -383,6 +422,7 @@ dependencies = [ "bitcoin", "bitcoin_hashes", "lazy_static", + "lightning_encoding", "serde", "serde_with", "strict_encoding", @@ -721,7 +761,7 @@ version = "1.7.4" source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" dependencies = [ "amplify_syn", - "encoding_derive_helpers", + "encoding_derive_helpers 1.7.4", "proc-macro2", "syn", ] diff --git a/chain/Cargo.toml b/chain/Cargo.toml index 9b273eee..0060c6f2 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -15,6 +15,7 @@ amplify = "3.9.1" bitcoin_hashes = "0.10.0" # We need macro from here bitcoin = { version = "0.28", git = "https://github.com/LNP-BP/rust-bitcoin", branch = "taproot/all" } strict_encoding = { version = "1.8.0", git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } +lightning_encoding = { version = "0.6.0", git = "https://github.com/LNP-BP/lnp-core", branch = "v0.6" } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } lazy_static = "1.4.0" # TODO: #213 Remove dependency diff --git a/chain/src/lib.rs b/chain/src/lib.rs index 40ebc49d..19c380cc 100644 --- a/chain/src/lib.rs +++ b/chain/src/lib.rs @@ -212,6 +212,10 @@ impl strict_encoding::Strategy for AssetId { type Strategy = strict_encoding::strategies::HashFixedBytes; } +impl lightning_encoding::Strategy for AssetId { + type Strategy = lightning_encoding::strategies::AsBitcoinHash; +} + impl From for AssetId { fn from(block_hash: BlockHash) -> Self { AssetId::from_inner(block_hash.into_inner()) From 1eaab4a51a63b021c6179266b7b5ef1f1ceac2b4 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Mar 2022 16:06:47 +0100 Subject: [PATCH 3/4] Update to released version of bitcoin 0.28.0-rc.1 --- Cargo.lock | 361 ++++++++++++++++++++++++++++----------------- Cargo.toml | 12 +- bech32/Cargo.toml | 9 +- chain/Cargo.toml | 14 +- elgamal/Cargo.toml | 6 +- elgamal/src/lib.rs | 14 +- 6 files changed, 251 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0723eef1..dda7cd2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "amplify" -version = "3.9.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8e62f231427205466fa4a9be272c5524e0781d724917f370d0ffeca95d1a9b2" +checksum = "47cfa6a69eeb140125a63e4f5ae1156a530f8744ea1d35aa1b8b5613e4d8b41d" dependencies = [ "amplify_derive", "amplify_num", @@ -26,9 +26,9 @@ dependencies = [ [[package]] name = "amplify_derive" -version = "2.9.0" +version = "2.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "403008693dd8333254c9cf0f977890f23c4ceaa9975721cc52b79551a72ff7f2" +checksum = "bcd9d6315c0fb32fb125a50992f64bca686a7012e8b897316cb8e30b0294315c" dependencies = [ "amplify_syn", "proc-macro2", @@ -38,9 +38,9 @@ dependencies = [ [[package]] name = "amplify_num" -version = "0.2.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2f04ef9ef18297ed29418a8c5a93569ae07934234a423fd77b68a9dbd1e491" +checksum = "8d987f94e7127a80238f8f467b756d248bb72345dff59673ffe3fa213b15e503" dependencies = [ "serde", ] @@ -69,21 +69,24 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base58" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" [[package]] name = "base64-compat" @@ -102,12 +105,14 @@ checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" [[package]] name = "bitcoin" -version = "0.28.0" -source = "git+https://github.com/LNP-BP/rust-bitcoin?branch=taproot/all#ffad87681934371f9ab6492953f7ccf30cbcda75" +version = "0.28.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d21919f8ef56dced9c7a35d28dea7c344566e32a19533f9070d150ec33512152" dependencies = [ + "base64-compat", "bech32", "bitcoin_hashes", - "secp256k1", + "secp256k1 0.21.3", "serde", ] @@ -120,6 +125,43 @@ dependencies = [ "serde", ] +[[package]] +name = "bitcoin_hd" +version = "0.6.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8a06126ea95a3dcb4e628b01c1e100d5303dd64411f3f8e1421d29cf5b6bc9" +dependencies = [ + "amplify", + "bitcoin", + "slip132", + "strict_encoding", +] + +[[package]] +name = "bitcoin_onchain" +version = "0.6.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3399dfbf4f840a615729072839b8b4b360d91761e76a70e77908bf2bbb04007" +dependencies = [ + "amplify", + "bitcoin", + "bitcoin_hd", + "chrono", + "descriptors", + "strict_encoding", +] + +[[package]] +name = "bitcoin_scripts" +version = "0.6.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "611c3bdc89c65d8aa45ac36f6d92edfebe44af38d6186586cee4b8d54e394c41" +dependencies = [ + "amplify", + "bitcoin", + "strict_encoding", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -134,9 +176,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "chrono" @@ -153,9 +195,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.0.0-beta.5" +version = "3.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feff3878564edb93745d58cf63e17b63f24142506e7a20c87a5521ed7bfb1d63" +checksum = "d8c93436c21e4698bacadf42917db28b23017027a4deccb35dbe47a7e7840123" dependencies = [ "atty", "bitflags", @@ -166,14 +208,13 @@ dependencies = [ "strsim", "termcolor", "textwrap", - "unicase", ] [[package]] name = "clap_derive" -version = "3.0.0-beta.5" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b15c6b4f786ffb6192ffe65a36855bc1fc2444bcd0945ae16748dcd6ed7d0d3" +checksum = "da95d038ede1a964ce99f49cbe27a7fb538d1da595e4b4f70b8c8f338d17bf16" dependencies = [ "heck", "proc-macro-error", @@ -191,11 +232,22 @@ dependencies = [ "bitflags", ] +[[package]] +name = "commit_verify" +version = "0.6.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83d2d2463805ad24755758763ffd06f0468bd0e54ac2a9c8714da59272c3a21e" +dependencies = [ + "amplify", + "bitcoin_hashes", + "strict_encoding", +] + [[package]] name = "darling" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757c0ded2af11d8e739c4daea1ac623dd1624b06c844cf3f5a39f1bdbd99bb12" +checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" dependencies = [ "darling_core", "darling_macro", @@ -203,9 +255,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c34d8efb62d0c2d7f60ece80f75e5c63c1588ba68032740494b0b9a996466e3" +checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" dependencies = [ "fnv", "ident_case", @@ -217,9 +269,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade7bff147130fe5e6d39f089c6bd49ec0250f35d70b2eebf72afdfc919f15cc" +checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" dependencies = [ "darling_core", "quote", @@ -228,36 +280,49 @@ dependencies = [ [[package]] name = "deflate" -version = "0.8.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" +checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" dependencies = [ "adler32", - "byteorder", ] [[package]] -name = "dtoa" -version = "0.4.8" +name = "descriptor-wallet" +version = "0.6.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" +checksum = "c576b410738c7a0f26c4ca3a418165d2f7afc8f3e99b52c833decacade2faaf8" +dependencies = [ + "amplify", + "bitcoin", + "bitcoin_hd", + "bitcoin_onchain", + "bitcoin_scripts", + "chrono", + "commit_verify", + "psbt", + "slip132", + "strict_encoding", +] [[package]] -name = "encoding_derive_helpers" -version = "1.7.4" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" +name = "descriptors" +version = "0.6.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca1f244317b0686f1a39ffa6ec9a037c7a7db9f5019a48a8bedfe819c181b6d" dependencies = [ "amplify", - "proc-macro2", - "quote", - "syn", + "bitcoin", + "bitcoin_hd", + "bitcoin_scripts", + "strict_encoding", ] [[package]] name = "encoding_derive_helpers" -version = "1.7.5" +version = "1.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df85c511a2f01954d1fad7d7d20eeae1af35157fbaec35261c91fab53d76bb58" +checksum = "dc4ba8a88067b85c8714922db6e5f2af47b894d63b771dbb0c4d31d6607e9057" dependencies = [ "amplify", "proc-macro2", @@ -285,12 +350,9 @@ checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -315,11 +377,11 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "hashbrown", ] @@ -334,9 +396,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "lazy_static" @@ -346,32 +408,32 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.108" +version = "0.2.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8521a1b57e76b1ec69af7599e75e38e7b7fad6610f037db8c79b127201b5d119" +checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4" [[package]] name = "lightning_encoding" -version = "0.6.0" -source = "git+https://github.com/LNP-BP/lnp-core?branch=v0.6#8d61df6f109428da1dd7cd7fc86d50659bcf89ce" +version = "0.6.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1ad88b8af7845a6b763b241645e85c33dadb00744f3d2b1be35cdd966c34ab" dependencies = [ "amplify", "bitcoin", - "bitcoin_hashes", "chrono", + "descriptor-wallet", "lightning_encoding_derive", - "secp256k1", "strict_encoding", ] [[package]] name = "lightning_encoding_derive" -version = "0.5.0" +version = "0.6.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc5449b552f69a6cf6f1c580c0444018f9b592edf0119cf66cc3fc3caf62744" +checksum = "6fdd632c0382e56c1c3474a4b70aaf7a6a2f46c408a9b4c6edc9ae7fcce77290" dependencies = [ "amplify_syn", - "encoding_derive_helpers 1.7.5", + "encoding_derive_helpers", "proc-macro2", "quote", "syn", @@ -385,7 +447,7 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lnpbp" -version = "0.6.0" +version = "0.6.0-rc.1" dependencies = [ "amplify", "base58", @@ -402,7 +464,7 @@ dependencies = [ [[package]] name = "lnpbp_bech32" -version = "0.6.0" +version = "0.6.0-rc.1" dependencies = [ "amplify", "bech32", @@ -416,13 +478,13 @@ dependencies = [ [[package]] name = "lnpbp_chain" -version = "0.6.0" +version = "0.6.0-rc.1" dependencies = [ "amplify", "bitcoin", "bitcoin_hashes", - "lazy_static", "lightning_encoding", + "once_cell", "serde", "serde_with", "strict_encoding", @@ -435,7 +497,7 @@ version = "0.6.0" dependencies = [ "amplify", "bitcoin_hashes", - "secp256k1", + "secp256k1 0.22.1", ] [[package]] @@ -450,7 +512,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-traits", ] @@ -460,20 +522,20 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", ] [[package]] name = "once_cell" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" [[package]] name = "os_str_bytes" -version = "4.2.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addaa943333a514159c80c97ff4a93306530d965d27e139188283cd13e06a799" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" dependencies = [ "memchr", ] @@ -510,18 +572,32 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] +[[package]] +name = "psbt" +version = "0.6.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5e8512fb13063ec744e587d56cc4a7a4d760f1e025b3c8f4a5dec967d21cac" +dependencies = [ + "amplify", + "bitcoin", + "bitcoin_hd", + "bitcoin_onchain", + "bitcoin_scripts", + "descriptors", +] + [[package]] name = "quote" -version = "1.0.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -532,7 +608,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "libc", "rand_chacha", "rand_core 0.4.2", @@ -551,7 +627,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.3.1", ] @@ -619,7 +695,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.4.2", ] @@ -643,50 +719,68 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "secp256k1" -version = "0.20.3" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d03ceae636d0fed5bae6a7f4f664354c5f4fcedf6eef053fef17e49f837d0a" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" dependencies = [ - "rand", - "secp256k1-sys", + "secp256k1-sys 0.4.2", "serde", ] +[[package]] +name = "secp256k1" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +dependencies = [ + "rand", + "secp256k1-sys 0.5.0", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", +] + [[package]] name = "secp256k1-sys" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827cb7cce42533829c792fc51b82fbf18b125b45a702ef2c8be77fce65463a7b" +checksum = "07b5b9d7322572e1f3aeed208668ce87789b3645dbb73082c5ce99a004103a35" dependencies = [ "cc", ] [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -695,9 +789,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.72" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -716,9 +810,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6056b4cb69b6e43e3a0f055def223380baecc99da683884f205bf347f7c4b3" +checksum = "ec1e6ec4d8950e5b1e894eac0d360742f3b1407a6078a604a731c4b3f49cefbc" dependencies = [ "hex", "rustversion", @@ -740,20 +834,32 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af" +checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0" dependencies = [ - "dtoa", "indexmap", + "ryu", "serde", "yaml-rust", ] +[[package]] +name = "slip132" +version = "0.6.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0035bf63d816cf2e3f3e6fe789f1745cb52a9440bf9007dc1d58eb2db4bf2eec" +dependencies = [ + "amplify", + "bitcoin", + "strict_encoding", +] + [[package]] name = "strict_encoding" -version = "1.8.0" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" +version = "1.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5a18273d2d1d8d8711e24d3aaabb8ba5b5686d237fca819bb8b482206a22aca" dependencies = [ "amplify", "bitcoin", @@ -764,20 +870,21 @@ dependencies = [ [[package]] name = "strict_encoding_derive" -version = "1.7.4" -source = "git+https://github.com/LNP-BP/client_side_validation?branch=develop#6dc838ae4074878d270d73d719eb251221c81e24" +version = "1.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bc7b868cb00c8861784b7f463c984c4b2ad20d1f23cec5997ad9cb41e559239" dependencies = [ "amplify_syn", - "encoding_derive_helpers 1.7.4", + "encoding_derive_helpers", "proc-macro2", "syn", ] [[package]] name = "strict_encoding_test" -version = "1.7.6" +version = "1.8.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bd0bdf8da419af27970c9e16e99e23ec67b5c8b6896db950c93a6ba1827b2a" +checksum = "adb7d92f76d65f2c156a35cc0c3f85c9917fe61254ff2b740a0ca75069ef1fad" dependencies = [ "amplify", "strict_encoding", @@ -801,9 +908,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8daf5dd0bb60cbd4137b1b587d2fc0ae729bc07cf01cd70b36a1ed5ade3b9d59" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -812,21 +919,18 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] [[package]] name = "textwrap" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" -dependencies = [ - "unicode-width", -] +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "time" @@ -848,27 +952,6 @@ dependencies = [ "serde", ] -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-segmentation" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - [[package]] name = "unicode-xid" version = "0.2.2" @@ -877,9 +960,9 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" diff --git a/Cargo.toml b/Cargo.toml index c47a0bf0..e7b8a875 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp" -version = "0.6.0" +version = "0.6.0-rc.1" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNP/BP Core Library implementing LNPBP specifications & standards" @@ -23,18 +23,18 @@ path = "src/bin/lnpbp.rs" required-features = ["cli"] [dependencies] -amplify = { version = "3.9.1", features = ["stringly_conversions", "std"] } -lnpbp_bech32 = { version = "0.6.0", path = "bech32" } -lnpbp_chain = { version = "0.6.0", path = "chain" } +amplify = { version = "3.12.0", features = ["stringly_conversions", "std"] } +lnpbp_bech32 = { version = "0.6.0-rc.1", path = "bech32" } +lnpbp_chain = { version = "0.6.0-rc.1", path = "chain" } lnpbp_elgamal = { version = "0.6.0", path = "elgamal", optional = true } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } # serde_with_macros = { version = "~1.2.0", optional = true } # Fix for the problem in 1.3.0 -clap = { version = "3.0.0-beta.5", optional = true } +clap = { version = "3.1.6", features = ["derive"], optional = true } serde_yaml = { version = "0.8", optional = true } serde_json = { version = "1", optional = true } base64-compat = { version = "1", optional = true } # Used by cli only -base58 = { version = "0.1", optional = true } # Used by cli only +base58 = { version = "0.2", optional = true } # Used by cli only [features] default = ["zip"] diff --git a/bech32/Cargo.toml b/bech32/Cargo.toml index 10946d16..4d9985f5 100644 --- a/bech32/Cargo.toml +++ b/bech32/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp_bech32" -version = "0.6.0" +version = "0.6.0-rc.1" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNPBP-14 implementation" @@ -11,15 +11,14 @@ categories = ["cryptography::cryptocurrencies"] edition = "2018" [dependencies] -amplify = "3.8.1" +amplify = "3.12.0" bitcoin_hashes = "0.10.0" -strict_encoding = { version = "1.8.0", git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } +strict_encoding = "1.8.0-rc.1" bech32 = "0.8.1" -deflate = { version = "0.8.6", optional = true } +deflate = { version = "1.0.0", optional = true } inflate = { version = "0.4.5", optional = true } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } -# serde_with_macros = { version = "1.2.0", optional = true } # Fix for the problem in 1.3.0 [features] default = [] diff --git a/chain/Cargo.toml b/chain/Cargo.toml index b94ce002..13280636 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lnpbp_chain" -version = "0.6.0" +version = "0.6.0-rc.1" license = "MIT" authors = ["Dr. Maxim Orlovsky "] description = "LNPBP library defining chain parameters" @@ -11,13 +11,17 @@ categories = ["cryptography::cryptocurrencies"] edition = "2018" [dependencies] -amplify = "3.9.1" +amplify = "3.12.0" bitcoin_hashes = "0.10.0" # We need macro from here -bitcoin = { version = "0.28", git = "https://github.com/LNP-BP/rust-bitcoin", branch = "taproot/all" } -strict_encoding = { version = "1.8.0", git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } -lightning_encoding = { version = "0.6.0", git = "https://github.com/LNP-BP/lnp-core", branch = "v0.6" } +bitcoin = "0.28.0-rc.1" +strict_encoding = "1.8.0-rc.1" +lightning_encoding = { version = "0.6.0-rc.1" } serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true } serde_with = { version = "1.8", features = ["hex"], optional = true } +once_cell = "1.10.0" + +[dev-dependencies] +strict_encoding_test = "1.8.0-rc.1" [features] serde = ["serde_crate", "serde_with", "bitcoin_hashes/serde", "bitcoin/use-serde"] diff --git a/elgamal/Cargo.toml b/elgamal/Cargo.toml index 4908d55d..663578b0 100644 --- a/elgamal/Cargo.toml +++ b/elgamal/Cargo.toml @@ -11,9 +11,9 @@ categories = ["cryptography"] edition = "2018" [dependencies] -amplify = "3.9.1" -secp256k1 = "0.20.3" +amplify = "3.12.0" +secp256k1 = "0.22.1" bitcoin_hashes = "0.10.0" [dev-dependencies] -secp256k1 = { version = "0.20.3", features = ["rand-std", "global-context-less-secure"] } +secp256k1 = { version = "0.22.1", features = ["rand-std", "global-context"] } diff --git a/elgamal/src/lib.rs b/elgamal/src/lib.rs index 671f3a92..8f1cde15 100644 --- a/elgamal/src/lib.rs +++ b/elgamal/src/lib.rs @@ -133,7 +133,7 @@ pub fn encrypt( } // Destroy blinding factor - *blinding_key = secp256k1::key::ONE_KEY; + *blinding_key = secp256k1::ONE_KEY; Ok(acc.concat()) } @@ -184,7 +184,7 @@ pub fn decrypt( } // Destroy decryption key - *decryption_key = secp256k1::key::ONE_KEY; + *decryption_key = secp256k1::ONE_KEY; Ok(acc.concat()) } @@ -221,7 +221,7 @@ mod test { let encryption_key = secp256k1::PublicKey::from_secret_key(&SECP256K1, &decryption_key); // Checking that we have a random key - assert_ne!(decryption_key[..], secp256k1::key::ONE_KEY[..]); + assert_ne!(decryption_key[..], secp256k1::ONE_KEY[..]); thread_rng().fill_bytes(&mut entropy); let mut blinding_key = @@ -230,7 +230,7 @@ mod test { let unblinding_key = secp256k1::PublicKey::from_secret_key(&SECP256K1, &blinding_key); // Checking that we have a random key - assert_ne!(blinding_key[..], secp256k1::key::ONE_KEY[..]); + assert_ne!(blinding_key[..], secp256k1::ONE_KEY[..]); assert_ne!(blinding_key[..], decryption_key[..]); let mut uk = unblinding_key.clone(); @@ -247,7 +247,7 @@ mod test { // Checking that we have wiped out our blinding key assert_ne!(source[..], encrypted[..len]); } - assert_eq!(blinding_key[..], secp256k1::key::ONE_KEY[..]); + assert_eq!(blinding_key[..], secp256k1::ONE_KEY[..]); let no_chunks = if len == 0 { 1 } else { (len - 1) / 30 + 1 }; assert_eq!(encrypted.len(), no_chunks * 32); @@ -260,7 +260,7 @@ mod test { .unwrap(); let result = &decrypted[..]; // Checking that we have wiped out our decryption key - assert_eq!(decryption_key[..], secp256k1::key::ONE_KEY[..]); + assert_eq!(decryption_key[..], secp256k1::ONE_KEY[..]); assert_eq!(decrypted.len(), no_chunks * 30); assert_eq!(result[..len], source[..]); @@ -347,7 +347,7 @@ mod test { let encryption_key = secp256k1::PublicKey::from_secret_key(&SECP256K1, &decryption_key); - let mut blinding_key = secp256k1::key::ONE_KEY; + let mut blinding_key = secp256k1::ONE_KEY; encrypt( &SECP256K1, &decryption_key[1..], From 13ac964228ee44a0b18dd8a4241c2c352a41a8c6 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 13 Mar 2022 16:21:20 +0100 Subject: [PATCH 4/4] Fix MSRC build --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dda7cd2a..9cc56879 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -846,9 +846,9 @@ dependencies = [ [[package]] name = "slip132" -version = "0.6.0-beta.1" +version = "0.6.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0035bf63d816cf2e3f3e6fe789f1745cb52a9440bf9007dc1d58eb2db4bf2eec" +checksum = "4a867e6dc1840ef682d9f44f74383d8b636b25f0b5fce04f4d3fbcc4024a86bd" dependencies = [ "amplify", "bitcoin",