Skip to content

Commit d3dde30

Browse files
committed
fix(bip322): disable bip322 feature
-Temporary disable bip322 feature
1 parent 73c3b9d commit d3dde30

10 files changed

Lines changed: 265 additions & 289 deletions

File tree

Cargo.lock

Lines changed: 3 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ shlex = { version = "1.3.0", optional = true }
3939
payjoin = { version = "0.25.0", features = ["v1", "v2", "io", "_test-utils"], optional = true}
4040
reqwest = { version = "0.13.2", default-features = false, features = ["rustls"], optional = true }
4141
url = { version = "2.5.8", optional = true }
42-
bdk_bip322 = { version = "0.1.0", optional = true }
42+
# bdk_bip322 = { version = "0.1.0", optional = true }
4343
bitcoin-payment-instructions = { version = "0.7.0", optional = true}
4444

4545
[features]
@@ -61,7 +61,7 @@ dns_payment = ["bitcoin-payment-instructions"]
6161

6262
# Internal features
6363
_payjoin-dependencies = ["payjoin", "reqwest", "url", "sqlite"]
64-
bip322 = ["bdk_bip322"]
64+
# bip322 = ["bdk_bip322"]
6565

6666
# Use this to consensus verify transactions at sync time
6767
verify = []

src/commands.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
//! All subcommands are defined in the below enums.
1414
1515
#![allow(clippy::large_enum_variant)]
16-
#[cfg(feature = "bip322")]
17-
use crate::handlers::offline::{SignMessageCommand, VerifyMessageCommand};
16+
// #[cfg(feature = "bip322")]
17+
// use crate::handlers::offline::{SignMessageCommand, VerifyMessageCommand};
1818
use crate::handlers::{
1919
config::{ListWalletsCommand, SaveConfigCommand},
2020
descriptor::DescriptorCommand,
@@ -362,11 +362,11 @@ pub enum OfflineWalletSubCommand {
362362
/// Combines multiple PSBTs into one.
363363
CombinePsbt(CombinePsbtCommand),
364364
/// Sign a message using BIP322
365-
#[cfg(feature = "bip322")]
366-
SignMessage(SignMessageCommand),
365+
// #[cfg(feature = "bip322")]
366+
// SignMessage(SignMessageCommand),
367367
/// Verify a BIP322 signature
368-
#[cfg(feature = "bip322")]
369-
VerifyMessage(VerifyMessageCommand),
368+
// #[cfg(feature = "bip322")]
369+
// VerifyMessage(VerifyMessageCommand),
370370
/// Lock UTXO(s) so they're excluded from coin selection.
371371
LockUtxo(LockUtxoCommand),
372372
/// Unlock previously locked UTXO(s).

src/error.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,9 @@ pub enum BDKCliError {
155155
#[cfg(feature = "payjoin")]
156156
#[error("Payjoin database error: {0}")]
157157
PayjoinDb(#[from] crate::handlers::payjoin::db::Error),
158-
159-
#[cfg(feature = "bip322")]
160-
#[error("BIP-322 error: {0}")]
161-
Bip322Error(#[from] bdk_bip322::error::Error),
158+
// #[cfg(feature = "bip322")]
159+
// #[error("BIP-322 error: {0}")]
160+
// Bip322Error(#[from] bdk_bip322::error::Error),
162161
}
163162

164163
impl From<ExtractTxError> for BDKCliError {

src/handlers/dns/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl AsyncAppCommand<AppContext<OfflineOperations<'_>>> for CreateDnsTxCommand {
127127
tx_builder.set_exact_sequence(Sequence::MAX);
128128
}
129129
if self.offline_signer {
130-
tx_builder.include_output_redeem_witness_script();
130+
tx_builder.add_global_xpubs();
131131
}
132132
if let Some(fee_rate) = self.fee_rate
133133
&& let Some(fee_rate) = FeeRate::from_sat_per_vb(fee_rate as u64)

src/handlers/offline.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ use {
2828
bdk_wallet::keys::{DescriptorPublicKey, DescriptorSecretKey, SinglePubKey},
2929
std::collections::HashMap,
3030
};
31-
#[cfg(feature = "bip322")]
32-
use {
33-
crate::utils::parse_signature_format,
34-
crate::utils::types::MessageResult,
35-
bdk_bip322::{BIP322, MessageProof},
36-
};
31+
// #[cfg(feature = "bip322")]
32+
// use {
33+
// crate::utils::parse_signature_format,
34+
// crate::utils::types::MessageResult,
35+
// bdk_bip322::{BIP322, MessageProof},
36+
// };
3737

3838
impl OfflineWalletSubCommand {
3939
pub fn execute(&self, ctx: &mut AppContext<OfflineOperations<'_>>) -> Result<(), Error> {
@@ -73,14 +73,14 @@ impl OfflineWalletSubCommand {
7373
Self::CombinePsbt(combine_psbt_command) => combine_psbt_command
7474
.execute(ctx)?
7575
.write_out(std::io::stdout()),
76-
#[cfg(feature = "bip322")]
77-
Self::SignMessage(sign_message_command) => sign_message_command
78-
.execute(ctx)?
79-
.write_out(std::io::stdout()),
80-
#[cfg(feature = "bip322")]
81-
Self::VerifyMessage(verify_message_command) => verify_message_command
82-
.execute(ctx)?
83-
.write_out(std::io::stdout()),
76+
// #[cfg(feature = "bip322")]
77+
// Self::SignMessage(sign_message_command) => sign_message_command
78+
// .execute(ctx)?
79+
// .write_out(std::io::stdout()),
80+
// #[cfg(feature = "bip322")]
81+
// Self::VerifyMessage(verify_message_command) => verify_message_command
82+
// .execute(ctx)?
83+
// .write_out(std::io::stdout()),
8484
Self::LockUtxo(lock_utxo) => lock_utxo.execute(ctx)?.write_out(std::io::stdout()),
8585
Self::UnlockUtxo(unlock_utxo) => unlock_utxo.execute(ctx)?.write_out(std::io::stdout()),
8686
Self::LockedUtxos(locked_utxos) => {
@@ -773,6 +773,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for CombinePsbtCommand {
773773
}
774774
}
775775

776+
/**
776777
#[cfg(feature = "bip322")]
777778
#[derive(Debug, Parser, Clone, PartialEq)]
778779
pub struct SignMessageCommand {
@@ -860,6 +861,7 @@ impl AppCommand<AppContext<OfflineOperations<'_>>> for VerifyMessageCommand {
860861
})
861862
}
862863
}
864+
**/
863865

864866
#[derive(Parser, Debug, Clone, PartialEq)]
865867
pub struct LockUtxoCommand {

src/utils/common.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{commands::WalletOpts, config::WalletConfig, error::BDKCliError as Error};
2-
#[cfg(feature = "bip322")]
3-
use bdk_bip322::SignatureFormat;
2+
// #[cfg(feature = "bip322")]
3+
// use bdk_bip322::SignatureFormat;
44
#[cfg(feature = "cbf")]
55
use bdk_kyoto::{Info, Receiver, UnboundedReceiver, Warning};
66
#[cfg(feature = "silent-payments")]
@@ -12,7 +12,7 @@ use bdk_wallet::bitcoin::{Address, Network, OutPoint, ScriptBuf};
1212
feature = "cbf",
1313
feature = "rpc"
1414
))]
15-
use bdk_wallet::{bitcoin::Psbt, event::WalletEvent};
15+
use bdk_wallet::{WalletEvent, bitcoin::Psbt};
1616

1717
use crate::commands::OfflineWalletSubCommand;
1818
use std::{
@@ -197,20 +197,20 @@ pub(crate) fn parse_sp_code_value_pairs(s: &str) -> Result<(SilentPaymentCode, u
197197
Ok((key, value))
198198
}
199199

200-
/// Function to parse the signature format from a string
201-
#[cfg(feature = "bip322")]
202-
pub(crate) fn parse_signature_format(format_str: &str) -> Result<SignatureFormat, Error> {
203-
match format_str.to_lowercase().as_str() {
204-
"legacy" => Ok(SignatureFormat::Legacy),
205-
"simple" => Ok(SignatureFormat::Simple),
206-
"full" => Ok(SignatureFormat::Full),
207-
"fullproofoffunds" => Ok(SignatureFormat::FullProofOfFunds),
208-
_ => Err(Error::Generic(
209-
"Invalid signature format. Use 'legacy', 'simple', 'full', or 'fullproofoffunds'"
210-
.to_string(),
211-
)),
212-
}
213-
}
200+
// /// Function to parse the signature format from a string
201+
// #[cfg(feature = "bip322")]
202+
// pub(crate) fn parse_signature_format(format_str: &str) -> Result<SignatureFormat, Error> {
203+
// match format_str.to_lowercase().as_str() {
204+
// "legacy" => Ok(SignatureFormat::Legacy),
205+
// "simple" => Ok(SignatureFormat::Simple),
206+
// "full" => Ok(SignatureFormat::Full),
207+
// "fullproofoffunds" => Ok(SignatureFormat::FullProofOfFunds),
208+
// _ => Err(Error::Generic(
209+
// "Invalid signature format. Use 'legacy', 'simple', 'full', or 'fullproofoffunds'"
210+
// .to_string(),
211+
// )),
212+
// }
213+
// }
214214

215215
pub fn command_requires_db(command: &OfflineWalletSubCommand) -> bool {
216216
match command {
@@ -232,11 +232,11 @@ pub fn command_requires_db(command: &OfflineWalletSubCommand) -> bool {
232232
| OfflineWalletSubCommand::FinalizePsbt(_)
233233
| OfflineWalletSubCommand::CombinePsbt(_) => false,
234234

235-
#[cfg(feature = "bip322")]
236-
OfflineWalletSubCommand::SignMessage(_) => true,
235+
// #[cfg(feature = "bip322")]
236+
// OfflineWalletSubCommand::SignMessage(_) => true,
237237

238-
#[cfg(feature = "bip322")]
239-
OfflineWalletSubCommand::VerifyMessage(_) => true,
238+
// #[cfg(feature = "bip322")]
239+
// OfflineWalletSubCommand::VerifyMessage(_) => true,
240240
#[cfg(feature = "silent-payments")]
241241
OfflineWalletSubCommand::CreateSpTx(_) => true,
242242
#[cfg(feature = "dns_payment")]

src/utils/types.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@ pub struct KeychainPair<T> {
110110
pub internal: T,
111111
}
112112

113-
#[cfg(feature = "bip322")]
114-
#[derive(Serialize, Debug, Default)]
115-
pub struct MessageResult {
116-
#[serde(skip_serializing_if = "Option::is_none")]
117-
pub proof: Option<String>,
118-
119-
#[serde(skip_serializing_if = "Option::is_none")]
120-
pub valid: Option<bool>,
121-
122-
#[serde(skip_serializing_if = "Option::is_none")]
123-
pub proven_amount: Option<u64>,
124-
}
113+
// #[cfg(feature = "bip322")]
114+
// #[derive(Serialize, Debug, Default)]
115+
// pub struct MessageResult {
116+
// #[serde(skip_serializing_if = "Option::is_none")]
117+
// pub proof: Option<String>,
118+
119+
// #[serde(skip_serializing_if = "Option::is_none")]
120+
// pub valid: Option<bool>,
121+
122+
// #[serde(skip_serializing_if = "Option::is_none")]
123+
// pub proven_amount: Option<u64>,
124+
// }
125125

126126
#[derive(Serialize, Debug)]
127127
pub struct StatusResult {

0 commit comments

Comments
 (0)