Skip to content

chore(web-client): v12 tutorials clean up#145

Merged
Keinberger merged 5 commits intomainfrom
keinberger/v12-tutorials-cleanup
Nov 25, 2025
Merged

chore(web-client): v12 tutorials clean up#145
Keinberger merged 5 commits intomainfrom
keinberger/v12-tutorials-cleanup

Conversation

@Keinberger
Copy link
Collaborator

This PR brings the following changes:

  • Switches web client tutorials to use yarn instead of pnpm. This was discussed between me and @WiktorStarczewski on Slack, as we both agreed on implementing yarn going forward. yarn is the most widely used Node package manager at the moment and the go-to standard for projects.
  • Implements a fix inside of the "Increment Count of the Counter Contract" tutorial to update the explanation of authentication components.
  • Implements a custom .prettierrc config file for all typescript code, that is more aligned with industry best practices (using single quotes instead of double quotes) for Typescript / Web development (proposed by @WiktorStarczewski )

Copy link
Contributor

@WiktorStarczewski WiktorStarczewski left a comment

Choose a reason for hiding this comment

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

LGTM

### Authentication Component

If the `increment_count` procedure did not call the `account::incr_nonce` procedure during its execution, only the deployer of the counter contract would be able to increment the count of the smart contract (if the RpoFalcon512 component was added to the account, in this case we didn't add it).
**Important**: Starting with Miden Client 0.10.0, all accounts must have an authentication component. For smart contracts that don't require authentication (like our counter contract), we use a `NoAuth` component.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's remove the reference to 0.10.0. Let's just say:

Suggested change
**Important**: Starting with Miden Client 0.10.0, all accounts must have an authentication component. For smart contracts that don't require authentication (like our counter contract), we use a `NoAuth` component.
**Important**: All accounts must have an authentication component. For smart contracts that do not require authentication (like our counter contract), we use a `NoAuth` component.

Nit: lets stick to avoiding contractions in our docs. Other projects follow this standard in technical writing. For example: https://docs.soliditylang.org/en/latest/contributing.html#expand-contractions

**Important**: Starting with Miden Client 0.10.0, all accounts must have an authentication component. For smart contracts that don't require authentication (like our counter contract), we use a `NoAuth` component.

In essence, if a procedure performs a state change in the Miden smart contract, and does not call `account::incr_nonce` at some point during its execution, this function can be equated to having an `onlyOwner` Solidity modifer, meaning only the user with knowledge of the private key of the account can execute transactions that result in a state change.
This `NoAuth` component allows any user to interact with the smart contract without requiring signature verification.ivate key of the account can execute transactions that result in a state change.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: spelling

Comment on lines -6 to -7
# Creating Multiple Notes in a Single Transaction

Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you mean to remove the heading?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I removed it as docusaurus md files should not have a dedicated heading (linter warning) if the heading is already specified as a "title" property at the start of the file.

"0x67dc56bd0cbe629000006f36d81029",
'0xbf1db1694c83841000008cefd4fce0',
'0xee1a75244282c32000010a29bed5f4',
'0x67dc56bd0cbe629000006f36d81029',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: update to use bech32 format

"0x67dc56bd0cbe629000006f36d81029",
'0xbf1db1694c83841000008cefd4fce0',
'0xee1a75244282c32000010a29bed5f4',
'0x67dc56bd0cbe629000006f36d81029',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: same thing here

Comment on lines -6 to -7
# How to Use Unauthenticated Notes

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as other comment, did you mean to remove this title?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I removed it as docusaurus md files should not have a dedicated heading (linter warning) if the heading is already specified as a "title" property at the start of the file.

);

const nodeEndpoint = "https://rpc.testnet.miden.io:443";
const nodeEndpoint = 'https://rpc.testnet.miden.io:443';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure we need the port number 443 anymore. Could you check?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just checked, runs fine without the port, will remove!


// 7. Send tokens to Bob
const bobAccountId = "0x599a54603f0cf9000000ed7a11e379";
const bobAccountId = '0x599a54603f0cf9000000ed7a11e379';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as other comment, but most likely for separate PR, we should use bech32 now.


const client = await WebClient.createClient(
"https://rpc.testnet.miden.io:443",
'https://rpc.testnet.miden.io:443',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as other comment, can we remove the port number now?

"0xbf1db1694c83841000008cefd4fce0",
"0xee1a75244282c32000010a29bed5f4",
"0x67dc56bd0cbe629000006f36d81029",
'0xbf1db1694c83841000008cefd4fce0',
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

@Keinberger
Copy link
Collaborator Author

Keinberger commented Nov 25, 2025

FYI, I will open a subsequent PR to bring back the bech32 format for the web-client tutorials.

Created an issue to track this here: #146

@Keinberger Keinberger merged commit cf68ba8 into main Nov 25, 2025
6 checks passed
@Keinberger Keinberger deleted the keinberger/v12-tutorials-cleanup branch November 25, 2025 22:37
@Keinberger Keinberger restored the keinberger/v12-tutorials-cleanup branch November 25, 2025 22:51
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