diff --git a/.github/workflows/release.yaml b/.github/workflows/release-bin.yaml similarity index 84% rename from .github/workflows/release.yaml rename to .github/workflows/release-bin.yaml index 601243eafd..7d345ffdf8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release-bin.yaml @@ -1,53 +1,18 @@ -# This workflow is used to publish SV2 crates to cratesio as well as releasing binaries of the roles -# (translator, pool, mining_proxy) to github. The github releases will fail if there are no tags available -# so the `autoversion` workflow must be ran and the resulting PR must be merged at least once before this will -# release the binaries to github. - +# as well as releasing binaries of the roles +# (translator, pool, mining_proxy) to github. # If the binary releases do fail to due to not having tags, force run the `autoversion` workflow # on the main branch and merge the resulting PR to create the tags and move them to the main branch. -# This should be disabled for forks - -name: Release - +name: Release Binaries on: # Manually run by going to "Actions/Release" in Github and running the workflow workflow_dispatch: jobs: - crates_publish: - name: Release + github_release_translator: runs-on: ${{ matrix.os }} strategy: matrix: - os: - - ubuntu-latest - include: - - os: ubuntu-latest - target: x86_64-unknown-linux-musl - - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - - name: Login - run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} - - - name: Install cargo-release - run: cargo install cargo-release - - # Need to exclude sv2_ffi to bypass else the 5 new crate limit. After this first publish, this can be removed - - name: Publish - run: cargo release publish -x --exclude mining_proxy_sv2 --exclude pool_sv2 --exclude translator_sv2 --all-features --no-confirm - - github_release_translator: - runs-on: ${{ matrix.os }} - strategy: - matrix: - # This defines what environments we will build on include: - os: ubuntu-latest artifact_name: translator_sv2 @@ -231,8 +196,3 @@ jobs: asset_name: ${{ matrix.asset_name }} tag: ${{ env.MINING_PROXY_TAG }} - - - - - diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml new file mode 100644 index 0000000000..d8348046c3 --- /dev/null +++ b/.github/workflows/release-libs.yaml @@ -0,0 +1,137 @@ +# This workflow is used to publish SV2 crates to cratesio +# The workflow try to update all the library crates so if a crate is not to updated, the step will fail +# for that each step have continue-on-error set to true. +# Since each step can fail the output ot the action must be manually check to macke sure that all +# the library intended to be published are published. +# Runing cargo release in the various workspace help to prepare the version number and everything. +# ATTENTION +# Is very important to check the output manually cause when too many crates are updated crates.io could fail +# and ask to rerun the action later + +name: Release Libs + +on: + # Manually run by going to "Actions/Release" in Github and running the workflow + workflow_dispatch: + +jobs: + libs_publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Login + run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} + - name: Publish crates common + continue-on-error: true + run: | + cd common + cargo publish + - name: Publish crates buffer_sv2 + continue-on-error: true + run: | + cd utils/buffer + cargo publish + - name: Publish crates no_serde_sv2_derive_codec + continue-on-error: true + run: | + cd protocols/v2/binary-sv2/no-serde-sv2/derive_codec + cargo publish + - name: Publish crates no_serde_sv2_codec + continue-on-error: true + run: | + cd protocols/v2/binary-sv2/no-serde-sv2/codec + cargo publish + - name: Publish crates serde_sv2 + continue-on-error: true + run: | + cd protocols/v2/binary-sv2/serde-sv2 + cargo publish + - name: Publish crates binary_sv2 + continue-on-error: true + run: | + cd protocols/v2/binary-sv2/binary-sv2 + cargo publish + - name: Publish crates binary_sv2 + continue-on-error: true + run: | + cd protocols/v2/binary-sv2/binary-sv2 + cargo publish + - name: Publish crates const_sv2 + continue-on-error: true + run: | + cd protocols/v2/const-sv2 + cargo publish + - name: Publish crates framing_sv2 + continue-on-error: true + run: | + cd protocols/v2/framing-sv2 + cargo publish + - name: Publish crates noise_sv2 + continue-on-error: true + run: | + cd protocols/v2/noise-sv2 + cargo publish + - name: Publish crates codec_sv2 + continue-on-error: true + run: | + cd protocols/v2/codec-sv2 + cargo publish + - name: Publish crates common_messages + continue-on-error: true + run: | + cd protocols/v2/subprotocols/common-messages + cargo publish + - name: Publish crates job_declaration + continue-on-error: true + run: | + cd protocols/v2/subprotocols/job-declaration + cargo publish + - name: Publish crates mining + continue-on-error: true + run: | + cd protocols/v2/subprotocols/mining + cargo publish + - name: Publish crates template_distribution + continue-on-error: true + run: | + cd protocols/v2/subprotocols/template-distribution + cargo publish + - name: Publish crates sv2_ffi + continue-on-error: true + run: | + cd protocols/v2/sv2-ffi + cargo publish + - name: Publish crates roles_logic_sv2 + continue-on-error: true + run: | + cd protocols/v2/roles-logic-sv2 + cargo publish + - name: Publish crates v1 + continue-on-error: true + run: | + cd protocols/v1 + cargo publish + - name: Publish crates bip32-key-derivation + continue-on-error: true + run: | + cd utils/bip32-key-derivation + cargo publish + - name: Publish crates error-handling + continue-on-error: true + run: | + cd utils/error-handling + cargo publish + - name: Publish crates key-utils + continue-on-error: true + run: | + cd utils/key-utils + cargo publish + - name: Publish crates network-helpers + continue-on-error: true + run: | + cd utils/network-helpers + cargo publish diff --git a/common/Cargo.lock b/common/Cargo.lock new file mode 100644 index 0000000000..4400704d1b --- /dev/null +++ b/common/Cargo.lock @@ -0,0 +1,67 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "bitcoin" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" +dependencies = [ + "bech32", + "bitcoin_hashes", + "secp256k1", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "bitcoin_hashes", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "stratum-common" +version = "0.1.0" +dependencies = [ + "bitcoin", +] diff --git a/common/Cargo.toml b/common/Cargo.toml index 2e3abba7b8..0b4d07f35e 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -7,4 +7,4 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/stratum-mining/stratum" [dependencies] -bitcoin = "0.29.1" +bitcoin = {version="0.29.1",optional=true} diff --git a/common/src/lib.rs b/common/src/lib.rs index 9fa046bd67..74b0562c91 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -2,4 +2,5 @@ //! //! `stratum_common` is a utility crate designed to centralize //! and manage the shared dependencies and utils across stratum crates. +#[cfg(feature = "bitcoin")] pub use bitcoin; diff --git a/protocols/Cargo.lock b/protocols/Cargo.lock index 299d7e6d96..37756cbfc6 100644 --- a/protocols/Cargo.lock +++ b/protocols/Cargo.lock @@ -77,7 +77,7 @@ checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "binary_codec_sv2" -version = "0.1.4" +version = "0.1.5" dependencies = [ "buffer_sv2", "quickcheck", @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "binary_sv2" -version = "0.1.6" +version = "0.1.7" dependencies = [ "binary_codec_sv2", "derive_codec_sv2", @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "buffer_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "aes-gcm", "serde", @@ -214,7 +214,7 @@ dependencies = [ [[package]] name = "common_messages_sv2" -version = "0.1.5" +version = "0.1.7" dependencies = [ "binary_sv2", "const_sv2", @@ -226,7 +226,7 @@ dependencies = [ [[package]] name = "const_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "secp256k1 0.28.2", ] @@ -262,7 +262,7 @@ dependencies = [ [[package]] name = "derive_codec_sv2" -version = "0.1.3" +version = "0.1.5" dependencies = [ "binary_codec_sv2", ] @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "framing_sv2" -version = "0.1.5" +version = "0.1.6" dependencies = [ "binary_sv2", "buffer_sv2", @@ -409,7 +409,7 @@ checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mining_sv2" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binary_sv2", "const_sv2", @@ -602,7 +602,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "roles_logic_sv2" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binary_sv2", "chacha20poly1305", @@ -712,7 +712,7 @@ dependencies = [ [[package]] name = "serde_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "buffer_sv2", "serde", @@ -739,7 +739,7 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "sv1_api" -version = "0.1.1" +version = "0.1.2" dependencies = [ "binary_sv2", "bitcoin_hashes 0.3.2", @@ -756,7 +756,7 @@ dependencies = [ [[package]] name = "sv2_ffi" -version = "0.1.3" +version = "0.1.4" dependencies = [ "binary_sv2", "codec_sv2", @@ -791,7 +791,7 @@ dependencies = [ [[package]] name = "template_distribution_sv2" -version = "0.1.5" +version = "0.1.6" dependencies = [ "binary_sv2", "const_sv2", diff --git a/protocols/v1/Cargo.toml b/protocols/v1/Cargo.toml index b806a0a21a..ec46df0553 100644 --- a/protocols/v1/Cargo.toml +++ b/protocols/v1/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sv1_api" -version = "0.1.1" +version = "0.1.2" authors = ["user"] edition = "2018" description = "API for bridging SV1 miners to SV2 pools" diff --git a/protocols/v2/binary-sv2/binary-sv2/Cargo.toml b/protocols/v2/binary-sv2/binary-sv2/Cargo.toml index 837ef928ff..bffde56872 100644 --- a/protocols/v2/binary-sv2/binary-sv2/Cargo.toml +++ b/protocols/v2/binary-sv2/binary-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binary_sv2" -version = "0.1.6" +version = "0.1.7" authors = ["fi3 "] edition = "2018" description = "Sv2 data format" diff --git a/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml b/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml index 23d9f83b64..a25cd20971 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml +++ b/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binary_codec_sv2" -version = "0.1.4" +version = "0.1.5" authors = ["fi3 "] edition = "2018" description = "Sv2 data format" diff --git a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml index 62cc7ce2c1..455f81acb8 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml +++ b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "derive_codec_sv2" -version = "0.1.3" +version = "0.1.5" authors = ["fi3 "] edition = "2018" description = "Derive macro for Sv2 binary format serializer and deserializer" diff --git a/protocols/v2/binary-sv2/serde-sv2/Cargo.toml b/protocols/v2/binary-sv2/serde-sv2/Cargo.toml index 21e1baafa9..4ec483b4c5 100644 --- a/protocols/v2/binary-sv2/serde-sv2/Cargo.toml +++ b/protocols/v2/binary-sv2/serde-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_sv2" -version = "0.1.2" +version = "0.1.3" authors = ["fi3 "] edition = "2018" description = "Serlializer and Deserializer for Stratum V2 data format" diff --git a/protocols/v2/codec-sv2/Cargo.toml b/protocols/v2/codec-sv2/Cargo.toml index 2413368c07..86e7a95629 100644 --- a/protocols/v2/codec-sv2/Cargo.toml +++ b/protocols/v2/codec-sv2/Cargo.toml @@ -6,10 +6,6 @@ edition = "2018" description = "Sv2 data format" license = "MIT" repository = "https://github.com/stratum-mining/stratum" -# remove when git repo based dependencies in noise_sv2 are removed -publish = false - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] serde = { version = "1.0.89", default-features = false, optional = true } diff --git a/protocols/v2/const-sv2/Cargo.toml b/protocols/v2/const-sv2/Cargo.toml index b1376ca073..749868d3ea 100644 --- a/protocols/v2/const-sv2/Cargo.toml +++ b/protocols/v2/const-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "const_sv2" -version = "0.1.2" +version = "0.1.3" authors = ["fi3 "] edition = "2018" description = "Sv2 constatnts" diff --git a/protocols/v2/framing-sv2/Cargo.toml b/protocols/v2/framing-sv2/Cargo.toml index 50844b9dff..ad8c6429f1 100644 --- a/protocols/v2/framing-sv2/Cargo.toml +++ b/protocols/v2/framing-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "framing_sv2" -version = "0.1.5" +version = "0.1.6" authors = ["fi3 "] edition = "2018" description = "Sv2 frames" diff --git a/protocols/v2/noise-sv2/Cargo.toml b/protocols/v2/noise-sv2/Cargo.toml index 21acefa6a7..db01ab3765 100644 --- a/protocols/v2/noise-sv2/Cargo.toml +++ b/protocols/v2/noise-sv2/Cargo.toml @@ -6,10 +6,6 @@ edition = "2018" description = "Sv2 noise" license = "MIT" repository = "https://github.com/stratum-mining/stratum" -# remove when git repo based dependencies are removed -publish = false - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] secp256k1 = { version = "0.28.2", default-features = false, features =["hashes", "alloc","rand","rand-std"] } diff --git a/protocols/v2/noise-sv2/src/initiator.rs b/protocols/v2/noise-sv2/src/initiator.rs index f3996abe2a..11d4b1b767 100644 --- a/protocols/v2/noise-sv2/src/initiator.rs +++ b/protocols/v2/noise-sv2/src/initiator.rs @@ -31,7 +31,7 @@ pub struct Initiator { e: Keypair, // upstream pub key #[allow(unused)] - pk: XOnlyPublicKey, + responder_authority_pk: Option, c1: Option, c2: Option, } @@ -96,10 +96,14 @@ impl Initiator { pub fn from_raw_k(key: [u8; 32]) -> Result, Error> { let pk = secp256k1::XOnlyPublicKey::from_slice(&key).map_err(|_| Error::InvalidRawPublicKey)?; - Ok(Self::new(pk)) + Ok(Self::new(Some(pk))) } - pub fn new(pk: XOnlyPublicKey) -> Box { + pub fn without_pk() -> Result, Error> { + Ok(Self::new(None)) + } + + pub fn new(pk: Option) -> Box { let mut self_ = Self { handshake_cipher: None, k: None, @@ -107,7 +111,7 @@ impl Initiator { ck: [0; 32], h: [0; 32], e: Self::generate_key(), - pk, + responder_authority_pk: pk, c1: None, c2: None, }; @@ -226,25 +230,47 @@ impl Initiator { .0 .serialize(); let rs_pk_xonly = XOnlyPublicKey::from_slice(&rs_pub_key).unwrap(); - if signature_message.verify(&rs_pk_xonly) { - let (temp_k1, temp_k2) = Self::hkdf_2(self.get_ck(), &[]); - let c1 = ChaCha20Poly1305::new(&temp_k1.into()); - let c2 = ChaCha20Poly1305::new(&temp_k2.into()); - let c1: Cipher = Cipher::from_key_and_cipher(temp_k1, c1); - let c2: Cipher = Cipher::from_key_and_cipher(temp_k2, c2); - self.c1 = None; - self.c2 = None; - let mut encryptor = GenericCipher::ChaCha20Poly1305(c1); - let mut decryptor = GenericCipher::ChaCha20Poly1305(c2); - encryptor.erase_k(); - decryptor.erase_k(); - let codec = crate::NoiseCodec { - encryptor, - decryptor, - }; - Ok(codec) - } else { - Err(Error::InvalidCertificate(plaintext)) + match &self.responder_authority_pk { + Some(responder_authority_pk) => { + if signature_message.verify(&rs_pk_xonly, responder_authority_pk) { + let (temp_k1, temp_k2) = Self::hkdf_2(self.get_ck(), &[]); + let c1 = ChaCha20Poly1305::new(&temp_k1.into()); + let c2 = ChaCha20Poly1305::new(&temp_k2.into()); + let c1: Cipher = Cipher::from_key_and_cipher(temp_k1, c1); + let c2: Cipher = Cipher::from_key_and_cipher(temp_k2, c2); + self.c1 = None; + self.c2 = None; + let mut encryptor = GenericCipher::ChaCha20Poly1305(c1); + let mut decryptor = GenericCipher::ChaCha20Poly1305(c2); + encryptor.erase_k(); + decryptor.erase_k(); + let codec = crate::NoiseCodec { + encryptor, + decryptor, + }; + Ok(codec) + } else { + Err(Error::InvalidCertificate(plaintext)) + } + } + None => { + let (temp_k1, temp_k2) = Self::hkdf_2(self.get_ck(), &[]); + let c1 = ChaCha20Poly1305::new(&temp_k1.into()); + let c2 = ChaCha20Poly1305::new(&temp_k2.into()); + let c1: Cipher = Cipher::from_key_and_cipher(temp_k1, c1); + let c2: Cipher = Cipher::from_key_and_cipher(temp_k2, c2); + self.c1 = None; + self.c2 = None; + let mut encryptor = GenericCipher::ChaCha20Poly1305(c1); + let mut decryptor = GenericCipher::ChaCha20Poly1305(c2); + encryptor.erase_k(); + decryptor.erase_k(); + let codec = crate::NoiseCodec { + encryptor, + decryptor, + }; + Ok(codec) + } } } diff --git a/protocols/v2/noise-sv2/src/responder.rs b/protocols/v2/noise-sv2/src/responder.rs index 15ebe190b2..f5a3ddcc2c 100644 --- a/protocols/v2/noise-sv2/src/responder.rs +++ b/protocols/v2/noise-sv2/src/responder.rs @@ -29,6 +29,8 @@ pub struct Responder { e: Keypair, // Static pub keypair s: Keypair, + // Authority pub keypair + a: Keypair, c1: Option, c2: Option, cert_validity: u32, @@ -107,7 +109,7 @@ impl Responder { } } - pub fn new(s: Keypair, cert_validity: u32) -> Box { + pub fn new(a: Keypair, cert_validity: u32) -> Box { let mut self_ = Self { handshake_cipher: None, k: None, @@ -115,7 +117,8 @@ impl Responder { ck: [0; 32], h: [0; 32], e: Self::generate_key(), - s, + s: Self::generate_key(), + a, c1: None, c2: None, cert_validity, @@ -270,7 +273,7 @@ impl Responder { ret[7] = not_valid_after[1]; ret[8] = not_valid_after[2]; ret[9] = not_valid_after[3]; - SignatureNoiseMessage::sign(&mut ret, &self.s); + SignatureNoiseMessage::sign(&mut ret, &self.s.x_only_public_key().0, &self.a); ret } @@ -294,6 +297,7 @@ impl Responder { } self.e.non_secure_erase(); self.s.non_secure_erase(); + self.a.non_secure_erase(); } } diff --git a/protocols/v2/noise-sv2/src/signature_message.rs b/protocols/v2/noise-sv2/src/signature_message.rs index cacc9a7c61..23393eab2c 100644 --- a/protocols/v2/noise-sv2/src/signature_message.rs +++ b/protocols/v2/noise-sv2/src/signature_message.rs @@ -24,7 +24,7 @@ impl From<[u8; 74]> for SignatureNoiseMessage { } impl SignatureNoiseMessage { - pub fn verify(self, pk: &XOnlyPublicKey) -> bool { + pub fn verify(self, pk: &XOnlyPublicKey, authority_pk: &XOnlyPublicKey) -> bool { let now = SystemTime::now() .duration_since(SystemTime::UNIX_EPOCH) .unwrap() @@ -32,19 +32,22 @@ impl SignatureNoiseMessage { if self.valid_from <= now && self.not_valid_after >= now { let secp = Secp256k1::verification_only(); let (m, s) = self.split(); - let m = Message::from_hashed_data::(&m[0..10]); + // m = SHA-256(version || valid_from || not_valid_after || server_static_key) + let m = [&m[0..10], &pk.serialize()].concat(); + let m = Message::from_hashed_data::(&m); let s = match Signature::from_slice(&s) { Ok(s) => s, _ => return false, }; - secp.verify_schnorr(&s, &m, pk).is_ok() + secp.verify_schnorr(&s, &m, authority_pk).is_ok() } else { false } } - pub fn sign(msg: &mut [u8; 74], kp: &Keypair) { + pub fn sign(msg: &mut [u8; 74], static_pk: &XOnlyPublicKey, kp: &Keypair) { let secp = Secp256k1::signing_only(); - let m = Message::from_hashed_data::(&msg[0..10]); + let m = [&msg[0..10], &static_pk.serialize()].concat(); + let m = Message::from_hashed_data::(&m); let signature = secp.sign_schnorr(&m, kp); for (i, b) in signature.as_ref().iter().enumerate() { msg[10 + i] = *b; diff --git a/protocols/v2/noise-sv2/src/test.rs b/protocols/v2/noise-sv2/src/test.rs index d6925f0a31..3c287fc6a0 100644 --- a/protocols/v2/noise-sv2/src/test.rs +++ b/protocols/v2/noise-sv2/src/test.rs @@ -4,7 +4,7 @@ use crate::{handshake::HandshakeOp, initiator::Initiator, responder::Responder}; fn test_1() { let key_pair = Responder::generate_key(); - let mut initiator = Initiator::new(key_pair.public_key().into()); + let mut initiator = Initiator::new(Some(key_pair.public_key().into())); let mut responder = Responder::new(key_pair, 31449600); let first_message = initiator.step_0().unwrap(); let (second_message, mut codec_responder) = responder.step_1(first_message).unwrap(); diff --git a/protocols/v2/roles-logic-sv2/Cargo.toml b/protocols/v2/roles-logic-sv2/Cargo.toml index 7038f0d2e6..4defeb6350 100644 --- a/protocols/v2/roles-logic-sv2/Cargo.toml +++ b/protocols/v2/roles-logic-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roles_logic_sv2" -version = "0.1.0" +version = "0.1.1" edition = "2018" description = "Common handlers for use within SV2 roles" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ repository = "https://github.com/stratum-mining/stratum" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -stratum-common = { path = "../../../common" } +stratum-common = { version="0.1.0", path = "../../../common", features=["bitcoin"]} serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true} binary_sv2 = {version = "^0.1.6", path = "../../../protocols/v2/binary-sv2/binary-sv2", default-features = true } common_messages_sv2 = { path = "../../../protocols/v2/subprotocols/common-messages", version = "^0.1.5" } diff --git a/protocols/v2/subprotocols/common-messages/Cargo.toml b/protocols/v2/subprotocols/common-messages/Cargo.toml index 9f53aeca79..d40f9125e7 100644 --- a/protocols/v2/subprotocols/common-messages/Cargo.toml +++ b/protocols/v2/subprotocols/common-messages/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "common_messages_sv2" -version = "0.1.5" +version = "0.1.7" authors = ["fi3 "] edition = "2018" description = "Sv2 subprotocol common messages" diff --git a/protocols/v2/subprotocols/mining/Cargo.toml b/protocols/v2/subprotocols/mining/Cargo.toml index 694368ec27..d11adfbcd6 100644 --- a/protocols/v2/subprotocols/mining/Cargo.toml +++ b/protocols/v2/subprotocols/mining/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mining_sv2" -version = "0.1.0" +version = "0.1.1" authors = ["fi3 "] edition = "2018" description = "SV2 mining protocol types" diff --git a/protocols/v2/subprotocols/template-distribution/Cargo.toml b/protocols/v2/subprotocols/template-distribution/Cargo.toml index 96c2f957ba..9ebe6d02dd 100644 --- a/protocols/v2/subprotocols/template-distribution/Cargo.toml +++ b/protocols/v2/subprotocols/template-distribution/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "template_distribution_sv2" -version = "0.1.5" +version = "0.1.6" authors = ["fi3 "] edition = "2018" description = "Sv2 template distribution subprotocol" diff --git a/protocols/v2/sv2-ffi/Cargo.toml b/protocols/v2/sv2-ffi/Cargo.toml index cf9d3da3bf..4cef13b64f 100644 --- a/protocols/v2/sv2-ffi/Cargo.toml +++ b/protocols/v2/sv2-ffi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sv2_ffi" -version = "0.1.3" +version = "0.1.4" authors = ["fi3 "] edition = "2018" description = "SV2 FFI" diff --git a/roles/Cargo.lock b/roles/Cargo.lock index 4b7bf0e812..e246e65d73 100644 --- a/roles/Cargo.lock +++ b/roles/Cargo.lock @@ -320,14 +320,14 @@ checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "binary_codec_sv2" -version = "0.1.4" +version = "0.1.5" dependencies = [ "buffer_sv2", ] [[package]] name = "binary_sv2" -version = "0.1.6" +version = "0.1.7" dependencies = [ "binary_codec_sv2", "derive_codec_sv2", @@ -433,7 +433,7 @@ dependencies = [ [[package]] name = "buffer_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "aes-gcm", ] @@ -520,7 +520,7 @@ dependencies = [ [[package]] name = "common_messages_sv2" -version = "0.1.5" +version = "0.1.7" dependencies = [ "binary_sv2", "const_sv2", @@ -537,7 +537,7 @@ dependencies = [ [[package]] name = "const_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "secp256k1 0.28.2", ] @@ -579,7 +579,7 @@ dependencies = [ [[package]] name = "derive_codec_sv2" -version = "0.1.3" +version = "0.1.5" dependencies = [ "binary_codec_sv2", ] @@ -628,7 +628,7 @@ dependencies = [ [[package]] name = "error_handling" -version = "0.1.0" +version = "0.1.1" [[package]] name = "event-listener" @@ -695,7 +695,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "framing_sv2" -version = "0.1.5" +version = "0.1.6" dependencies = [ "binary_sv2", "buffer_sv2", @@ -1151,7 +1151,7 @@ dependencies = [ [[package]] name = "mining_sv2" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binary_sv2", "const_sv2", @@ -1179,7 +1179,7 @@ dependencies = [ [[package]] name = "network_helpers" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-channel 1.9.0", "async-std", @@ -1527,7 +1527,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "roles_logic_sv2" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binary_sv2", "chacha20poly1305", @@ -1771,7 +1771,7 @@ dependencies = [ [[package]] name = "sv1_api" -version = "0.1.1" +version = "0.1.2" dependencies = [ "binary_sv2", "bitcoin_hashes 0.3.2", @@ -1808,7 +1808,7 @@ dependencies = [ [[package]] name = "template_distribution_sv2" -version = "0.1.5" +version = "0.1.6" dependencies = [ "binary_sv2", "const_sv2", diff --git a/roles/jd-client/config-examples/jdc-config-hosted-example.toml b/roles/jd-client/config-examples/jdc-config-hosted-example.toml index be04e74a45..e2bebaa44e 100644 --- a/roles/jd-client/config-examples/jdc-config-hosted-example.toml +++ b/roles/jd-client/config-examples/jdc-config-hosted-example.toml @@ -28,7 +28,7 @@ retry = 10 # tp_address = "127.0.0.1:8442" # Hosted testnet TP tp_address = "75.119.150.111:8442" -tp_authority_pub_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" +tp_authority_public_key = "3VANfft6ei6jQq1At7d8nmiZzVhBFS4CiQujdgim1ign" # Solo Mining config # List of coinbase outputs used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system) diff --git a/roles/jd-client/config-examples/jdc-config-local-example.toml b/roles/jd-client/config-examples/jdc-config-local-example.toml index 06c878514f..00342c0047 100644 --- a/roles/jd-client/config-examples/jdc-config-local-example.toml +++ b/roles/jd-client/config-examples/jdc-config-local-example.toml @@ -28,7 +28,10 @@ retry = 10 tp_address = "127.0.0.1:8442" # Hosted testnet TP # tp_address = "75.119.150.111:8442" -tp_authority_pub_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" + +# You'll need to get tp_authority_public_key from the logs of your TP, for example: +# 2024-02-13T14:59:24Z Template Provider authority key: EguTM8URcZDQVeEBsM4B5vg9weqEUnufA8pm85fG4bZd +# tp_authority_public_key = "" # Solo Mining config # List of coinbase outputs used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system) diff --git a/roles/jd-client/src/lib/proxy_config.rs b/roles/jd-client/src/lib/proxy_config.rs index ec456b1a2a..89c97a7beb 100644 --- a/roles/jd-client/src/lib/proxy_config.rs +++ b/roles/jd-client/src/lib/proxy_config.rs @@ -36,7 +36,7 @@ pub struct ProxyConfig { pub authority_secret_key: Secp256k1SecretKey, pub cert_validity_sec: u64, pub tp_address: String, - pub tp_authority_pub_key: Secp256k1PublicKey, + pub tp_authority_public_key: Option, pub retry: u32, pub upstreams: Vec, #[serde(deserialize_with = "duration_from_toml")] diff --git a/roles/jd-client/src/lib/template_receiver/mod.rs b/roles/jd-client/src/lib/template_receiver/mod.rs index 43275fda85..9a202de42d 100644 --- a/roles/jd-client/src/lib/template_receiver/mod.rs +++ b/roles/jd-client/src/lib/template_receiver/mod.rs @@ -53,7 +53,7 @@ impl TemplateRx { task_collector: Arc>>, pool_chaneger_trigger: Arc>, miner_coinbase_outputs: Vec, - authority_public_key: Secp256k1PublicKey, + authority_public_key: Option, test_only_do_not_send_solution_to_tp: bool, ) { let mut encoded_outputs = vec![]; @@ -62,8 +62,11 @@ impl TemplateRx { .expect("Invalid coinbase output in config"); let stream = tokio::net::TcpStream::connect(address).await.unwrap(); - let pub_key: Secp256k1PublicKey = authority_public_key; - let initiator = Initiator::from_raw_k(pub_key.into_bytes()).unwrap(); + let initiator = match authority_public_key { + Some(pub_key) => Initiator::from_raw_k(pub_key.into_bytes()), + None => Initiator::without_pk(), + } + .unwrap(); let (mut receiver, mut sender, _, _) = Connection::new(stream, HandshakeRole::Initiator(initiator)) .await diff --git a/roles/jd-client/src/main.rs b/roles/jd-client/src/main.rs index 9a6ba2dbe8..ac246987ed 100644 --- a/roles/jd-client/src/main.rs +++ b/roles/jd-client/src/main.rs @@ -249,7 +249,7 @@ async fn initialize_jd_as_solo_miner( task_collector, Arc::new(Mutex::new(PoolChangerTrigger::new(timeout))), miner_tx_out.clone(), - proxy_config.tp_authority_pub_key, + proxy_config.tp_authority_public_key, false, ) .await; @@ -384,7 +384,7 @@ async fn initialize_jd( task_collector, Arc::new(Mutex::new(PoolChangerTrigger::new(timeout))), vec![], - proxy_config.tp_authority_pub_key, + proxy_config.tp_authority_public_key, test_only_do_not_send_solution_to_tp, ) .await; diff --git a/roles/pool/config-examples/pool-config-hosted-tp-example.toml b/roles/pool/config-examples/pool-config-hosted-tp-example.toml index bc0f915da4..a86c600d59 100644 --- a/roles/pool/config-examples/pool-config-hosted-tp-example.toml +++ b/roles/pool/config-examples/pool-config-hosted-tp-example.toml @@ -25,3 +25,4 @@ pool_signature = "Stratum v2 SRI Pool" #tp_address = "127.0.0.1:8442" # Hosted testnet TP tp_address = "75.119.150.111:8442" +tp_authority_public_key = "EguTM8URcZDQVeEBsM4B5vg9weqEUnufA8pm85fG4bZd" \ No newline at end of file diff --git a/roles/pool/config-examples/pool-config-local-tp-example.toml b/roles/pool/config-examples/pool-config-local-tp-example.toml index 5c94d56087..f1ca9f901f 100644 --- a/roles/pool/config-examples/pool-config-local-tp-example.toml +++ b/roles/pool/config-examples/pool-config-local-tp-example.toml @@ -24,5 +24,8 @@ pool_signature = "Stratum v2 SRI Pool" # Template Provider config # Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) tp_address = "127.0.0.1:8442" +# You'll need to get tp_authority_public_key from the logs of your TP, for example: +# 2024-02-13T14:59:24Z Template Provider authority key: EguTM8URcZDQVeEBsM4B5vg9weqEUnufA8pm85fG4bZd +# tp_authority_public_key = "" # Hosted testnet TP # tp_address = "75.119.150.111:8442" diff --git a/roles/pool/src/lib/mining_pool/mod.rs b/roles/pool/src/lib/mining_pool/mod.rs index d7a6c15fb2..86c85e80aa 100644 --- a/roles/pool/src/lib/mining_pool/mod.rs +++ b/roles/pool/src/lib/mining_pool/mod.rs @@ -83,6 +83,7 @@ impl TryFrom<&CoinbaseOutput> for CoinbaseOutput_ { pub struct Configuration { pub listen_address: String, pub tp_address: String, + pub tp_authority_public_key: Option, pub authority_public_key: Secp256k1PublicKey, pub authority_secret_key: Secp256k1SecretKey, pub cert_validity_sec: u64, diff --git a/roles/pool/src/lib/template_receiver/mod.rs b/roles/pool/src/lib/template_receiver/mod.rs index 5ab06c56a3..a996852a86 100644 --- a/roles/pool/src/lib/template_receiver/mod.rs +++ b/roles/pool/src/lib/template_receiver/mod.rs @@ -43,13 +43,17 @@ impl TemplateRx { message_received_signal: Receiver<()>, status_tx: status::Sender, coinbase_out_len: u32, - authority_public_key: Secp256k1PublicKey, + expected_tp_authority_public_key: Option, ) -> PoolResult<()> { let stream = TcpStream::connect(address).await?; info!("Connected to template distribution server at {}", address); - let pub_key: Secp256k1PublicKey = authority_public_key; - let initiator = Initiator::from_raw_k(pub_key.into_bytes())?; + let initiator = match expected_tp_authority_public_key { + Some(expected_tp_authority_public_key) => { + Initiator::from_raw_k(expected_tp_authority_public_key.into_bytes()) + } + None => Initiator::without_pk(), + }?; let (mut receiver, mut sender, _, _) = Connection::new(stream, HandshakeRole::Initiator(initiator)) .await diff --git a/roles/pool/src/main.rs b/roles/pool/src/main.rs index 73280852c5..169243c235 100644 --- a/roles/pool/src/main.rs +++ b/roles/pool/src/main.rs @@ -115,7 +115,7 @@ async fn main() { return; } }; - let authority_public_key = config.authority_public_key; + let tp_authority_public_key = config.tp_authority_public_key; let template_rx_res = TemplateRx::connect( config.tp_address.parse().unwrap(), s_new_t, @@ -124,7 +124,7 @@ async fn main() { r_message_recv_signal, status::Sender::Upstream(status_tx.clone()), coinbase_output_len, - authority_public_key, + tp_authority_public_key, ) .await; diff --git a/utils/Cargo.lock b/utils/Cargo.lock index 56681636c5..7f7f5887b6 100644 --- a/utils/Cargo.lock +++ b/utils/Cargo.lock @@ -67,6 +67,46 @@ dependencies = [ "memchr", ] +[[package]] +name = "amplify" +version = "3.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2ec14f4fb838e9ddace42fa5944bb1ee4dff8477494ba48c5f874e16caf27a" +dependencies = [ + "amplify_derive", + "amplify_num", + "wasm-bindgen", +] + +[[package]] +name = "amplify_derive" +version = "2.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c3de270e75f27a4468a7c344070109046656e85cb522141f7d40ab4b83803ac" +dependencies = [ + "amplify_syn", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "amplify_num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27d3d00d3d115395a7a8a4dc045feb7aa82b641e485f7e15f4e67ac16f4f56d" + +[[package]] +name = "amplify_syn" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da24db1445cc7bc3842fa072c2d51fe5b25b812b6a572d65842a4c72e87221ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "async-channel" version = "1.9.0" @@ -249,16 +289,22 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "binary_codec_sv2" -version = "0.1.4" +version = "0.1.5" dependencies = [ "buffer_sv2", ] [[package]] name = "binary_sv2" -version = "0.1.6" +version = "0.1.7" dependencies = [ "binary_codec_sv2", "derive_codec_sv2", @@ -267,12 +313,38 @@ dependencies = [ "tracing", ] +[[package]] +name = "bip32_derivation" +version = "1.0.0" +dependencies = [ + "slip132", + "stratum-common", + "toml", +] + +[[package]] +name = "bitcoin" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0694ea59225b0c5f3cb405ff3f670e4828358ed26aec49dc352f730f0cb1a8a3" +dependencies = [ + "bech32", + "bitcoin_hashes 0.11.0", + "secp256k1 0.24.3", +] + [[package]] name = "bitcoin-internals" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -331,7 +403,7 @@ dependencies = [ [[package]] name = "buffer_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "aes-gcm", "criterion", @@ -443,9 +515,9 @@ dependencies = [ [[package]] name = "const_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ - "secp256k1", + "secp256k1 0.28.2", ] [[package]] @@ -561,7 +633,7 @@ dependencies = [ [[package]] name = "derive_codec_sv2" -version = "0.1.3" +version = "0.1.5" dependencies = [ "binary_codec_sv2", ] @@ -593,7 +665,7 @@ dependencies = [ [[package]] name = "error_handling" -version = "0.1.0" +version = "0.1.1" [[package]] name = "event-listener" @@ -660,7 +732,7 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "framing_sv2" -version = "0.1.5" +version = "0.1.6" dependencies = [ "binary_sv2", "buffer_sv2", @@ -752,7 +824,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -935,7 +1007,7 @@ name = "key-utils" version = "1.0.0" dependencies = [ "bs58", - "secp256k1", + "secp256k1 0.28.2", "serde", "toml", ] @@ -1020,7 +1092,7 @@ dependencies = [ [[package]] name = "network_helpers" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-channel 1.9.0", "async-std", @@ -1042,7 +1114,7 @@ dependencies = [ "const_sv2", "rand", "rand_chacha", - "secp256k1", + "secp256k1 0.28.2", ] [[package]] @@ -1390,15 +1462,34 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "secp256k1" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +dependencies = [ + "bitcoin_hashes 0.11.0", + "secp256k1-sys 0.6.1", +] + [[package]] name = "secp256k1" version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.13.0", "rand", - "secp256k1-sys", + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", ] [[package]] @@ -1437,7 +1528,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -1453,7 +1544,7 @@ dependencies = [ [[package]] name = "serde_sv2" -version = "0.1.2" +version = "0.1.3" dependencies = [ "buffer_sv2", "serde", @@ -1490,6 +1581,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slip132" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "890b12cf298c4548739d6b1e53286576e43014ff1d3421751f2c26c80cc7a639" +dependencies = [ + "amplify", + "bitcoin", +] + [[package]] name = "smallvec" version = "1.13.1" @@ -1516,12 +1617,30 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "stratum-common" +version = "0.1.0" +dependencies = [ + "bitcoin", +] + [[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.48" @@ -1579,7 +1698,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -1610,7 +1729,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -1705,7 +1824,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -1739,7 +1858,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/utils/Cargo.toml b/utils/Cargo.toml index 385d52a0c0..93c57a5472 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -19,7 +19,8 @@ members = [ "network-helpers", "buffer", "error-handling", - "key-utils" + "key-utils", + "bip32-key-derivation" ] exclude = [ diff --git a/utils/bip32-key-derivation/Cargo.toml b/utils/bip32-key-derivation/Cargo.toml index e67ea36216..67f0ccbe20 100644 --- a/utils/bip32-key-derivation/Cargo.toml +++ b/utils/bip32-key-derivation/Cargo.toml @@ -2,6 +2,7 @@ name = "bip32_derivation" version = "1.0.0" edition = "2021" +description = "bip32_derivation" license = "MIT OR Apache-2.0" repository = "https://github.com/stratum-mining/stratum" @@ -14,7 +15,7 @@ name = "bip32_derivation-bin" path = "src/main.rs" [dependencies] -stratum-common = { path = "../../common" } +stratum-common = { version="0.1.0", path = "../../common", features=["bitcoin"]} slip132 = "0.10" [dev-dependencies] diff --git a/utils/buffer/Cargo.toml b/utils/buffer/Cargo.toml index cdf14160fa..d472ac4bfb 100644 --- a/utils/buffer/Cargo.toml +++ b/utils/buffer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "buffer_sv2" -version = "0.1.2" +version = "0.1.3" authors = ["fi3 "] edition = "2018" description = "buffer" diff --git a/utils/error-handling/Cargo.toml b/utils/error-handling/Cargo.toml index 9bea42554e..bed14a3047 100644 --- a/utils/error-handling/Cargo.toml +++ b/utils/error-handling/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "error_handling" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "Macro used to clean and centralize error handling within async processes" license = "MIT OR Apache-2.0" diff --git a/utils/key-utils/Cargo.toml b/utils/key-utils/Cargo.toml index 3f679fafaa..42fa67d8a1 100644 --- a/utils/key-utils/Cargo.toml +++ b/utils/key-utils/Cargo.toml @@ -2,6 +2,10 @@ name = "key-utils" version = "1.0.0" edition = "2021" +description = "Key utils" +license = "MIT OR Apache-2.0" +repository = "https://github.com/stratum-mining/stratum" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -19,4 +23,4 @@ secp256k1 = { version = "0.28.2", default-features = false, features =["alloc"," serde = { version = "1.0.89", features = ["derive","alloc"], default-features = false } [dev-dependencies] -toml = { version = "*", git = "https://github.com/diondokter/toml-rs", default-features = false, rev = "c4161aa" } +toml = { version = "0.5.6", git = "https://github.com/diondokter/toml-rs", default-features = false, rev = "c4161aa" } diff --git a/utils/network-helpers/Cargo.toml b/utils/network-helpers/Cargo.toml index 5132c6d266..799e232d87 100644 --- a/utils/network-helpers/Cargo.toml +++ b/utils/network-helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "network_helpers" -version = "0.1.0" +version = "0.1.1" authors = ["fi3 "] edition = "2018" description = "Networking utils for SV2 roles"