mirror of
https://github.com/RoboSats/taptrade-core.git
synced 2025-07-21 10:13:23 +00:00
completed combine_and_broadcast fn
This commit is contained in:
196
taptrade-cli-demo/coordinator/Cargo.lock
generated
196
taptrade-cli-demo/coordinator/Cargo.lock
generated
@ -156,7 +156,7 @@ version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f"
|
||||
dependencies = [
|
||||
"bitcoin-internals",
|
||||
"bitcoin-internals 0.3.0",
|
||||
"bitcoin_hashes 0.14.0",
|
||||
]
|
||||
|
||||
@ -195,6 +195,7 @@ dependencies = [
|
||||
"bitcoin 0.30.2",
|
||||
"bitcoinconsensus",
|
||||
"electrum-client",
|
||||
"esplora-client",
|
||||
"getrandom",
|
||||
"js-sys",
|
||||
"log",
|
||||
@ -252,7 +253,7 @@ checksum = "ea507acc1cd80fc084ace38544bbcf7ced7c2aa65b653b102de0ce718df668f6"
|
||||
dependencies = [
|
||||
"base58ck",
|
||||
"bech32 0.11.0",
|
||||
"bitcoin-internals",
|
||||
"bitcoin-internals 0.3.0",
|
||||
"bitcoin-io",
|
||||
"bitcoin-units",
|
||||
"bitcoin_hashes 0.14.0",
|
||||
@ -261,6 +262,12 @@ dependencies = [
|
||||
"secp256k1 0.29.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin-internals"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1f9997f8650dd818369931b5672a18dbef95324d0513aa99aae758de8ce86e5b"
|
||||
|
||||
[[package]]
|
||||
name = "bitcoin-internals"
|
||||
version = "0.3.0"
|
||||
@ -285,7 +292,7 @@ version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2"
|
||||
dependencies = [
|
||||
"bitcoin-internals",
|
||||
"bitcoin-internals 0.3.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -362,9 +369,9 @@ checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.100"
|
||||
version = "1.0.104"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c891175c3fb232128f48de6590095e59198bbeb8620c310be349bfc3afd12c7b"
|
||||
checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
@ -518,9 +525,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.12.0"
|
||||
version = "1.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b"
|
||||
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
@ -540,7 +547,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"webpki",
|
||||
"webpki-roots",
|
||||
"webpki-roots 0.22.6",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
@ -569,6 +576,19 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "esplora-client"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0cb1f7f2489cce83bc3bd92784f9ba5271eeb6e729b975895fc541f78cbfcdca"
|
||||
dependencies = [
|
||||
"bitcoin 0.30.2",
|
||||
"bitcoin-internals 0.1.0",
|
||||
"log",
|
||||
"serde",
|
||||
"ureq",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "etcetera"
|
||||
version = "0.8.0"
|
||||
@ -592,6 +612,16 @@ version = "2.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "flume"
|
||||
version = "0.11.0"
|
||||
@ -912,9 +942,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "1.3.1"
|
||||
version = "1.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d"
|
||||
checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
@ -966,9 +996,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hyper-util"
|
||||
version = "0.1.5"
|
||||
version = "0.1.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56"
|
||||
checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
@ -1084,9 +1114,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "log"
|
||||
version = "0.4.21"
|
||||
version = "0.4.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
|
||||
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
|
||||
|
||||
[[package]]
|
||||
name = "matchit"
|
||||
@ -1249,9 +1279,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "object"
|
||||
version = "0.36.0"
|
||||
version = "0.36.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434"
|
||||
checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
@ -1351,7 +1381,7 @@ dependencies = [
|
||||
"libc",
|
||||
"redox_syscall 0.5.2",
|
||||
"smallvec",
|
||||
"windows-targets 0.52.5",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -1625,6 +1655,20 @@ dependencies = [
|
||||
"sct",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki 0.102.5",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.10"
|
||||
@ -1633,7 +1677,7 @@ checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki 0.102.4",
|
||||
"rustls-webpki 0.102.5",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
@ -1666,9 +1710,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.102.4"
|
||||
version = "0.102.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e"
|
||||
checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
@ -1797,9 +1841,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.118"
|
||||
version = "1.0.120"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
|
||||
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
@ -1910,6 +1954,17 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "socks"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "spin"
|
||||
version = "0.9.8"
|
||||
@ -2238,9 +2293,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.6.0"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
|
||||
checksum = "ce6b6a2fb3a985e99cebfaefa9faa3024743da73304ca1c683a36429613d3d22"
|
||||
dependencies = [
|
||||
"tinyvec_macros",
|
||||
]
|
||||
@ -2412,9 +2467,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-normalization"
|
||||
version = "0.1.22"
|
||||
version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
|
||||
checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
|
||||
dependencies = [
|
||||
"tinyvec",
|
||||
]
|
||||
@ -2443,6 +2498,26 @@ version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"
|
||||
|
||||
[[package]]
|
||||
name = "ureq"
|
||||
version = "2.9.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd"
|
||||
dependencies = [
|
||||
"base64 0.22.1",
|
||||
"flate2",
|
||||
"log",
|
||||
"once_cell",
|
||||
"rustls 0.22.4",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki 0.102.5",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"socks",
|
||||
"url",
|
||||
"webpki-roots 0.26.3",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "url"
|
||||
version = "2.5.2"
|
||||
@ -2588,6 +2663,15 @@ dependencies = [
|
||||
"webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.26.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "whoami"
|
||||
version = "1.5.1"
|
||||
@ -2635,7 +2719,7 @@ version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||
dependencies = [
|
||||
"windows-targets 0.52.5",
|
||||
"windows-targets 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2655,18 +2739,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "windows-targets"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
|
||||
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm 0.52.5",
|
||||
"windows_aarch64_msvc 0.52.5",
|
||||
"windows_i686_gnu 0.52.5",
|
||||
"windows_aarch64_gnullvm 0.52.6",
|
||||
"windows_aarch64_msvc 0.52.6",
|
||||
"windows_i686_gnu 0.52.6",
|
||||
"windows_i686_gnullvm",
|
||||
"windows_i686_msvc 0.52.5",
|
||||
"windows_x86_64_gnu 0.52.5",
|
||||
"windows_x86_64_gnullvm 0.52.5",
|
||||
"windows_x86_64_msvc 0.52.5",
|
||||
"windows_i686_msvc 0.52.6",
|
||||
"windows_x86_64_gnu 0.52.6",
|
||||
"windows_x86_64_gnullvm 0.52.6",
|
||||
"windows_x86_64_msvc 0.52.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -2677,9 +2761,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_gnullvm"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
|
||||
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
@ -2689,9 +2773,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_aarch64_msvc"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
|
||||
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
@ -2701,15 +2785,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnu"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
|
||||
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_gnullvm"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
|
||||
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
@ -2719,9 +2803,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
||||
|
||||
[[package]]
|
||||
name = "windows_i686_msvc"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
|
||||
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
@ -2731,9 +2815,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnu"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
|
||||
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
@ -2743,9 +2827,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_gnullvm"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
|
||||
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
@ -2755,9 +2839,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
||||
|
||||
[[package]]
|
||||
name = "windows_x86_64_msvc"
|
||||
version = "0.52.5"
|
||||
version = "0.52.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
|
||||
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
||||
|
||||
[[package]]
|
||||
name = "winreg"
|
||||
@ -2771,18 +2855,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy"
|
||||
version = "0.7.34"
|
||||
version = "0.7.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087"
|
||||
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
|
||||
dependencies = [
|
||||
"zerocopy-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerocopy-derive"
|
||||
version = "0.7.34"
|
||||
version = "0.7.35"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b"
|
||||
checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -8,9 +8,8 @@ anyhow = "1.0.86"
|
||||
bitcoin = "0.32.2"
|
||||
miniscript = "12.0.0"
|
||||
axum = { version = "0.7.5", features = ["tokio", "json"] }
|
||||
|
||||
# "use-esplora-async", "async-interface", for async esplora
|
||||
bdk = { version = "0.29.0", default-features = false, features = ["key-value-db", "bitcoinconsensus", "std", "electrum", "verify"] }
|
||||
bdk = { version = "0.29.0", default-features = false, features = ["key-value-db", "bitcoinconsensus", "std", "electrum","use-esplora-ureq","compiler", "verify"] }
|
||||
# bitcoinconsensus = "0.106.0"
|
||||
|
||||
dotenv = "0.15.0"
|
||||
|
@ -1,122 +1,131 @@
|
||||
use bitcoin::blockdata::transaction::{Transaction, TxIn, TxOut};
|
||||
use bitcoin::blockdata::script::Builder;
|
||||
use bitcoin::consensus::encode;
|
||||
use miniscript::{Miniscript, Descriptor, DescriptorPublicKey, policy::Concrete};
|
||||
use miniscript::bitcoin::secp256k1::{Secp256k1, SecretKey, PublicKey, Message, Signature};
|
||||
// use miniscript::bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey};
|
||||
use bitcoin::Address;
|
||||
use bdk::miniscript::psbt::PsbtExt;
|
||||
use bitcoin::Network;
|
||||
use bitcoin::taproot::TaprootSpendInfo;
|
||||
use miniscript::{Miniscript, Descriptor, DescriptorPublicKey};
|
||||
use bdk::bitcoin::psbt::PartiallySignedTransaction;
|
||||
use bdk::blockchain::EsploraBlockchain;
|
||||
use std::str::FromStr;
|
||||
use bitcoin::psbt::PartiallySignedTransaction;
|
||||
use bitcoin::util::taproot::{TaprootBuilder, TaprootSpendInfo};
|
||||
use bitcoin::util::schnorr::SchnorrSig;
|
||||
use bitcoin::secp256k1::{Secp256k1, SecretKey};
|
||||
use bitcoin::Transaction;
|
||||
use bdk::bitcoin::secp256k1::Secp256k1;
|
||||
|
||||
fn combine_and_broadcast() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let mut base_psbt = PartiallySignedTransaction::from_str("TODO: insert the psbt created in step 3 here")?;
|
||||
let signed_psbts = vec![
|
||||
// TODO: Paste each participant's PSBT here
|
||||
"makers_psbt",
|
||||
"takers_psbt",
|
||||
];
|
||||
|
||||
for psbt in signed_psbts {
|
||||
let psbt = PartiallySignedTransaction::from_str(psbt)?;
|
||||
base_psbt.combine(psbt)?;
|
||||
}
|
||||
|
||||
fn create_taproot_psbt(inputs: Vec<UTXO>, outputs: Vec<Output>) -> PartiallySignedTransaction {
|
||||
let secp = Secp256k1::new();
|
||||
let mut psbt = PartiallySignedTransaction::new();
|
||||
let psbt = base_psbt.finalize(&secp).unwrap();
|
||||
let finalized_tx = psbt.extract_tx();
|
||||
dbg!(finalized_tx.txid());
|
||||
|
||||
// Add inputs
|
||||
for input in inputs {
|
||||
psbt.inputs.push(input.to_psbt_input());
|
||||
}
|
||||
|
||||
// Add outputs
|
||||
for output in outputs {
|
||||
psbt.outputs.push(output.to_psbt_output());
|
||||
}
|
||||
|
||||
// Add Taproot data
|
||||
// call create_script here, and add descriptor here
|
||||
let taproot_info = TaprootSpendInfo::new(secp, root);
|
||||
psbt.global.taproot_spend_info = Some(taproot_info);
|
||||
|
||||
psbt
|
||||
let blockchain = EsploraBlockchain::new("https://blockstream.info/testnet/api", 20);
|
||||
dbg!(blockchain.broadcast(&finalized_tx));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl UTXO {
|
||||
fn to_psbt_input(&self) -> PsbtInput {
|
||||
PsbtInput {
|
||||
witness_utxo: Some(self.clone()),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
impl Output {
|
||||
fn to_psbt_output(&self) -> PsbtOutput {
|
||||
PsbtOutput {
|
||||
value: self.amount,
|
||||
script: self.taproot_script.clone(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
// fn create_taproot_psbt(inputs: Vec<UTXO>, outputs: Vec<Output>) -> PartiallySignedTransaction {
|
||||
// let secp = Secp256k1::new();
|
||||
// let mut psbt = PartiallySignedTransaction::new();
|
||||
|
||||
fn sign_psbt(psbt: &mut PartiallySignedTransaction, privkey: SecretKey) {
|
||||
let secp = Secp256k1::new();
|
||||
// // Add inputs
|
||||
// for input in inputs {
|
||||
// psbt.inputs.push(input.to_psbt_input());
|
||||
// }
|
||||
|
||||
for (index, input) in psbt.inputs.iter_mut().enumerate() {
|
||||
let sighash = psbt.sighash(index, secp);
|
||||
let signature = SchnorrSig::sign(sighash, &privkey, secp);
|
||||
input.taproot_key_sig = Some(signature);
|
||||
}
|
||||
}
|
||||
// // Add outputs
|
||||
// for output in outputs {
|
||||
// psbt.outputs.push(output.to_psbt_output());
|
||||
// }
|
||||
|
||||
// // Add Taproot data
|
||||
// // call create_script here, and add descriptor here
|
||||
// let taproot_info = TaprootSpendInfo::new(secp, root);
|
||||
// psbt.global.taproot_spend_info = Some(taproot_info);
|
||||
|
||||
// psbt
|
||||
// }
|
||||
// struct UTXO {
|
||||
|
||||
// }
|
||||
// impl UTXO {
|
||||
// fn to_psbt_input(&self) -> PsbtInput {
|
||||
// PsbtInput {
|
||||
// witness_utxo: Some(self.clone()),
|
||||
// ..Default::default()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// struct Output{
|
||||
|
||||
// }
|
||||
// impl Output {
|
||||
// fn to_psbt_output(&self) -> PsbtOutput {
|
||||
// PsbtOutput {
|
||||
// value: self.amount,
|
||||
// script: self.taproot_script.clone(),
|
||||
// ..Default::default()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// fn sign_psbt(psbt: &mut PartiallySignedTransaction, privkey: SecretKey) {
|
||||
// let secp = Secp256k1::new();
|
||||
|
||||
// for (index, input) in psbt.inputs.iter_mut().enumerate() {
|
||||
// let sighash = psbt.sighash(index, secp);
|
||||
// let signature = SchnorrSig::sign(sighash, &privkey, secp);
|
||||
// input.taproot_key_sig = Some(signature);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
async fn create_script(coordinator_pub_key, maker_pub_key,taker_pub_key ) {
|
||||
// Define the Miniscript policies
|
||||
let policy_a = format!("and_v(v:pk({}),and_v(v:pk({}),after(144)))", coordinator_pub_key, maker_pub_key);
|
||||
let policy_b = format!("and_v(v:pk({}),and_v(v:pk({}),pk({})))", maker_pub_key, taker_pub_key, coordinator_pub_key);
|
||||
let policy_c = format!("and_v(v:pk({}),pk({}))", maker_pub_key, coordinator_pub_key);
|
||||
let policy_d = format!("and_v(v:pk({}),pk({}))", taker_pub_key, coordinator_pub_key);
|
||||
let policy_e = format!("and_v(v:pk({}),after(12228))", maker_pub_key);
|
||||
let policy_f = format!("and_v(and_v(v:pk({}),v:pk({})),after(2048))", maker_pub_key, taker_pub_key);
|
||||
// async fn create_script(coordinator_pub_key, maker_pub_key,taker_pub_key ) {
|
||||
// // Define the Miniscript policies
|
||||
// let policy_a = format!("and_v(v:pk({}),and_v(v:pk({}),after(144)))", coordinator_pub_key, maker_pub_key);
|
||||
// let policy_b = format!("and_v(v:pk({}),and_v(v:pk({}),pk({})))", maker_pub_key, taker_pub_key, coordinator_pub_key);
|
||||
// let policy_c = format!("and_v(v:pk({}),pk({}))", maker_pub_key, coordinator_pub_key);
|
||||
// let policy_d = format!("and_v(v:pk({}),pk({}))", taker_pub_key, coordinator_pub_key);
|
||||
// let policy_e = format!("and_v(v:pk({}),after(12228))", maker_pub_key);
|
||||
// let policy_f = format!("and_v(and_v(v:pk({}),v:pk({})),after(2048))", maker_pub_key, taker_pub_key);
|
||||
|
||||
// Compile the policies into Miniscript
|
||||
let miniscript_a: Miniscript<DescriptorPublicKey> = policy_a.parse().unwrap().compile().unwrap();
|
||||
let miniscript_b: Miniscript<DescriptorPublicKey> = policy_b.parse().unwrap().compile().unwrap();
|
||||
let miniscript_c: Miniscript<DescriptorPublicKey> = policy_c.parse().unwrap().compile().unwrap();
|
||||
let miniscript_d: Miniscript<DescriptorPublicKey> = policy_d.parse().unwrap().compile().unwrap();
|
||||
let miniscript_e: Miniscript<DescriptorPublicKey> = policy_e.parse().unwrap().compile().unwrap();
|
||||
let miniscript_f: Miniscript<DescriptorPublicKey> = policy_f.parse().unwrap().compile().unwrap();
|
||||
// // Compile the policies into Miniscript
|
||||
// let miniscript_a: Miniscript<DescriptorPublicKey> = policy_a.parse().unwrap().compile().unwrap();
|
||||
// let miniscript_b: Miniscript<DescriptorPublicKey> = policy_b.parse().unwrap().compile().unwrap();
|
||||
// let miniscript_c: Miniscript<DescriptorPublicKey> = policy_c.parse().unwrap().compile().unwrap();
|
||||
// let miniscript_d: Miniscript<DescriptorPublicKey> = policy_d.parse().unwrap().compile().unwrap();
|
||||
// let miniscript_e: Miniscript<DescriptorPublicKey> = policy_e.parse().unwrap().compile().unwrap();
|
||||
// let miniscript_f: Miniscript<DescriptorPublicKey> = policy_f.parse().unwrap().compile().unwrap();
|
||||
|
||||
// Create the Taproot descriptors
|
||||
let descriptor_a = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_a]);
|
||||
let descriptor_b = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_b]);
|
||||
let descriptor_c = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_c]);
|
||||
let descriptor_d = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_d]);
|
||||
let descriptor_e = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_e]);
|
||||
let descriptor_f = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_f]);
|
||||
// // Create the Taproot descriptors
|
||||
// let descriptor_a = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_a]);
|
||||
// let descriptor_b = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_b]);
|
||||
// let descriptor_c = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_c]);
|
||||
// let descriptor_d = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_d]);
|
||||
// let descriptor_e = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_e]);
|
||||
// let descriptor_f = Descriptor::Tr(coordinator_pub_key.clone(), vec![miniscript_f]);
|
||||
|
||||
// Generate the Taproot addresses
|
||||
let address_a = Address::p2tr(&descriptor_a, Network::Bitcoin);
|
||||
let address_b = Address::p2tr(&descriptor_b, Network::Bitcoin);
|
||||
let address_c = Address::p2tr(&descriptor_c, Network::Bitcoin);
|
||||
let address_d = Address::p2tr(&descriptor_d, Network::Bitcoin);
|
||||
let address_e = Address::p2tr(&descriptor_e, Network::Bitcoin);
|
||||
let address_f = Address::p2tr(&descriptor_f, Network::Bitcoin);
|
||||
// // Generate the Taproot addresses
|
||||
// let address_a = Address::p2tr(&descriptor_a, Network::Bitcoin);
|
||||
// let address_b = Address::p2tr(&descriptor_b, Network::Bitcoin);
|
||||
// let address_c = Address::p2tr(&descriptor_c, Network::Bitcoin);
|
||||
// let address_d = Address::p2tr(&descriptor_d, Network::Bitcoin);
|
||||
// let address_e = Address::p2tr(&descriptor_e, Network::Bitcoin);
|
||||
// let address_f = Address::p2tr(&descriptor_f, Network::Bitcoin);
|
||||
|
||||
println!("Taproot Address A: {}", address_a);
|
||||
println!("Taproot Address B: {}", address_b);
|
||||
println!("Taproot Address C: {}", address_c);
|
||||
println!("Taproot Address D: {}", address_d);
|
||||
println!("Taproot Address E: {}", address_e);
|
||||
println!("Taproot Address F: {}", address_f);
|
||||
// println!("Taproot Address A: {}", address_a);
|
||||
// println!("Taproot Address B: {}", address_b);
|
||||
// println!("Taproot Address C: {}", address_c);
|
||||
// println!("Taproot Address D: {}", address_d);
|
||||
// println!("Taproot Address E: {}", address_e);
|
||||
// println!("Taproot Address F: {}", address_f);
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
async fn procedure() {
|
||||
let inputs = vec![/* ... UTXOs ... */ ];
|
||||
let outputs = vec![/* ... Outputs ... */];
|
||||
|
||||
let mut psbt = create_taproot_psbt(inputs, outputs);
|
||||
let privkey = SecretKey::from_slice(&[/* private key bytes */]).unwrap();
|
||||
|
||||
sign_psbt(&mut psbt, privkey);
|
||||
|
||||
// Finalize and broadcast the PSBT
|
||||
let tx = psbt.finalize().unwrap();
|
||||
broadcast_transaction(tx);
|
||||
}
|
Reference in New Issue
Block a user