Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

smart_identity_proofs

Reusable Cairo proof primitives and conventions for attestations.

Fully qualified path: smart_identity_proofs

Modules

adapterssmartWage adapter functions that map app-specific field names to generic modules.
conventionsShared conventions for proof interfaces.
employmentGeneric employment-proof primitives.
identityGeneric identity and membership proof primitives.
incomeGeneric income-proof primitives.
employer_membership_proof
employment_duration_proof
maximum_income_proof
minimum_income_proof
salary_range_proof

Modules

Modules

adapterssmartWage adapter functions that map app-specific field names to generic modules.
conventionsShared conventions for proof interfaces.
employmentGeneric employment-proof primitives.
identityGeneric identity and membership proof primitives.
incomeGeneric income-proof primitives.
employer_membership_proof
employment_duration_proof
maximum_income_proof
minimum_income_proof
salary_range_proof

adapters

smartWage adapter functions that map app-specific field names to generic modules.

Fully qualified path: smart_identity_proofs::adapters

Free functions

assert_smartwage_wage_commitmentMaps smartWage wage commitment field names to the generic income commitment check.
assert_smartwage_income_minimumMaps smartWage minimum-income field names to the generic lower-bound assertion.
assert_smartwage_income_maximumMaps smartWage maximum-income field names to the generic upper-bound assertion.
assert_smartwage_income_rangeMaps smartWage range fields to the generic inclusive income range assertion.
assert_smartwage_employment_durationMaps smartWage employment timeline fields to the generic duration+gap assertion.
assert_smartwage_employer_membershipMaps smartWage employer membership context fields to the generic identity assertion.

Free functions

Free functions

assert_smartwage_wage_commitmentMaps smartWage wage commitment field names to the generic income commitment check.
assert_smartwage_income_minimumMaps smartWage minimum-income field names to the generic lower-bound assertion.
assert_smartwage_income_maximumMaps smartWage maximum-income field names to the generic upper-bound assertion.
assert_smartwage_income_rangeMaps smartWage range fields to the generic inclusive income range assertion.
assert_smartwage_employment_durationMaps smartWage employment timeline fields to the generic duration+gap assertion.
assert_smartwage_employer_membershipMaps smartWage employer membership context fields to the generic identity assertion.

assert_smartwage_wage_commitment

Maps smartWage wage commitment field names to the generic income commitment check.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_wage_commitment

pub fn assert_smartwage_wage_commitment(
    wage_low: u128, wage_high: u128, salt: felt252, wage_commitment: felt252,
)

assert_smartwage_income_minimum

Maps smartWage minimum-income field names to the generic lower-bound assertion.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_income_minimum

pub fn assert_smartwage_income_minimum(
    wage_low: u128, wage_high: u128, min_income_low: u128, min_income_high: u128,
)

assert_smartwage_income_maximum

Maps smartWage maximum-income field names to the generic upper-bound assertion.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_income_maximum

pub fn assert_smartwage_income_maximum(
    wage_low: u128, wage_high: u128, max_income_low: u128, max_income_high: u128,
)

assert_smartwage_income_range

Maps smartWage range fields to the generic inclusive income range assertion.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_income_range

pub fn assert_smartwage_income_range(
    wage_low: u128,
    wage_high: u128,
    min_income_low: u128,
    min_income_high: u128,
    max_income_low: u128,
    max_income_high: u128,
)

assert_smartwage_employment_duration

Maps smartWage employment timeline fields to the generic duration+gap assertion.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_employment_duration

pub fn assert_smartwage_employment_duration(
    active: bool,
    activated_at: u64,
    last_paid: u64,
    pay_frequency: u64,
    current_time: u64,
    min_duration_seconds: u64,
    max_gap_seconds: u64,
)

assert_smartwage_employer_membership

Maps smartWage employer membership context fields to the generic identity assertion.

Fully qualified path: smart_identity_proofs::adapters::assert_smartwage_employer_membership

pub fn assert_smartwage_employer_membership(
    employer_contract: felt252,
    expected_employer_contract: felt252,
    employee_address: felt252,
    expected_employee_address: felt252,
    active: bool,
    start_year: u32,
    start_month: u8,
    start_day: u8,
    start_date_commitment: felt252,
)

conventions

Shared conventions for proof interfaces.

Fully qualified path: smart_identity_proofs::conventions

Constants

INTERFACE_VERSIONStable interface identifier for the reusable package.
NAMESPACE_INCOMEDomain namespace markers reserved for long-term extensibility.
NAMESPACE_EMPLOYMENT
NAMESPACE_IDENTITY
NAMESPACE_ELIGIBILITY

Constants

Constants

INTERFACE_VERSIONStable interface identifier for the reusable package.
NAMESPACE_INCOMEDomain namespace markers reserved for long-term extensibility.
NAMESPACE_EMPLOYMENT
NAMESPACE_IDENTITY
NAMESPACE_ELIGIBILITY

INTERFACE_VERSION

Stable interface identifier for the reusable package.

Fully qualified path: smart_identity_proofs::conventions::INTERFACE_VERSION

pub const INTERFACE_VERSION: felt252 = 30257;

NAMESPACE_INCOME

Domain namespace markers reserved for long-term extensibility.

Fully qualified path: smart_identity_proofs::conventions::NAMESPACE_INCOME

pub const NAMESPACE_INCOME: felt252 = 115922835565925;

NAMESPACE_EMPLOYMENT

Fully qualified path: smart_identity_proofs::conventions::NAMESPACE_EMPLOYMENT

pub const NAMESPACE_EMPLOYMENT: felt252 = 478977810846265557479028;

NAMESPACE_IDENTITY

Fully qualified path: smart_identity_proofs::conventions::NAMESPACE_IDENTITY

pub const NAMESPACE_IDENTITY: felt252 = 7594306396727374969;

NAMESPACE_ELIGIBILITY

Fully qualified path: smart_identity_proofs::conventions::NAMESPACE_ELIGIBILITY

pub const NAMESPACE_ELIGIBILITY: felt252 = 122613467720950471222457465;

employment

Generic employment-proof primitives.

Fully qualified path: smart_identity_proofs::employment

Free functions

Free functions

Free functions

assert_active_employment

Fully qualified path: smart_identity_proofs::employment::assert_active_employment

pub fn assert_active_employment(active: bool)

assert_employment_duration_and_gap

Fully qualified path: smart_identity_proofs::employment::assert_employment_duration_and_gap

pub fn assert_employment_duration_and_gap(
    active: bool,
    activated_at: u64,
    last_paid: u64,
    pay_frequency: u64,
    current_time: u64,
    min_duration_seconds: u64,
    max_gap_seconds: u64,
)

identity

Generic identity and membership proof primitives.

Fully qualified path: smart_identity_proofs::identity

Free functions

start_date_commitmentComputes the canonical start-date commitment as: poseidon_hash_span([start_year, start_month, start_day]) . External systems must hash fields in this exact order to match proofs.
assert_employer_membership

Free functions

Free functions

start_date_commitmentComputes the canonical start-date commitment as: poseidon_hash_span([start_year, start_month, start_day]) . External systems must hash fields in this exact order to match proofs.
assert_employer_membership

start_date_commitment

Computes the canonical start-date commitment as: poseidon_hash_span([start_year, start_month, start_day]).

External systems must hash fields in this exact order to match proofs.

Fully qualified path: smart_identity_proofs::identity::start_date_commitment

pub fn start_date_commitment(start_year: u32, start_month: u8, start_day: u8) -> felt252

assert_employer_membership

Fully qualified path: smart_identity_proofs::identity::assert_employer_membership

pub fn assert_employer_membership(
    employer_contract: felt252,
    expected_employer_contract: felt252,
    employee_address: felt252,
    expected_employee_address: felt252,
    active: bool,
    start_year: u32,
    start_month: u8,
    start_day: u8,
    expected_start_date_commitment: felt252,
)

income

Generic income-proof primitives.

Fully qualified path: smart_identity_proofs::income

Free functions

wage_commitment
assert_wage_commitment
assert_min_income
assert_max_income
assert_income_rangeAsserts an inclusive income range and validates min_income <= max_income .

Free functions

Free functions

wage_commitment
assert_wage_commitment
assert_min_income
assert_max_income
assert_income_rangeAsserts an inclusive income range and validates min_income <= max_income .

wage_commitment

Fully qualified path: smart_identity_proofs::income::wage_commitment

pub fn wage_commitment(wage_low: u128, wage_high: u128, salt: felt252) -> felt252

assert_wage_commitment

Fully qualified path: smart_identity_proofs::income::assert_wage_commitment

pub fn assert_wage_commitment(
    wage_low: u128, wage_high: u128, salt: felt252, expected_commitment: felt252,
)

assert_min_income

Fully qualified path: smart_identity_proofs::income::assert_min_income

pub fn assert_min_income(wage: u256, min_income: u256)

assert_max_income

Fully qualified path: smart_identity_proofs::income::assert_max_income

pub fn assert_max_income(wage: u256, max_income: u256)

assert_income_range

Asserts an inclusive income range and validates min_income <= max_income.

Fully qualified path: smart_identity_proofs::income::assert_income_range

pub fn assert_income_range(wage: u256, min_income: u256, max_income: u256)

employer_membership_proof

Example: Employer Membership Proof

This executable demonstrates the stable v1 interface for proving:

  1. The proof targets the expected employer contract.
  2. The proof targets the expected employee address.
  3. Employment is active.
  4. The start-date commitment is consistent with provided date fields.

Fully qualified path: smart_identity_proofs::employer_membership_proof

employment_duration_proof

Example: Employment Duration Proof

This executable demonstrates the stable v1 interface for proving:

  1. Active employment status.
  2. Minimum active tenure.
  3. Bounded latest payment gap.

Public inputs: all fields except those your application decides to keep private. In smartWage these values are anchored to getEmploymentProofContext().

Fully qualified path: smart_identity_proofs::employment_duration_proof

maximum_income_proof

Example: Maximum Income Proof

This executable demonstrates the stable v1 interface for proving:

  1. The prover knows a wage matching the public commitment.
  2. That wage is at or below a public threshold.

Public inputs: max_income_low, max_income_high, wage_commitment Private inputs: wage_low, wage_high, salt

Fully qualified path: smart_identity_proofs::maximum_income_proof

minimum_income_proof

Example: Minimum Income Proof

This executable demonstrates the stable v1 interface for proving:

  1. The prover knows a wage matching the public commitment.
  2. That wage is at or above a public threshold.

Public inputs: min_income_low, min_income_high, wage_commitment Private inputs: wage_low, wage_high, salt

Fully qualified path: smart_identity_proofs::minimum_income_proof

salary_range_proof

Example: Salary Range Proof

This executable demonstrates the stable v1 interface for proving:

  1. The prover knows a wage matching the public commitment.
  2. That wage lies within the public min, max range.

Public inputs: min_income_*, max_income_*, wage_commitment Private inputs: wage_low, wage_high, salt

Fully qualified path: smart_identity_proofs::salary_range_proof