Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Jul 14, 2025

  • Closes Add proper nonce computation #12
  • Adds a nonce : Option Anoma.Nonce field to Object. The nonce is assumed to be available for objects fetched from the system, including all self objects.
  • Adds proper nonce computation.
    • For consumed persistent resources the nonce is available.
    • For consumed ephemeral resources the nonce is random (following Xuyang's code in RISC0 RM repo).
    • For created resources (persistent and ephemeral) the nonce is equal to the nullifier of the consumed resource in the same compliance unit.
  • Changes the names of a few fields (in particular related to proofs of nullifiability) to follow the Mathlib naming conventions and make the names more meaningful.

@lukaszcz lukaszcz marked this pull request as ready for review July 17, 2025 03:44
@lukaszcz lukaszcz requested review from Copilot and janmasrovira July 17, 2025 03:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds explicit nonce support throughout object and resource representations, updates nullifier proof handling, and threads randomness into action creation.

  • Introduce nonce : Option Anoma.Nonce on Object and propagate it into Anoma.Resource conversions
  • Replace NullifierProof with CanNullifyResource and adjust nullify logic
  • Thread random nonce generation into compliance units and dummy resources

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Prelude/TypeRep.lean Added bneq_generic not-equal operator
Anoma/Resource.lean Renamed NullifierProof to CanNullifyResource
Anoma/NullifierKey.lean New NullifierKey and commitment definitions
Anoma/Nullifier.lean Removed duplicate key logic; added Nullifier.toNonce
Anoma/Nonce.lean Defined Nonce alias
Anoma/Action.lean Updated LogicVerifierInput and Action universes
AVM/Object/Consumable.lean Added toResource helper for consumables
AVM/Object.lean Introduced nonce on Object and updated conversion APIs
AVM/Intent/Translation.lean Refactored Intent.action to thread StdGen and nonces
AVM/Class/Translation.lean Refactored Action.create to thread randomness and nonces
AVM/Class/Member/Logic.lean Parameterized dummyResource by nonce; changed dummy filtering
Comments suppressed due to low confidence (1)

AVM/Class/Translation.lean:22

  • [nitpick] The apostrophe in create' may be unclear. Consider a more descriptive name like createWithGen or createGen to clarify its purpose.
private def Action.create' (g : StdGen) (lab : Label) (memberId : Label.MemberId lab)

@lukaszcz lukaszcz merged commit 9fe900e into main Jul 18, 2025
2 checks passed
@lukaszcz lukaszcz deleted the nonces branch July 18, 2025 09:29
janmasrovira pushed a commit that referenced this pull request Jul 18, 2025
- Depends on #36 
- Closes #40 
- Adds mock functions to compute the `deltaProof` fields of
Transactions, following the general strategy from RISC0 RM.
Sign up for free to 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.

Add proper nonce computation

3 participants