Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::tracegen::AddressDerivationTraceBuilder Class Referencefinal

#include <address_derivation_trace.hpp>

Public Member Functions

void process (const simulation::EventEmitterInterface< simulation::AddressDerivationEvent >::Container &events, TraceContainer &trace)
 Process address derivation events and populate the relevant columns in the trace. Corresponds to the subtrace address_derivation.pil.
 

Static Public Attributes

static const InteractionDefinition interactions
 

Detailed Description

Definition at line 13 of file address_derivation_trace.hpp.

Member Function Documentation

◆ process()

void bb::avm2::tracegen::AddressDerivationTraceBuilder::process ( const simulation::EventEmitterInterface< simulation::AddressDerivationEvent >::Container &  events,
TraceContainer trace 
)

Process address derivation events and populate the relevant columns in the trace. Corresponds to the subtrace address_derivation.pil.

This trace is non memory-aware and does not handle any errors. It relies on the poseidon2, scalar_mul, and ecc traces to constrain correctness of the address. Only the incoming_viewing_key is held as a Grumpkin point; the other five master public keys are exposed as their hashes (DOM_SEP__SINGLE_PUBLIC_KEY_HASH). The address is derived as:

  1. salted_init_hash = Poseidon2(DOM_SEP__SALTED_INITIALIZATION_HASH, salt, init_hash, deployer_addr, immutables_hash)
  2. partial_address = Poseidon2(DOM_SEP__PARTIAL_ADDRESS, class_id, salted_init_hash)
  3. incoming_viewing_key_hash = Poseidon2(DOM_SEP__SINGLE_PUBLIC_KEY_HASH, ivpk.x, ivpk.y)
  4. public_keys_hash = Poseidon2(DOM_SEP__PUBLIC_KEYS_HASH, npk_hash, ivpk_m_hash, ovpk_hash, tpk_hash, mspk_hash, fbpk_hash)
  5. preaddress = Poseidon2(DOM_SEP__CONTRACT_ADDRESS_V2, public_keys_hash, partial_address)
  6. preaddress_public_key = preaddress * G1 (Grumpkin scalar multiplication)
  7. address = (preaddress_public_key + incoming_viewing_key).x (Grumpkin EC add)
Parameters
eventsThe container of address derivation events to process.
traceThe trace container.

Definition at line 36 of file address_derivation_trace.cpp.

Member Data Documentation

◆ interactions

const InteractionDefinition bb::avm2::tracegen::AddressDerivationTraceBuilder::interactions
static
Initial value:
=
InteractionDefinition()
.add<InteractionType::LookupSequential, lookup_address_derivation_ivpk_m_hash_poseidon2_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_public_keys_hash_poseidon2_1_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_preaddress_poseidon2_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_address_ecadd_settings>()
lookup_settings< lookup_address_derivation_preaddress_scalar_mul_settings_ > lookup_address_derivation_preaddress_scalar_mul_settings
lookup_settings< lookup_address_derivation_partial_address_poseidon2_settings_ > lookup_address_derivation_partial_address_poseidon2_settings
lookup_settings< lookup_address_derivation_salted_initialization_hash_poseidon2_1_settings_ > lookup_address_derivation_salted_initialization_hash_poseidon2_1_settings
lookup_settings< lookup_address_derivation_salted_initialization_hash_poseidon2_0_settings_ > lookup_address_derivation_salted_initialization_hash_poseidon2_0_settings
lookup_settings< lookup_address_derivation_public_keys_hash_poseidon2_2_settings_ > lookup_address_derivation_public_keys_hash_poseidon2_2_settings
lookup_settings< lookup_address_derivation_public_keys_hash_poseidon2_0_settings_ > lookup_address_derivation_public_keys_hash_poseidon2_0_settings

Definition at line 18 of file address_derivation_trace.hpp.


The documentation for this class was generated from the following files: