@@ -11,7 +11,7 @@ mod utils;
1111use crate :: cli:: utils:: { append_new_entry, burn_file, coins_file, init_coins_file, next_id} ;
1212use crate :: constants:: poseidon_burn_address_prefix;
1313use crate :: fp:: Fp ;
14- use crate :: utils:: { RapidsnarkOutput , build_and_prove_burn_logic} ;
14+ use crate :: utils:: { RapidsnarkOutput , build_and_prove_burn_logic, generate_burn_extra_commit } ;
1515use crate :: utils:: {
1616 compute_nullifier, compute_previous_coin, compute_remaining_coin, fetch_block_and_header_bytes,
1717 find_burn_key, generate_burn_address, get_account_proof,
@@ -208,7 +208,7 @@ impl CommonOpt {
208208 amount : U256 ,
209209 fee : U256 ,
210210 spend : U256 ,
211- ) -> Result < ( Fp , Address , Fp , U256 , Fp , U256 ) > {
211+ ) -> Result < ( Fp , Address , Fp , U256 , Fp , U256 , U256 ) > {
212212 let rt = self . setup ( ) . await ?;
213213
214214 if fee + spend > amount {
@@ -222,7 +222,8 @@ impl CommonOpt {
222222
223223 // 1) burn_key
224224 println ! ( "Generating a burn-key..." ) ;
225- let burn_key = find_burn_key ( 2 , rt. wallet_address , U256 :: ZERO , fee, spend) ;
225+ let extra_commit = generate_burn_extra_commit ( rt. wallet_address , U256 :: ZERO , fee) ;
226+ let burn_key = find_burn_key ( 2 , extra_commit, spend) ;
226227 println ! ( "Your burn_key: {:?}" , burn_key) ;
227228 println ! (
228229 "Your burn-key as string: {}" ,
@@ -231,7 +232,7 @@ impl CommonOpt {
231232
232233 // 2) burn address
233234 let burn_addr_prefix = poseidon_burn_address_prefix ( ) ;
234- let burn_addr = generate_burn_address (
235+ let ( burn_addr, burn_extra_commit ) = generate_burn_address (
235236 burn_addr_prefix,
236237 burn_key,
237238 rt. wallet_address ,
@@ -254,6 +255,7 @@ impl CommonOpt {
254255 nullifier_u256,
255256 remaining_coin_val_fp,
256257 remaining_coin_u256,
258+ burn_extra_commit,
257259 ) )
258260 }
259261
@@ -266,7 +268,7 @@ impl CommonOpt {
266268 let rt = self . setup ( ) . await ?; // wallet addr + provider + network
267269 let burn_addr_prefix = crate :: constants:: poseidon_burn_address_prefix ( ) ;
268270
269- let burn_addr = crate :: utils:: generate_burn_address (
271+ let ( burn_addr, _burn_extra_commit ) = crate :: utils:: generate_burn_address (
270272 burn_addr_prefix,
271273 burn_key,
272274 rt. wallet_address ,
@@ -318,8 +320,8 @@ impl CommonOpt {
318320 params_dir : & Path ,
319321 burn_addr : Address ,
320322 burn_key : Fp ,
321- fee : U256 ,
322323 spend : U256 ,
324+ burn_extra_commit : U256 ,
323325 input_json_path : & str ,
324326 witness_path : & str ,
325327 ) -> Result < ( RapidsnarkOutput , u64 , PathBuf ) > {
@@ -331,9 +333,8 @@ impl CommonOpt {
331333 params_dir,
332334 header_bytes,
333335 burn_key,
334- fee,
335336 spend,
336- rt . wallet_address ,
337+ burn_extra_commit ,
337338 rt. wallet_address ,
338339 input_json_path,
339340 witness_path,
0 commit comments