Skip to content

Commit 7b94ecc

Browse files
committed
bip322: update proof handling for new bdk-bip322 API
1 parent c529100 commit 7b94ecc

File tree

7 files changed

+112
-269
lines changed

7 files changed

+112
-269
lines changed

Cargo.lock

Lines changed: 9 additions & 35 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ shlex = { version = "1.3.0", optional = true }
3636
payjoin = { version = "1.0.0-rc.1", features = ["v1", "v2", "io", "_test-utils"], optional = true}
3737
reqwest = { version = "0.12.23", default-features = false, optional = true }
3838
url = { version = "2.5.4", optional = true }
39+
bdk-bip322 = { git = "https://github.com/aagbotemi/bdk-bip322.git", branch = "master", optional = true }
3940

4041
[features]
4142
default = ["repl", "sqlite"]
42-
bip322 = ["dep:bdk-bip322"]
4343

4444
# To use the app in a REPL mode
4545
repl = ["shlex"]
@@ -56,6 +56,7 @@ rpc = ["bdk_bitcoind_rpc", "_payjoin-dependencies"]
5656

5757
# Internal features
5858
_payjoin-dependencies = ["payjoin", "reqwest", "url"]
59+
bip322 = ["bdk-bip322"]
5960

6061
# Use this to consensus verify transactions at sync time
6162
verify = []

bip322_usage.md

Lines changed: 0 additions & 143 deletions
This file was deleted.

src/commands.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,37 @@ pub enum OfflineWalletSubCommand {
405405
#[arg(env = "BASE64_PSBT", required = true)]
406406
psbt: Vec<String>,
407407
},
408+
/// Sign a message using BIP322
409+
#[cfg(feature = "bip322")]
410+
SignBip322 {
411+
/// The message to sign
412+
#[arg(long)]
413+
message: String,
414+
/// The signature format (e.g., Legacy, Simple, Full)
415+
#[arg(long, default_value = "simple")]
416+
signature_type: String,
417+
/// Address to sign
418+
#[arg(long)]
419+
address: String,
420+
// Optional list of specific UTXOs for proof-of-funds (only for `FullWithProofOfFunds`) #[arg(long)]
421+
utxos: Option<Vec<OutPoint>>,
422+
},
423+
/// Verify a BIP322 signature
424+
#[cfg(feature = "bip322")]
425+
VerifyBip322 {
426+
/// The signature proof to verify
427+
#[arg(long)]
428+
proof: String,
429+
/// The message that was signed
430+
#[arg(long)]
431+
message: String,
432+
/// The signature format (e.g., Legacy, Simple, Full)
433+
#[arg(long, default_value = "simple")]
434+
signature_type: String,
435+
/// The address associated with the signature
436+
#[arg(long)]
437+
address: String,
438+
},
408439
}
409440

410441
/// Wallet subcommands that needs a blockchain backend.

src/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,10 @@ impl From<ExtractTxError> for BDKCliError {
119119
BDKCliError::PsbtExtractTxError(Box::new(value))
120120
}
121121
}
122+
123+
#[cfg(feature = "bip322")]
124+
impl From<bdk_bip322::error::Error> for BDKCliError {
125+
fn from(e: bdk_bip322::error::Error) -> Self {
126+
BDKCliError::Generic(e.to_string())
127+
}
128+
}

0 commit comments

Comments
 (0)