|
1 | 1 | ---
|
2 |
| -title: o1js and zkApps FAQ |
| 2 | +title: zkApps and o1js FAQ |
3 | 3 | sidebar_label: FAQ
|
4 |
| -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. |
| 4 | +description: Answers to common questions about zkApps (zero knowledge apps) and o1js, a TypeScript library for writing zk smart contracts. |
5 | 5 | keywords:
|
6 |
| - - o1js |
7 | 6 | - FAQ
|
8 | 7 | - smart contract
|
9 | 8 | - zkApps
|
| 9 | + - o1js |
10 | 10 | ---
|
11 | 11 |
|
12 |
| -## What files do I use to write zkApps? |
| 12 | +# zkApps and o1js FAQ |
| 13 | + |
| 14 | +Answers to common questions about zkApps (zero knowledge apps) and o1js, a TypeScript library for writing zk smart contracts. |
| 15 | + |
| 16 | +### How do I stay up to date with zkApps and o1js? |
| 17 | + |
| 18 | +Follow the official O(1) Labs channels: |
| 19 | + |
| 20 | +- Twitter/X [@o1_labs](https://twitter.com/o1_labs) |
| 21 | +- O(1) Labs [Blog](https://blog.o1labs.org/), especially the [What's New in o1js](https://blog.o1labs.org/search?q=o1js) monthly updates |
| 22 | + |
| 23 | +### Where can I ask questions and contribute answers? |
| 24 | + |
| 25 | +[Mina Protocol Discord](https://discord.gg/minaprotocol) is the most popular place where Mina enthusiasts and technical contributors gather. |
| 26 | + |
| 27 | +Join us in these zkApps channels: |
| 28 | + |
| 29 | +* [#zkapps-developers](https://discord.com/channels/484437221055922177/915745847692636181) to meet other developers building zkApps with o1js |
| 30 | +* [#zkapps-general](https://discord.com/channels/484437221055922177/910549624413102100) to ask general questions about zkApps, how to use a zkApp, and so on |
| 31 | +* [#zkapps-questions](https://discord.com/channels/484437221055922177/1047214314349658172) to ask zkApps-related questions and see Q&A history |
| 32 | + |
| 33 | + |
| 34 | +### What files do I use to write zkApps? |
13 | 35 |
|
14 | 36 | There are many approaches to building a smart contract. For the zkApp tutorials, most examples follow this convention:
|
15 | 37 |
|
16 | 38 | - `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.
|
17 | 39 | - `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.
|
18 | 40 | - `<yourcontract>.ts`: Your specific smart contract logic.
|
19 | 41 |
|
20 |
| -## What is ZkProgram? |
| 42 | +### Where can I find the o1js API reference documentation? |
21 | 43 |
|
22 |
| -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. |
| 44 | +See the autogenerated [o1js reference](/zkapps/o1js-reference) documentation with doc comments, like the [Provable](/zkapps/o1js-reference/interfaces/Provable) module. |
23 | 45 |
|
24 |
| -## What is the difference between `getActions` and `fetchActions`? |
| 46 | +### What is ZkProgram? |
25 | 47 |
|
26 |
| -- [getActions](/zkapps/o1js-reference/modules/Mina#getactions) works with the blockchain network |
27 |
| -- [fetchActions](/zkapps/o1js-reference/modules/Mina#fetchactions) works with archive nodes |
| 48 | +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. |
28 | 49 |
|
29 |
| -## Where can I find the o1js API reference documentation? |
| 50 | +### What is the difference between `getActions` and `fetchActions`? |
30 | 51 |
|
31 |
| -See the autogenerated [o1js reference](/zkapps/o1js-reference) documentation with doc comments, like the [Provable](/zkapps/o1js-reference/interfaces/Provable) module. |
| 52 | +Use the appropriate module to work with the live network or with historical archive nodes: |
| 53 | + |
| 54 | +- [getActions](/zkapps/o1js-reference/modules/Mina#getactions) works with the blockchain network |
| 55 | +- [fetchActions](/zkapps/o1js-reference/modules/Mina#fetchactions) works with archive nodes |
32 | 56 |
|
33 |
| -## Does o1js compile my JavaScript code to an arithmetic circuit? |
| 57 | +### Does o1js compile my JavaScript code to an arithmetic circuit? |
34 | 58 |
|
35 | 59 | 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.
|
36 | 60 |
|
|
0 commit comments