You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
There's no way to get an ultrahonk verification key through UltraHonkBackend #1337
changed the title [-]There's no way to get a ultrahonk verification key through `UltraHonkBackend`[/-][+]There's no way to get an ultrahonk verification key through `UltraHonkBackend`[/+]on Apr 11, 2025
This returns a Uint8Array but in order to feed this into a circuit I need to get the verification key as fields. I don't know offhand how to decompose the binary representation into fields.
generateProofForRecursiveAggregation() got removed in 13217. This method used to return proof and VK in fields which we were able to feed in to nargo.execute() of the recursive circuit IIRC.
I think we need to bring it back.
Not the JSON functionality exactly but if we look at UltraHonkBackend, we can see that it's not obvious on how to generate the necessary inputs for recursive verification to be fed into another circuit:
We get a proof back as a byte array which then needs to be converted into fields.
We get a vk back as a byte array which then needs to be converted into fields.
There's no method to get the verification key hash
We can't assume that the user will know the correct process to convert from the byte to field representations. While it's currently just chunking every 32 bytes, this has changed in the past and we can't just assume that knowledge on the part of the user anyway. We're also requiring the user to know barretenberg internals on how they should calculate the vk hash.
We should have some helper functions convertVkToFields(vk: Uint8Array): string[], convertProofToFields(proof: Uint8Array): string[] and getVkHash(vk: Uint8Array): string to have a fool-proof method of doing these conversions.
Activity
[-]There's no way to get a ultrahonk verification key through `UltraHonkBackend`[/-][+]There's no way to get an ultrahonk verification key through `UltraHonkBackend`[/+]ledwards2225 commentedon Apr 15, 2025
Does
UltraHonkBackend::getVerificationKeynot work for this purpose?TomAFrench commentedon Apr 15, 2025
This returns a
Uint8Arraybut in order to feed this into a circuit I need to get the verification key as fields. I don't know offhand how to decompose the binary representation into fields.saleel commentedon Apr 15, 2025
generateProofForRecursiveAggregation()got removed in 13217. This method used to return proof and VK in fields which we were able to feed in tonargo.execute()of the recursive circuit IIRC.I think we need to bring it back.
ledwards2225 commentedon Jul 6, 2025
@saleel Is this something you're able to support us on?
johnathan79717 commentedon Jan 20, 2026
@TomAFrench: Could AztecProtocol/aztec-packages#19718 solve this issue?
TomAFrench commentedon Jan 20, 2026
That output looks great for feeding into a
Nargo.toml!johnathan79717 commentedon Jan 26, 2026
Now that the bb CLI can read/write JSONs. Does that solve this issue or do we need to hook that functionality into bb.js?
TomAFrench commentedon Jan 26, 2026
Not the JSON functionality exactly but if we look at
UltraHonkBackend, we can see that it's not obvious on how to generate the necessary inputs for recursive verification to be fed into another circuit:https://github.com/AztecProtocol/aztec-packages/blob/71ffa49969f4c11e42ca685e382c5789a4ed8b2b/barretenberg/ts/src/barretenberg/backend.ts#L157-L277
We can't assume that the user will know the correct process to convert from the byte to field representations. While it's currently just chunking every 32 bytes, this has changed in the past and we can't just assume that knowledge on the part of the user anyway. We're also requiring the user to know barretenberg internals on how they should calculate the vk hash.
We should have some helper functions
convertVkToFields(vk: Uint8Array): string[],convertProofToFields(proof: Uint8Array): string[]andgetVkHash(vk: Uint8Array): stringto have a fool-proof method of doing these conversions.johnathan79717 commentedon Feb 6, 2026
Does the
generateRecursiveProofArtifactsnot serve this purpose? It returnsPromise<{ proofAsFields: string[]; vkAsFields: string[]; vkHash: string }>https://github.com/AztecProtocol/aztec-packages/blob/next/barretenberg/ts/src/barretenberg/backend.ts#L237-L243johnathan79717 commentedon Apr 1, 2026
Talked to @TomAFrench offline today.
generateRecursiveProofArtifactsanymore.barretenbergAPIobject to do thevkAsFieldsandposeidon2Hash, maybe it's more user friendly to be able to callmain_backend.getVerificationKeyAsFieldsormain_backend.getHash.deflattenFieldsas a name is harder to understand than perhapsproofBytesAsFieldsor something.