multi: add BIP-322 support#2517
Conversation
84e9099 to
79a96b0
Compare
|
CI fails with |
|
I fixed that and works well. Also more tests added |
|
Following the BIP-322 signing implementation in #2521 — this PR adds BIP-322 support to the RPC server layer. One question on the architecture: #2521 implements bip322 as a btcutil submodule with Sign/Verify at the library level, while this PR adds RPC server methods. Are these two efforts coordinated — i.e., does this PR use the btcutil/bip322 module from #2521, or implement signing independently? From a btcpay-mcp integration standpoint, having BIP-322 signing available both as a library call (btcutil/bip322 Sign/Verify) and as an RPC (signmessagewithprivkey BIP-322 mode) would give us two useful abstractions. Library-level for agentic challenge-response auth (SEP-1686 flow), RPC-level for wallet-style message signing. Curious whether the RPC server approach here and the library approach in #2521 are meant to complement each other or if this PR subsumes the library work. |
|
This PR is independent of #2521, adds the same implementation, but the two PRs are not related. |
|
It seems that other PR is going on merge, so I'm gonna close this. |
Change Description
Implements BIP-322.
Closes #2077
Details
btcdutil/message: extract legacy message signing (BIP-137) into reusable packagebtcutil/bip322: BIP-322 implementation supporting P2WPKH, P2TR, P2SH-P2WPKH, P2PKH (sign + verify) and P2WSH (verify only)btcjson: add optionaladdressparameter toSignMessageWithPrivKeyrpcserver:SignMessageWithPrivKeysupports BIP-322 signing when address is provided;verifymessagetries legacy first, then BIP-322Steps to Test
Pull Request Checklist
Testing
Code Style and Documentation
📝 Please see our Contribution Guidelines for further guidance.