11// SPDX-License-Identifier: CC0-1.0
22
3- //! The JSON-RPC API for Bitcoin Core `v23 ` - raw transactions.
3+ //! The JSON-RPC API for Bitcoin Core `v30 ` - raw transactions.
44//!
55//! Types for methods found under the `== Rawtransactions ==` section of the API docs.
66
@@ -78,6 +78,8 @@ pub struct Proprietary {
7878}
7979
8080/// An input in a partially signed Bitcoin transaction. Part of `decodepsbt`.
81+ ///
82+ /// TODO: Update model once Musig is supported in rust-bitcoin.
8183#[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
8284#[ cfg_attr( feature = "serde-deny-unknown-fields" , serde( deny_unknown_fields) ) ]
8385pub struct PsbtInput {
@@ -121,6 +123,12 @@ pub struct PsbtInput {
121123 pub taproot_internal_key : Option < String > ,
122124 /// The hex-encoded Taproot merkle root.
123125 pub taproot_merkle_root : Option < String > ,
126+ /// MuSig2 participant public keys.
127+ pub musig2_participant_pubkeys : Option < Vec < Musig2ParticipantPubkeys > > ,
128+ /// MuSig2 public nonces.
129+ pub musig2_pubnonces : Option < Vec < Musig2Pubnonce > > ,
130+ /// MuSig2 partial signatures.
131+ pub musig2_partial_sigs : Option < Vec < Musig2PartialSig > > ,
124132 /// The input proprietary map.
125133 pub proprietary : Option < Vec < Proprietary > > ,
126134 /// The unknown input fields.
@@ -143,6 +151,8 @@ pub struct PsbtOutput {
143151 pub taproot_tree : Option < Vec < TaprootLeaf > > ,
144152 /// BIP32 derivation paths for keys.
145153 pub taproot_bip32_derivs : Option < Vec < TaprootBip32Deriv > > ,
154+ /// MuSig2 participant public keys.
155+ pub musig2_participant_pubkeys : Option < Vec < Musig2ParticipantPubkeys > > ,
146156 /// The output proprietary map.
147157 pub proprietary : Option < Vec < Proprietary > > ,
148158 /// The unknown global fields.
@@ -201,6 +211,44 @@ pub struct TaprootLeaf {
201211 pub script : String ,
202212}
203213
214+ /// MuSig2 participant public keys. Part of `decodepsbt`.
215+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
216+ #[ cfg_attr( feature = "serde-deny-unknown-fields" , serde( deny_unknown_fields) ) ]
217+ pub struct Musig2ParticipantPubkeys {
218+ /// The compressed aggregate public key for which the participants create.
219+ pub aggregate_pubkey : String ,
220+ /// The compressed public keys that are aggregated for aggregate_pubkey.
221+ pub participant_pubkeys : Vec < String > ,
222+ }
223+
224+ /// MuSig2 public nonce. Part of `decodepsbt`.
225+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
226+ #[ cfg_attr( feature = "serde-deny-unknown-fields" , serde( deny_unknown_fields) ) ]
227+ pub struct Musig2Pubnonce {
228+ /// The compressed public key of the participant that created this pubnonce.
229+ pub participant_pubkey : String ,
230+ /// The compressed aggregate public key for which this pubnonce is for.
231+ pub aggregate_pubkey : String ,
232+ /// The hash of the leaf script that contains the aggregate pubkey being signed for. Omitted when signing for the internal key.
233+ pub leaf_hash : Option < String > ,
234+ /// The public nonce itself.
235+ pub pubnonce : String ,
236+ }
237+
238+ /// MuSig2 partial signature. Part of `decodepsbt`.
239+ #[ derive( Clone , Debug , PartialEq , Deserialize , Serialize ) ]
240+ #[ cfg_attr( feature = "serde-deny-unknown-fields" , serde( deny_unknown_fields) ) ]
241+ pub struct Musig2PartialSig {
242+ /// The compressed public key of the participant that created this partial signature.
243+ pub participant_pubkey : String ,
244+ /// The compressed aggregate public key for which this partial signature is for.
245+ pub aggregate_pubkey : String ,
246+ /// The hash of the leaf script that contains the aggregate pubkey being signed for. Omitted when signing for the internal key.
247+ pub leaf_hash : Option < String > ,
248+ /// The partial signature itself.
249+ pub partial_sig : String ,
250+ }
251+
204252// TODO: Remove all this code once it is implemented and backported to 0.32.x
205253// https://github.com/rust-bitcoin/rust-bitcoin/issues/3285
206254pub mod taproot {
0 commit comments