Skip to content

Conversation

@marshacb
Copy link
Collaborator

@marshacb marshacb commented Feb 3, 2026

Motivation

This PR adds Node.js and React create-leo-app templates that build execution transactions for all 6 functions (transfer_public, transfer_public_to_private, transfer_private, transfer_private_to_public, join, split), giving developers a working reference for each transfer and record operation type.

Test Plan

  • Node and React templates added to CI (build + run matrices)
  • React template manually verified in browser

Preview

Screenshot 2026-02-03 at 1 45 17 PM

Copy link
Member

@iamalwaysuncomfortable iamalwaysuncomfortable left a comment

Choose a reason for hiding this comment

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

This is really great! Still reviewing, but one comment is that for both examples, can we create an object called Credits which holds the functions within them (and probably an account as well)?

Copy link
Member

@iamalwaysuncomfortable iamalwaysuncomfortable left a comment

Choose a reason for hiding this comment

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

A few nits, but overall this is not just understanding the assignment but going beyond and adding to the curriculum. This is GREAT. Thanks for the quick and hard work.

Comment on lines 3 to 4
This template demonstrates building execution transactions for all 6 credits.aleo
transfer and record manipulation functions in a React application.

Choose a reason for hiding this comment

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

Suggested change
This template demonstrates building execution transactions for all 6 credits.aleo
transfer and record manipulation functions in a React application.
This template demonstrates building execution transactions for 6 credits.aleo
functions that demonstrate value transfers and record manipulation functions in a React application.

Comment on lines 40 to 41
2. Fetches inclusion proofs from the network for private record operations
3. Builds complete transactions ready for broadcast

Choose a reason for hiding this comment

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

The inclusion proof is part of the overall zk proof generated!

Suggested change
2. Fetches inclusion proofs from the network for private record operations
3. Builds complete transactions ready for broadcast
2. Builds transactions from the proof ready for broadcast

Comment on lines 52 to 55
owner: aleo1xxx...xxx.private,
microcredits: 1000000u64.private,
_nonce: 123...789group.public,
_version: 1u8.public

Choose a reason for hiding this comment

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

Suggested change
owner: aleo1xxx...xxx.private,
microcredits: 1000000u64.private,
_nonce: 123...789group.public,
_version: 1u8.public
owner: aleo1xxx...xxx.private, // An aleo address that owns the record.
microcredits: 1000000u64.private, // The amount in microcredits contained in the record.
_nonce: 123...789group.public, // The unique nonce identifying the record.
_version: 1u8.public // The version of the record.


### Credits Records

Private credits in Aleo are stored as records with this structure:

Choose a reason for hiding this comment

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

Suggested change
Private credits in Aleo are stored as records with this structure:
Private credits in the credits.aleo program (the official representation of value on the Aleo Network) are stored as Aleo records with this structure:


## Notes

- Network connectivity is required for inclusion proofs

Choose a reason for hiding this comment

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

Network connectivity isn't actually always required.

Suggested change
- Network connectivity is required for inclusion proofs
- Network connectivity is required for this app


- Network connectivity is required for inclusion proofs
- Public function execution takes ~10-15 seconds
- Private function execution takes ~30-120 seconds (includes network calls)

Choose a reason for hiding this comment

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

Suggested change
- Private function execution takes ~30-120 seconds (includes network calls)
- Private function execution takes ~30-120 seconds (Depending on whether keys are locally cached or not)


### Public Transfers

- **transfer_public**: Transfer credits between public balances

Choose a reason for hiding this comment

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

Generally code convention in Provable is to use periods in docs and code comments outside of headers. Add them to the text in this doc (minus the headers)

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.

3 participants