Skip to content

Commit

Permalink
Merge branch 'main' into glossary-keypair-link
Browse files Browse the repository at this point in the history
  • Loading branch information
barriebyron authored Nov 17, 2023
2 parents 0ab6f27 + 01655b5 commit fd92dd2
Show file tree
Hide file tree
Showing 100 changed files with 1,946 additions and 2,043 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/algolia-search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
wait-for-vercel:
runs-on: ubuntu-latest
steps:
- run: sleep 210s
- run: sleep 300s
shell: bash
algolia-search:
runs-on: ubuntu-latest
Expand Down
22 changes: 9 additions & 13 deletions algolia-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@
"sitemap_urls": ["https://docs.minaprotocol.com/sitemap.xml"],
"sitemap_alternate_links": true,
"js_render": true,
"js_wait": 1,
"stop_urls": ["https://docs.minaprotocol.com/node-developers"],
"js_wait": 3,
"selectors_exclude": ["footer"],
"selectors": {
"lvl0": {
"selector": "",
"defaultValue": "Documentation"
},
"lvl1": "header h1, article h1, main h1, h1, head > title",
"lvl2": "article h2, main h2, h2",
"lvl3": "article h3, main h3, h3",
"lvl4": "article h4, main h4, h4",
"lvl5": "article h5, main h5, h5",
"lvl6": "article h6, main h6, h6",
"text": "article p, article li, main p, main li, p, li"
"lvl0": "",
"lvl1": ".markdown h1",
"lvl2": ".markdown h2",
"lvl3": ".markdown h3",
"lvl4": ".markdown h4",
"lvl5": ".markdown h5",
"lvl6": ".markdown h6",
"text": ".markdown p, .markdown li"
},
"strip_chars": " .,;:#",
"custom_settings": {
Expand Down
8 changes: 8 additions & 0 deletions docs/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,14 @@ Zero knowledge apps (zkApps) are Mina Protocol's smart contracts powered by zero

A command line tool that zkApp developers use to scaffold and deploy smart contracts. Install the [zkApp CLI](https://www.npmjs.com/package/zkapp-cli).

### zkApp account

A smart contract account. Each zkApp account provides 8 fields of 32 bytes each of arbitrary storage. When a Mina address contains a verification key, it acts as a zkApp account.

### zkApp manager account

A specific type of smart contract that manages a particular thing. For example, the zkApp manager account for a token controls all properties of token accounts and determines rules for token minting, burning, and transfer.

### zkBridge

Technology that the Mina network uses to connect to other chains.
Expand Down
1 change: 0 additions & 1 deletion docs/mina-protocol/lifecycle-of-a-payment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Any member of the network can create a payment and share it with the Mina networ
### Step 2: To produce a block, Bob's payment gets put in a todo list

A block producer node is chosen on the network for a given time slot. The currently active producer choses in-flight payments based on payment fees and places them in a list to be processed called a transition block. Block producers earn mina for building these blocks. The producer generates a SNARK defining the structure of the transition block as compared to the previous block (but not yet verifying these new payments). The producer transmits this new information for SNARK workers to process.
A block producer node is chosen on the network for a given time slot. The currently active producer choses in-flight payments based on payment fees and places them in a list to be processed, this list is called a transition block. Block producers earn MINA for building these blocks. The producer generates a SNARK that defines the structure of the transition block as compared to the previous block (but not yet verifying these new payments). The producer transmits this new information for SNARK workers to process.

### Step 3: To prove a SNARK transaction, Bob's payment gets SNARK-signed

Expand Down
2 changes: 1 addition & 1 deletion docs/mina-protocol/scan-state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords:

The scan state is a data structure that allows decoupling the production of transaction SNARKs from block producers to SNARK workers.

[Block producers](/mina-protocol/block-producers) do not have to produce transaction SNARKs, so the block production time can remain constant regardless of the transaction throughput. The scan state data structure allows the transaction SNARK proof generation to be parallelized and completed by multiple competing [SNARK workers](/node-operators/snark-workers).
[Block producers](/mina-protocol/block-producers) do not have to produce transaction SNARKs, so the block production time can remain constant regardless of the transaction throughput. The scan state data structure allows the transaction SNARK proof generation to be parallelized and completed by multiple competing [SNARK workers](/mina-protocol/snark-workers).

The scan state is comprised of a forest of full [binary trees](https://en.wikipedia.org/wiki/Binary_tree), where each node in the tree is a job to be completed by a SNARK worker. The scan state periodically returns a single proof from the top of a tree that attests to the correctness of all transactions at the base of the tree.

Expand Down
2 changes: 1 addition & 1 deletion docs/mina-protocol/whats-in-a-block.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ The protocol state proof is a blockchain proof proving that the new protocol sta
When a [block producer](/mina-protocol/block-producers) wins a slot to produce a block, they select transactions and any SNARK work required from the transaction and SNARK pools. They create the proposed next state of the blockchain, which comprises creating a diff of the staged ledger. A diff consists of:

* Transactions included in the block
* A list of SNARK proofs generated by [SNARK workers](/node-operators/snark-workers) for prior transactions added
* A list of SNARK proofs generated by [SNARK workers](/mina-protocol/snark-workers) for prior transactions added
* Pending coinbase

A staged ledger can be regarded as a pending accounts database that has transactions(payments, coinbase, and proof fee payments) applied for which there are no SNARKs available yet. A staged ledger consists of the accounts state (a ledger) and a transaction queue for transactions without SNARK proofs, which is the [scan state](/node-operators/scan-state).
Expand Down
4 changes: 3 additions & 1 deletion docs/node-developers/codebase-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ Now we an use these primitives to reimplement the imperative example above as fo
fun x -> if x mod 2 = 0 then Some x else None
let example x = x >>| add_one >>= bind_even;
```

OCaml has a `ppx` that makes writing monads much easier to follow, using the let syntax.

```
let%bind x = y in
f x
Expand All @@ -142,7 +144,7 @@ Essentially, this syntax takes the value from the let statement and places it on

## Async

Under the hood, async uses Monads. However, ivars are the low-level async primitive. `a' Ivar.t` is essentially a mutex that can only be filled once. After the value from a computation returns, it then fills the ivar. The rest of the syntactic sugar takes the ivar and passes them through `Deferred` monads.
Under the hood, async uses Monads. However, ivars are the low-level async primitive. `'a Ivar.t` is essentially a mutex that can only be filled once. After the value from a computation returns, it then fills the ivar. The rest of the syntactic sugar takes the ivar and passes them through `Deferred` monads.

A `yield` function exists, but avoid using it since it has some weird behavior. Instead, operate on the wrapped values that happen in between `Deferred` bindings.

Expand Down
4 changes: 2 additions & 2 deletions docs/node-operators/generating-a-keypair.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Make sure to set a new and secure password for the following commands. Mina will

```
cd ~
docker run --interactive --tty --rm --volume $(pwd)/keys:/keys minaprotocol/mina-generate-keypair:1.4.0-c980ba8 --privkey-path /keys/my-wallet
docker run --interactive --tty --rm --volume $(pwd)/keys:/keys minaprotocol/mina-generate-keypair:1.3.1-3e3abec --privkey-path /keys/my-wallet
```

1. When prompted, type in the password you intend to use to secure this key. <em>Do NOT forget this password.</em>
Expand Down Expand Up @@ -139,7 +139,7 @@ mina-validate-keypair --privkey-path <path-to-the-private-key-file>
On Docker:

```
docker run --interactive --tty --rm --entrypoint=mina-validate-keypair --volume $(pwd)/keys:/keys minaprotocol/mina-generate-keypair:1.4.0-c980ba8 --privkey-path /keys/my-wallet
docker run --interactive --tty --rm --entrypoint=mina-validate-keypair --volume $(pwd)/keys:/keys minaprotocol/mina-generate-keypair:1.3.1-3e3abec --privkey-path /keys/my-wallet
```

## Ledger Hardware Wallet
Expand Down
3 changes: 1 addition & 2 deletions docs/node-operators/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ To verify the mina daemon installation, run:
The expected output is `Commit c980ba87c3417f40a7081225dfe7478c5ee70fd7 on branch master`.

### Windows

Windows is not natively supported. Instead, use the [Docker instructions](./#docker).
Windows is not natively supported. Instead, use the [Docker instructions](getting-started#docker).

If you are interested in receiving a grant to develop Mina for Windows, email [email protected] or reach out in the [Mina Protocol Discord server](https://discord.gg/minaprotocol).

Expand Down
2 changes: 1 addition & 1 deletion docs/node-operators/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The Mina nodes fulfill different roles within the network, including:

1. [Block producers](/mina-protocol/block-producers) - this is analogous to being a Bitcoin "miner" or a "validator" in other proof-of-stake networks. By staking MINA, you can be selected to produce a block and win the block reward.

2. SNARK coordinators - distribute work to a series of [SNARK workers](/node-operators/snark-workers) in parallel.
2. SNARK coordinators - distribute work to a series of [SNARK workers](mina-protocol/snark-workers) in parallel.

SNARK coordinators generate proofs of transactions by distributing work to a series of SNARK workers. The SNARK coordinators then submit that work to the network and the proofs are sold to block producers. The block producer buys these proofs on the network (a "snarketplace"). For their efforts, the SNARK worker gets rewarded a part of the block reward.

Expand Down
2 changes: 1 addition & 1 deletion docs/node-operators/staking-and-snarking.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ where:

There is no _amount_ parameter. Your full MINA balance is delegated automatically.

This command looks like a [payment](/node-operators/sending-a-payment) transaction, because a stake delegation is also a transaction, which is why you have to pay a small transaction fee.
This command looks like a [payment](/mina-protocol/sending-a-payment) transaction, because a stake delegation is also a transaction, which is why you have to pay a small transaction fee.

Delegating your stake might be useful if you're interested in:

Expand Down
4 changes: 2 additions & 2 deletions docs/participate/office-hours.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import Subhead from '@site/src/components/common/Subhead';

## zkApps Developers Office Hours

On most Wednesdays, Mina Foundation and O(1) Labs cohost online office hours to help zkApp developers. The format is a one-hour open Q&A. Everyone is welcome. Come to ask any questionsbeginner to advanced!
On every Tuesday 16.00-17.00 UCT and every Saturday 08.00-09.00 UCT, Mina Foundation and O(1) Labs cohost online office hours to help zkApp developers. You can join to ask your o1js / Mina related questions, share and get feedback on your zkApp ideas, meet new developers, find team members for your ongoing ZK projects, or just to have a chat! Instead of creating an official or formal environment, our goal with the office hours is to make the developer community inside the Mina ecosystem more familiar with each other, and give the developers a chance to chat with Mina Foundation, O(1) Labs members, and other experienced o1js developers. Come to ask any questionsbeginner to advanced!

Register for upcoming [zkApps Developer Office Hours](https://lu.ma/mina).

:::tip
For a quicker response, you can ask questions and search for similar previous questions in the [#zkapps-developers](https://discord.com/channels/484437221055922177/915745847692636181) channel on Mina Protocol Discord.
For a quicker response, you can ask questions and search for similar previous questions in the [#zkapps-developers](https://discord.com/channels/484437221055922177/915745847692636181) channel or [#zkapps-questions](https://discord.com/channels/484437221055922177/1047214314349658172) forum on Mina Protocol Discord.

:::
6 changes: 2 additions & 4 deletions docs/test-world-2/launching-a-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ You must configure the node to restart automatically. Follow the instructions in

Please refer to the [Discord testworld-2](https://discord.com/channels/484437221055922177/1103364666517901342) channel for questions or to find any configuration options.

Please note that the flag `--max-connections 200` has been removed for all types of nodes.

:::

## Launching the Nodes
Expand Down Expand Up @@ -71,7 +73,6 @@ You must configure the block producer node with the following flags:
--enable-peer-exchange true
--libp2p-keypair <keyfile path> (**libp2p keypair pre-generated by the Node Operator**)
--log-precomputed-blocks true
--max-connections 200
--peer-list-url (**seeds.txt URL will be distributed prior to launch**)
--generate-genesis-proof true
--block-producer-key <keyfile path> (**keys will be distributed prior to launch**)
Expand Down Expand Up @@ -112,7 +113,6 @@ You must configure Load Testing nodes with the following flags:
--enable-peer-exchange true
--libp2p-keypair <keyfile path> (**libp2p keypair pre-generated by the Node Operator**)
--log-precomputed-blocks true
--max-connections 200
--peer-list-url (**seeds.txt URL will be distributed prior to launch**)
--generate-genesis-proof true
--node-status-url https://nodestats-itn.minaprotocol.tools/submit/stats
Expand Down Expand Up @@ -172,7 +172,6 @@ You must configure the SNARK coordinators with the following flags:
--enable-peer-exchange true
--libp2p-keypair <keyfile path> (**libp2p keypair pre-generated by the Node Operator**)
--log-precomputed-blocks true
--max-connections 200
--peer-list-url (**seeds.txt URL will be distributed prior to launch**)
--node-status-url https://nodestats-itn.minaprotocol.tools/submit/stats
--node-error-url https://nodestats-itn.minaprotocol.tools/submit/stats
Expand Down Expand Up @@ -221,7 +220,6 @@ The non-block producing node must be configured with the following flags:
--enable-peer-exchange true
--libp2p-keypair <keyfile path> (**libp2p keypair pre-generated by the Node Operator**)
--log-precomputed-blocks true
--max-connections 200
--peer-list-url (**seeds.txt URL will be distributed prior to launch**)
--generate-genesis-proof true
--node-status-url https://nodestats-itn.minaprotocol.tools/submit/stats
Expand Down
10 changes: 5 additions & 5 deletions docs/test-world-2/technical-requirements.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ Minimum hardware requirements:

| CPU | Memory | Storage | Network |
| ----------------- |------------ |------------------ |--------------------------- |
| 8 core processor | 16 GB RAM | 10 GB free storage | 1 Mbps internet connection |
| 8 core processor | 16 GB RAM | 20 GB free storage | 1 Mbps internet connection |

### Load Testing
Minimum Hardware requirements:

| CPU | Memory | Storage | Network |
| ----------------- |------------ |------------------ |--------------------------- |
| 8 core processor | 16 GB RAM | 10GB free storage | 1 Mbps internet connection |
| 8 core processor | 16 GB RAM | 20 GB free storage | 1 Mbps internet connection |

### SNARK Work
Minimum hardware requirements:

| CPU | Memory | Storage | Network |
| ----------------- |------------ |------------------ |--------------------------- |
| 16/32 thread dedicated instance | 16 GB RAM | 12GB free storage | 1 Mbps internet connection |
| 16/32 thread dedicated instance | 16 GB RAM | 20 GB free storage | 1 Mbps internet connection |

<br />

Expand All @@ -54,13 +54,13 @@ Minimum hardware requirements:

| CPU | Memory | Storage | Network |
| ----------------- |------------ |------------------ |--------------------------- |
| 8 core processor | 16 GB RAM | 10GB free storage | 1 Mbps internet connection |
| 8 core processor | 16 GB RAM | 20 GB free storage | 1 Mbps internet connection |

### Archive Node
Minimum hardware requirements:

| CPU | Memory | Storage | Network |
| ----------------- |------------ |------------------ |--------------------------- |
| 8 core processor | 16 GB RAM | 10GB free storage | 1 Mbps internet connection |
| 8 core processor | 16 GB RAM | 25 GB free storage | 1 Mbps internet connection |


48 changes: 36 additions & 12 deletions docs/zkapps/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,36 +1,60 @@
---
title: o1js and zkApps FAQ
title: zkApps and o1js FAQ
sidebar_label: FAQ
description: Answers to common questions about zkApps and o1js, a library that creates zk circuits from user code. Learn about the use of built-in o1js datatypes, functions, and the implications for proof generation.
description: Answers to common questions about zkApps (zero knowledge apps) and o1js, a TypeScript library for writing zk smart contracts.
keywords:
- o1js
- FAQ
- smart contract
- zkApps
- o1js
---

## What files do I use to write zkApps?
# zkApps and o1js FAQ

Answers to common questions about zkApps (zero knowledge apps) and o1js, a TypeScript library for writing zk smart contracts.

### How do I stay up to date with zkApps and o1js?

Follow the official O(1) Labs channels:

- Twitter/X [@o1_labs](https://twitter.com/o1_labs)
- O(1) Labs [Blog](https://blog.o1labs.org/), especially the [What's New in o1js](https://blog.o1labs.org/search?q=o1js) monthly updates

### Where can I ask questions and contribute answers?

[Mina Protocol Discord](https://discord.gg/minaprotocol) is the most popular place where Mina enthusiasts and technical contributors gather.

Join us in these zkApps channels:

* [#zkapps-developers](https://discord.com/channels/484437221055922177/915745847692636181) to meet other developers building zkApps with o1js
* [#zkapps-general](https://discord.com/channels/484437221055922177/910549624413102100) to ask general questions about zkApps, how to use a zkApp, and so on
* [#zkapps-questions](https://discord.com/channels/484437221055922177/1047214314349658172) to ask zkApps-related questions and see Q&A history


### What files do I use to write zkApps?

There are many approaches to building a smart contract. For the zkApp tutorials, most examples follow this convention:

- `index.ts`: The entry point of your project that imports all smart contract classes you want access to and exports them to your smart contract.
- `main.ts`: How you interact with the smart contract. For example, the `import` statement brings in objects and methods from `o1js` that you use to interact with your smart contract.
- `<yourcontract>.ts`: Your specific smart contract logic.

## What is ZkProgram?
### Where can I find the o1js API reference documentation?

The API for writing non-Mina related provable code. A ZkProgram is similar to a zkApp smart contract, but isn't tied to an on-chain account.
See the autogenerated [o1js reference](/zkapps/o1js-reference) documentation with doc comments, like the [Provable](/zkapps/o1js-reference/interfaces/Provable) module.

## What is the difference between `getActions` and `fetchActions`?
### What is ZkProgram?

- [getActions](/zkapps/o1js-reference/modules/Mina#getactions) works with the blockchain network
- [fetchActions](/zkapps/o1js-reference/modules/Mina#fetchactions) works with archive nodes
A general-purpose API for creating zk proofs. A ZkProgram is similar to a zkApp smart contract but isn't tied to an on-chain account.

## Where can I find the o1js API reference documentation?
### What is the difference between `getActions` and `fetchActions`?

See the autogenerated [o1js reference](/zkapps/o1js-reference) documentation with doc comments, like the [Provable](/zkapps/o1js-reference/interfaces/Provable) module.
Use the appropriate module to work with the live network or with historical archive nodes:

- [getActions](/zkapps/o1js-reference/modules/Mina#getactions) works with the blockchain network
- [fetchActions](/zkapps/o1js-reference/modules/Mina#fetchactions) works with archive nodes

## Does o1js compile my JavaScript code to an arithmetic circuit?
### Does o1js compile my JavaScript code to an arithmetic circuit?

No, o1js **does NOT compile into anything else**. In contrast to other zk ecosystems, o1js is just a JS library. It creates zk circuits from user code by _executing_ that code. If you have a smart contract with a `@method myMethod()`, for example, o1js simply calls `myMethod();` during proof generation.

Expand Down
Loading

0 comments on commit fd92dd2

Please sign in to comment.