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, which is derived as:

  1. salted_init_hash = Poseidon2(DOM_SEP__SALTED_INITIALIZATION_HASH, salt, init_hash, deployer_addr)
  2. partial_address = Poseidon2(DOM_SEP__PARTIAL_ADDRESS, class_id, salted_init_hash)
  3. public_keys_hash = Poseidon2(DOM_SEP__PUBLIC_KEYS_HASH, [...public_keys.to_fields()])
  4. preaddress = Poseidon2(DOM_SEP__CONTRACT_ADDRESS_V1, public_keys_hash, partial_address)
  5. preaddress_public_key = preaddress * G1 (Grumpkin scalar multiplication)
  6. 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 31 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_public_keys_hash_poseidon2_0_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_public_keys_hash_poseidon2_2_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_public_keys_hash_poseidon2_4_settings>()
.add<InteractionType::LookupSequential, lookup_address_derivation_preaddress_scalar_mul_settings>()
lookup_settings< lookup_address_derivation_address_ecadd_settings_ > lookup_address_derivation_address_ecadd_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_preaddress_poseidon2_settings_ > lookup_address_derivation_preaddress_poseidon2_settings
lookup_settings< lookup_address_derivation_public_keys_hash_poseidon2_3_settings_ > lookup_address_derivation_public_keys_hash_poseidon2_3_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_1_settings_ > lookup_address_derivation_public_keys_hash_poseidon2_1_settings

Definition at line 18 of file address_derivation_trace.hpp.


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