Skip to content

Lookups can take array values - #3

Merged
kmerrill18 merged 3 commits into
masterfrom
value-in-array-tuple
Feb 9, 2026
Merged

Lookups can take array values#3
kmerrill18 merged 3 commits into
masterfrom
value-in-array-tuple

Conversation

@kmerrill18

Copy link
Copy Markdown
Collaborator

Create a version of value_in_array that works with arrays so we can do lookups of tuples. This implementation "hashes" (computes a random linear combination based on a verifier challenge) each array element into one field element, and then it hooks into the regular Habock lookup infrastructure.

@kmerrill18
kmerrill18 marked this pull request as draft February 6, 2026 14:21
@kmerrill18

Copy link
Copy Markdown
CollaboratorAuthor

Constraint count comes out to (k - 2) + Ak + N:

  • (k -2): compute k powers of the random challenge. The 0th and 1st power are given, so no constraints needed there, hence the -2.
  • A(k - 1): the random linear combo of the tuple/array to lookup (the "hash"). (k - 1) constraints because the first value is multiplied by the challenge the 0th power, which is not actually a multiplication.
  • A: regular inverse check per lookup with standard Habock lookup infrastructure
  • N: regular table setup with standard Habock lookup infrastructure

So in total: (k - 2) + A(k - 1) + A + N = (k - 2) + Ak + N.

The (k - 2) term is perhaps unnecessary. Theoretically, the challenge is public, so the prover does not need to prove that it computed those powers correctly. However, circ puts this on the prover side instead of the verifier side. In practice, for our applications, N >> (k - 2), so this term should not matter, and I think it is fine to leave as-is.

@kmerrill18
kmerrill18 marked this pull request as ready for review February 6, 2026 17:42
@kmerrill18
kmerrill18 merged commit b0a2d1b into masterFeb 9, 2026
@kmerrill18
kmerrill18 deleted the value-in-array-tuple branch February 9, 2026 18:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kmerrill18@woopuiyung