@@ -163,6 +163,11 @@ const PSBT_ELEMENTS_IN_EXPLICIT_ASSET: u8 = 0x13;
163163/// the explicit asset in PSBT_ELEMENTS_IN_EXPLICIT_ASSET. If provided,
164164/// PSBT_ELEMENTS_IN_EXPLICIT_ASSET must be provided too.
165165const 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 ;
166171/// A key-value map for an input of the corresponding index in the unsigned
167172/// transaction.
168173#[ derive( Clone , Debug , PartialEq ) ]
@@ -294,6 +299,8 @@ pub struct Input {
294299 pub asset : Option < AssetId > ,
295300 /// The blind asset surjection proof
296301 pub blind_asset_proof : Option < Box < SurjectionProof > > ,
302+ /// Whether the issuance is blinded
303+ pub blinded_issuance : Option < u8 > ,
297304 /// Other fields
298305 #[ cfg_attr(
299306 feature = "serde" ,
@@ -310,7 +317,7 @@ pub struct Input {
310317
311318impl Default for Input {
312319 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 ( ) }
314321 }
315322}
316323
@@ -740,6 +747,9 @@ impl Map for Input {
740747 PSBT_ELEMENTS_IN_ASSET_PROOF => {
741748 impl_pset_prop_insert_pair ! ( self . blind_asset_proof <= <raw_key: _> | <raw_value : Box <SurjectionProof >>)
742749 }
750+ PSBT_ELEMENTS_IN_BLINDED_ISSUANCE => {
751+ impl_pset_prop_insert_pair ! ( self . blinded_issuance <= <raw_key: _> | <raw_value : u8 >)
752+ }
743753 _ => match self . proprietary . entry ( prop_key) {
744754 Entry :: Vacant ( empty_key) => {
745755 empty_key. insert ( raw_value) ;
@@ -954,6 +964,10 @@ impl Map for Input {
954964 rv. push_prop( self . blind_asset_proof as <PSBT_ELEMENTS_IN_ASSET_PROOF , _>)
955965 }
956966
967+ impl_pset_get_pair ! {
968+ rv. push_prop( self . blinded_issuance as <PSBT_ELEMENTS_IN_BLINDED_ISSUANCE , _>)
969+ }
970+
957971 for ( key, value) in self . proprietary . iter ( ) {
958972 rv. push ( raw:: Pair {
959973 key : key. to_key ( ) ,
@@ -1028,6 +1042,11 @@ impl Map for Input {
10281042 merge ! ( in_utxo_rangeproof, self , other) ;
10291043 merge ! ( in_issuance_blind_value_proof, self , other) ;
10301044 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) ;
10311050 Ok ( ( ) )
10321051 }
10331052}
0 commit comments