@@ -163,6 +163,11 @@ const PSBT_ELEMENTS_IN_EXPLICIT_ASSET: u8 = 0x13;
163
163
/// the explicit asset in PSBT_ELEMENTS_IN_EXPLICIT_ASSET. If provided,
164
164
/// PSBT_ELEMENTS_IN_EXPLICIT_ASSET must be provided too.
165
165
const PSBT_ELEMENTS_IN_ASSET_PROOF : u8 = 0x14 ;
166
+ /// A boolean flag. 0x00 indicates the issuance should not be blinded,
167
+ /// 0x01 indicates it should be. If not specified, assumed to be 0x01.
168
+ /// Note that this does not indicate actual blinding status,
169
+ /// but rather the expected blinding status prior to signing.
170
+ const PSBT_ELEMENTS_IN_BLINDED_ISSUANCE : u8 = 0x15 ;
166
171
/// A key-value map for an input of the corresponding index in the unsigned
167
172
/// transaction.
168
173
#[ derive( Clone , Debug , PartialEq ) ]
@@ -294,6 +299,8 @@ pub struct Input {
294
299
pub asset : Option < AssetId > ,
295
300
/// The blind asset surjection proof
296
301
pub blind_asset_proof : Option < Box < SurjectionProof > > ,
302
+ /// Whether the issuance is blinded
303
+ pub blinded_issuance : Option < u8 > ,
297
304
/// Other fields
298
305
#[ cfg_attr(
299
306
feature = "serde" ,
@@ -310,7 +317,7 @@ pub struct Input {
310
317
311
318
impl Default for Input {
312
319
fn default ( ) -> Self {
313
- Self { non_witness_utxo : Default :: default ( ) , witness_utxo : Default :: default ( ) , partial_sigs : Default :: default ( ) , sighash_type : Default :: default ( ) , redeem_script : Default :: default ( ) , witness_script : Default :: default ( ) , bip32_derivation : Default :: default ( ) , final_script_sig : Default :: default ( ) , final_script_witness : Default :: default ( ) , ripemd160_preimages : Default :: default ( ) , sha256_preimages : Default :: default ( ) , hash160_preimages : Default :: default ( ) , hash256_preimages : Default :: default ( ) , previous_txid : Txid :: all_zeros ( ) , previous_output_index : Default :: default ( ) , sequence : Default :: default ( ) , required_time_locktime : Default :: default ( ) , required_height_locktime : Default :: default ( ) , tap_key_sig : Default :: default ( ) , tap_script_sigs : Default :: default ( ) , tap_scripts : Default :: default ( ) , tap_key_origins : Default :: default ( ) , tap_internal_key : Default :: default ( ) , tap_merkle_root : Default :: default ( ) , issuance_value_amount : Default :: default ( ) , issuance_value_comm : Default :: default ( ) , issuance_value_rangeproof : Default :: default ( ) , issuance_keys_rangeproof : Default :: default ( ) , pegin_tx : Default :: default ( ) , pegin_txout_proof : Default :: default ( ) , pegin_genesis_hash : Default :: default ( ) , pegin_claim_script : Default :: default ( ) , pegin_value : Default :: default ( ) , pegin_witness : Default :: default ( ) , issuance_inflation_keys : Default :: default ( ) , issuance_inflation_keys_comm : Default :: default ( ) , issuance_blinding_nonce : Default :: default ( ) , issuance_asset_entropy : Default :: default ( ) , in_utxo_rangeproof : Default :: default ( ) , in_issuance_blind_value_proof : Default :: default ( ) , in_issuance_blind_inflation_keys_proof : Default :: default ( ) , amount : Default :: default ( ) , blind_value_proof : Default :: default ( ) , asset : Default :: default ( ) , blind_asset_proof : Default :: default ( ) , proprietary : Default :: default ( ) , unknown : Default :: default ( ) }
320
+ Self { non_witness_utxo : Default :: default ( ) , witness_utxo : Default :: default ( ) , partial_sigs : Default :: default ( ) , sighash_type : Default :: default ( ) , redeem_script : Default :: default ( ) , witness_script : Default :: default ( ) , bip32_derivation : Default :: default ( ) , final_script_sig : Default :: default ( ) , final_script_witness : Default :: default ( ) , ripemd160_preimages : Default :: default ( ) , sha256_preimages : Default :: default ( ) , hash160_preimages : Default :: default ( ) , hash256_preimages : Default :: default ( ) , previous_txid : Txid :: all_zeros ( ) , previous_output_index : Default :: default ( ) , sequence : Default :: default ( ) , required_time_locktime : Default :: default ( ) , required_height_locktime : Default :: default ( ) , tap_key_sig : Default :: default ( ) , tap_script_sigs : Default :: default ( ) , tap_scripts : Default :: default ( ) , tap_key_origins : Default :: default ( ) , tap_internal_key : Default :: default ( ) , tap_merkle_root : Default :: default ( ) , issuance_value_amount : Default :: default ( ) , issuance_value_comm : Default :: default ( ) , issuance_value_rangeproof : Default :: default ( ) , issuance_keys_rangeproof : Default :: default ( ) , pegin_tx : Default :: default ( ) , pegin_txout_proof : Default :: default ( ) , pegin_genesis_hash : Default :: default ( ) , pegin_claim_script : Default :: default ( ) , pegin_value : Default :: default ( ) , pegin_witness : Default :: default ( ) , issuance_inflation_keys : Default :: default ( ) , issuance_inflation_keys_comm : Default :: default ( ) , issuance_blinding_nonce : Default :: default ( ) , issuance_asset_entropy : Default :: default ( ) , in_utxo_rangeproof : Default :: default ( ) , in_issuance_blind_value_proof : Default :: default ( ) , in_issuance_blind_inflation_keys_proof : Default :: default ( ) , amount : Default :: default ( ) , blind_value_proof : Default :: default ( ) , asset : Default :: default ( ) , blind_asset_proof : Default :: default ( ) , blinded_issuance : Default :: default ( ) , proprietary : Default :: default ( ) , unknown : Default :: default ( ) }
314
321
}
315
322
}
316
323
@@ -740,6 +747,9 @@ impl Map for Input {
740
747
PSBT_ELEMENTS_IN_ASSET_PROOF => {
741
748
impl_pset_prop_insert_pair ! ( self . blind_asset_proof <= <raw_key: _> | <raw_value : Box <SurjectionProof >>)
742
749
}
750
+ PSBT_ELEMENTS_IN_BLINDED_ISSUANCE => {
751
+ impl_pset_prop_insert_pair ! ( self . blinded_issuance <= <raw_key: _> | <raw_value : u8 >)
752
+ }
743
753
_ => match self . proprietary . entry ( prop_key) {
744
754
Entry :: Vacant ( empty_key) => {
745
755
empty_key. insert ( raw_value) ;
@@ -954,6 +964,10 @@ impl Map for Input {
954
964
rv. push_prop( self . blind_asset_proof as <PSBT_ELEMENTS_IN_ASSET_PROOF , _>)
955
965
}
956
966
967
+ impl_pset_get_pair ! {
968
+ rv. push_prop( self . blinded_issuance as <PSBT_ELEMENTS_IN_BLINDED_ISSUANCE , _>)
969
+ }
970
+
957
971
for ( key, value) in self . proprietary . iter ( ) {
958
972
rv. push ( raw:: Pair {
959
973
key : key. to_key ( ) ,
@@ -1028,6 +1042,11 @@ impl Map for Input {
1028
1042
merge ! ( in_utxo_rangeproof, self , other) ;
1029
1043
merge ! ( in_issuance_blind_value_proof, self , other) ;
1030
1044
merge ! ( in_issuance_blind_inflation_keys_proof, self , other) ;
1045
+ merge ! ( amount, self , other) ;
1046
+ merge ! ( blind_value_proof, self , other) ;
1047
+ merge ! ( asset, self , other) ;
1048
+ merge ! ( blind_asset_proof, self , other) ;
1049
+ merge ! ( blinded_issuance, self , other) ;
1031
1050
Ok ( ( ) )
1032
1051
}
1033
1052
}
0 commit comments