Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
barriebyron authored Jul 13, 2023
2 parents 08bfaa5 + ea20689 commit 6cda8a6
Show file tree
Hide file tree
Showing 251 changed files with 37,072 additions and 9,092 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/snarkyjs-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
# In case of version change, update README.md accordingly
node-version: 16

- name: Checkout Docs repo
Expand All @@ -20,19 +21,20 @@ jobs:
with:
repository: o1-labs/snarkyjs
path: snarkyjs
ref: releases
ref: main

- name: Build API reference docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Install dependencies and build SnarkyJS
cd snarkyjs && npm ci && npm run build
cd snarkyjs
git submodule update --init --recursive
npm ci && npm run build
cd src/mina-signer && npm ci && npm run build && cd ../../
# Install markdown-plugin for typedoc and build the SnarkyJS API reference
npm install typedoc-plugin-markdown
npx typedoc --readme none --name SnarkyJS --plugin typedoc-plugin-markdown --out snarkyjs-reference src/index.ts --hideBreadcrumbs true
rm snarkyjs-reference/.nojekyll
# Build API reference docs
npm run build:docs
# Install dependencies for Docs repo
cd ../docs/ && npm ci
Expand All @@ -41,7 +43,7 @@ jobs:
rm -rf docs/zkapps/snarkyjs-reference && cp -rv ../snarkyjs/snarkyjs-reference docs/zkapps/snarkyjs-reference
# Update with new enteries and format sidebars.js
node update-sidebars-snarkyjs-api.js && npx prettier --config .prettierrc --write sidebars.js
npm run update-sidebar
# Configure git and push
BRANCH_NAME=docs/snarkyjs-api-reference-$(git --git-dir ../snarkyjs/.git rev-parse --short HEAD)
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/test-tutorials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Test-Tutorials

on:
push:

jobs:
hello-world:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
# In case of version change, update README.md accordingly
node-version: 16
- run: |
npm ci
git config --global user.email "[email protected]"
git config --global user.name "Test"
npx ts-node scripts/tutorial-runner.ts docs/zkapps/tutorials/01-hello-world.mdx
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Require PRs to be approved by someone from this team:
* @o1-labs/docs-reviewers
69 changes: 69 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Docs Contributing Guidelines

Welcome to the Mina Docs open source repository. Thank you for your interest in contributing to the [Mina Docs](https://docs.minaprotocol.com/) website.

We realize that technical documentation is a high-visibility interface with you: our community and our users. We work hard to deliver well-written docs to help you discover, understand, and use the Mina Protocol and SnarkyJS.

We treat documentation like code. The Mina Docs use a docs-as-code workflow to develop and publish product documentation using the same tools and processes as software code development. All user-impacting updates on the codebase require corresponding updates to the relevant documentation in the docs repo. Developers who know the feature best write the first draft of content for all changes and new features. Feature documentation is part of our development “definition of done.”

By contributing, you can help us improve the functionality and user experience of the docs which in turn helps you build better projects. To ensure a smooth and effective collaboration, please follow these contribution guidelines.

## Style Guidance

Follow the style guidance in the [Docs Style Guide](https://github.com/o1-labs/docs2/wiki/Docs-Style-Guide) and recommended [Word List](https://github.com/o1-labs/docs2/wiki/Word-list) to ensure a consistent user experience. Look around. Match the style you see used in the rest of the project.

## Get Involved

To learn about ways to participate and interact with community members, see [Online Communities](https://docs.minaprotocol.com/participate/online-communities).

## Code of Conduct

All contributors agree to respect and follow the Mina Protocol [Code of Conduct](https://github.com/MinaProtocol/mina/blob/develop/CODE_OF_CONDUCT.md).

## Docs Toolset

The [Mina Docs](https://docs.minaprotocol.com/) website is published with the Docusaurus static site generator. The docs source files are written in Markdown `.mdx` files that support Markdown with embedded components through the JSX syntax extension to JavaScript. Docusaurus has built-in support for MDX that renders the JSX in Markdown files as React components.

Even if you're unfamiliar with Markdown, you can still contribute to the docs in a helpful and meaningful way. Use [Markdown Basic Syntax](https://www.markdownguide.org/basic-syntax) and look at existing docs for models to follow. You can start contributing by submitting fixes for typos, spelling, and broken links.

To build the docs locally during development, see the [README](README.md) file.

## Using this repo

If you don't find what you are looking for or something in the docs is not working as expected, review existing [docs2 issues](https://github.com/o1-labs/docs2/issues/) on GitHub. Before you report a problem, take a look around and see if someone already opened an issue. If you are certain this is a new, unreported bug, submit a new issue to help us improve.

- One issue, one bug: Report a single bug per issue.
- If you're ready to fix a bug, it's fine to submit a pull request right away, but we still recommend filing an issue detailing what you're fixing. This workflow is helpful in case we don't accept that specific fix but want to keep track of the issue.
- Provide steps to reproduce the bug, be sure to list all the steps necessary to reproduce the issue.

## Reviewing Technical Content PRs

Some of the best content contributions come during the PR review cycles. To ensure quality, follow best practices for technical content PR reviews just like you do for code reviews. When reviewing a pull request, the end-goal is to suggest useful changes to the author.

- For in-line suggestions, use the [GitHub suggesting feature](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/commenting-on-a-pull-request).
- You can comment on one line or several lines. You can provide changes or edits, and the person who authored the PR can easily apply your change, or create their own competing suggestion, and you can discuss it. To invite others to the conversation, tag their GitHub @username in a comment to notify them. In this way, you can discuss any change. It’s transparent and inclusive.
- The PR owner can merge in your suggested commits one at a time or in batch (preferred).
- When you are providing a more granular extensive review that results a large number (more than 20) of in-line suggestions, work with the PR owner to develop a workflow. You might decide together that as a reviewer, you can check out the branch and make the changes yourself.

## Pull Requests (PRs)

You are welcome to provide a fix or update directly. We appreciate your contributions!

- For a simple fix to single page, you can select **EDIT THIS PAGE** at the top of the page to make changes to the file in a web browser. In the **Propose changes** section, you can follow the GitHub workflow to submit a pull request.

- If you're not a member or maintainer, fork the repo and then submit a pull request (PR) from your forked repo to the `main` branch.

Provide a helpful, informative PR title that includes the context and page you are updating. Each PR must address only one issue or feature.

Start by creating a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/). Create your draft PR early, even if your work is just beginning or incomplete. Your draft PR indicates to the community that you're working on something and provides a space for conversations early in the development process. Merging is blocked for `Draft` PRs, so they provide a safe place to experiment and invite comments.

All pull requests must go through the code review process. As the PR submitter, you are responsible for addressing each comment and suggestion in the **Files changed** view during the review process.

- If you are a member of the docs repo, you can merge the approved PR.
- If your PR is a fork, the code maintainers will merge the approved PR.

### SnarkyJS Reference

The zkApp Developers > [SnarkyJS Reference](https://docs.minaprotocol.com/zkapps/snarkyjs-reference) docs are generated content and are outside the scope of the Mina Docs repository.

Thank you for contributing to the Mina docs. It's better together.
41 changes: 32 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,49 @@

# Mina Docs

## To view the docs

To view this website, visit [docs.minaprotocol.com](https://docs.minaprotocol.com/).
The Mina Docs website is [docs.minaprotocol.com](https://docs.minaprotocol.com/).

## To contribute content

Click the `Suggest changes` button at the bottom left of any page on [the docs website](https://docs.minaprotocol.com/) to edit that page and submit a pull request via Github.
Thank you for your interest. See the docs [CONTRIBUTING](CONTRIBUTING.md) guidelines.

## How to see your doc updates during development

The docs output is generated by a CI pipeline so we can update the docs site whenever we want. The [Mina Docs](https://docs.minaprotocol.com/) website always contains the most up-to-date content available.

During the documentation build process, each PR goes through Vercel CI to test the doc updates and build a preview of your changes. Vercel for GitHub automatically deploys and provides preview deployment URLs. After the PR status is ready, click **Visit Preview** and navigate to the changed page to see your doc updates.

To test the doc build and see local updates before you push changes to GitHub, be sure to build the docs locally.
<!-- In case of version change, update .github/workflows/{test-tutorials.yml, snarkjs-api-reference.md} accordingly -->

Local builds require Node.js, version 16 precisely.
One way to install NPM is to rely on [nvm](https://github.com/nvm-sh/nvm). Use the following commands to install nvm and npm:

```sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install v16
```

## How to run during development
If you are using a later node version on Linux and macOS, you might be able to get local builds working after you run this command:

```sh
export NODE_OPTIONS=--openssl-legacy-provider
```

After your local build environment is set, you can run a local build:

```sh
git clone https://github.com/o1-labs/docs2.git
npm install
npm install docusaurus
npm run dev
```

## How to run in production

On the host:
- Set environment variables: `ALGOLIA_APP_ID` and `ALGOLIA_SEARCH_API_KEY` to appropriate values.
- Set build command: `npm run build`.
- Set output directory: `build`.
- Set install command: `npm ci`.

- Set environment variables: `ALGOLIA_APP_ID` and `ALGOLIA_SEARCH_API_KEY` to appropriate values
- Set build command: `npm run build`
- Set output directory: `build`
- Set install command: `npm ci`
5 changes: 0 additions & 5 deletions docs/about-mina/Advanced/cryptography.md

This file was deleted.

10 changes: 6 additions & 4 deletions docs/about-mina/consensus.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
title: Consensus
---

import ResponsiveVideo from '@site/src/components/common/ResponsiveVideo';

# Consensus

Mina Protocol uses a proof-of-stake consensus mechanism called **Ouroboros Samasika**.

Consensus is the process by which the network determines which information will be retained in the blockchain. You can read about the difference between proof of stake (PoS) vs proof of work (PoW) consensus mechanisms in this blog post <a href="https://minaprotocol.com/blog/proof-of-work-vs-proof-of-stake">here</a>.
Consensus is the process by which the network determines which information is retained in the blockchain. You can read about the difference between proof of stake (PoS) vs proof of work (PoW) consensus mechanisms in this blog post <a href="https://minaprotocol.com/blog/proof-of-work-vs-proof-of-stake">here</a>.

Learn more about how Ouroboros Samasika works in this video, below:
Learn more about how Ouroboros Samasika works in this video:

[![What is Ouroboros Samisika?](https://res.cloudinary.com/marcomontalbano/image/upload/v1661971904/video_to_markdown/images/youtube--NpjuGYcJICA-c05b58ac6eb4c4700831b2b3070cd403.jpg)](https://www.youtube.com/watch?v=NpjuGYcJICA "What is Ouroboros Samisika?")
<ResponsiveVideo src="https://www.youtube.com/embed/NpjuGYcJICA" />

### Decentralization properties
Based on Cardano’s PoS Ouroboros, Ouroboros Samisika is a secure PoS protocol with some strong decentralization properties:
Expand All @@ -19,4 +21,4 @@ Based on Cardano’s PoS Ouroboros, Ouroboros Samisika is a secure PoS protocol
- **No staking minimum** — You can produce blocks and receive block rewards based on your % of the MINA staked on the network. Any user with any amount of MINA can receive these rewards.
- **No slashing** — the protocol does not need explicit slashing, since the protocol already enforces the required level of correctness.

You can also learn how Ouroboros Samasika upholds Mina’s goals of decentralization <a href="https://minaprotocol.com/blog/how-ouroboros-samasika-upholds-minas-goals-of-decentralization">here</a>.
Learn about <a href="https://minaprotocol.com/blog/how-ouroboros-samasika-upholds-minas-goals-of-decentralization"> how Ouroboros Samasika upholds Mina’s goals of decentralization</a>.
46 changes: 39 additions & 7 deletions docs/about-mina/faq.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
title: FAQ
title: Mina FAQ
---

import Subhead from "@site/src/components/common/Subhead";

# FAQ
# Mina FAQ


<Subhead>
Expand All @@ -17,20 +17,52 @@ The Mina node is written in OCaml. But you don't need to know OCaml to write sma

### What language are zkApp smart contracts written in?

Mina's zero knowledge smart contracts ("zkApps") are written in TypeScript.
Mina's zero knowledge smart contracts (zkApps) are written in TypeScript.

Learn more about [how to write a zkApp](/zkapps/how-to-write-a-zkapp).

### How large is the Mina Blockchain?

22KB
22 KB

### Given Mina is only 22KB, where are past transactions stored?
### Given Mina is only 22 KB, where are past transactions stored?

The Mina node can run with an optional flag to make it an archive node. This means it will store historic transactions which is useful for anyone running a service such as a block explorer, but this data is not needed in order to verify the current consensus state of the protocol.
A Mina node can run with an optional flag to make it an archive node to store historic transactions. Archive nodes are useful for anyone running a service such as a block explorer. Still, this historical data is not required to verify the current consensus state of the protocol.

### What ZK proof system does Mina use?
### What zk proof system does Mina use?

Mina Protocol uses a custom proof system called Kimchi, which was developed by [O(1) Labs](https://o1labs.org/), and is the only blockchain offering infinite recursion.

Check out the [Mina Book](https://o1-labs.github.io/proof-systems/plonk/overview.html) to learn more about Kimchi and the cryptography powering Mina Protocol.

### What can I do on the Mina network?

Any node can send and receive transactions on the Mina network. Any node can also choose to be a node operator. See [Node Operators](/node-operators).

### What consensus algorithm does Mina use?

Mina's consensus mechanism is an implementation of Ouroboros Proof-of-Stake. Due to Mina's unique compressed blockchain, certain aspects of the algorithm have diverged from the Ouroboros papers. The version Mina uses is called Ouroboros Samisika.

#### Is there a Mina block explorer?

Yes, check out these block explorers:

- https://minaexplorer.com/
- https://minascan.io

### How does Mina achieve scalability?

Mina achieves scalability through the use of recursive zk-SNARKs. By generating a proof that attests to the validity of historic blockchain states, Mina can keep the blockchain size fixed. This allows for increased throughput due to block size limits not being as taxing on the network, thereby increasing the scalability of the network.

### What security audits have been completed?

You can review the results of the completed security audits here:

- On 2020-05-11 [NCC Group Security Audit Results of Mina Protocol](https://research.nccgroup.com/wp-content/uploads/2020/05/NCC_Group_O1Labs_O1LB001_Report_2020-05-11_v1.1.pdf)
- On 2021-02-05 [Audit of Mina Ledger Application for O(1) Labs](https://leastauthority.com/blog/audits/audit-of-mina-ledger-application-for-o1-labs/)
- On 2021-09-21 [Mina Signer SDK + StakingPower Wallet
Security Audit Report Mina Foundation](https://leastauthority.com/wp-content/uploads/2021/09/Least-Authority-Mina-Foundation-Mina-Signer-SDK-StakingPower-Wallet-Final-Audit-Report.pdf)
- On 2022-02-21 [Mina Client SDK, Signature Library and Base
Components – Cryptography and
Implementation Review
O(1) Labs Operating Co.](https://research.nccgroup.com/wp-content/uploads/2022/02/NCC_Group_O1LabsOperatingCo_Report_2022-02-21_v1.0.pdf)
6 changes: 3 additions & 3 deletions docs/about-mina/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Overview

### What is Mina?

Mina is a L1 blockchain based on zero-knowledge proofs (“ZKP”) with smart contracts written in TypeScript. It is the first cryptocurrency protocol with a succinct blockchain (22KB).
Mina is an L1 blockchain based on zero-knowledge proofs (“ZKP”) with smart contracts written in TypeScript. It is the first cryptocurrency protocol with a succinct blockchain (22KB).

### Why Mina?

Expand All @@ -26,9 +26,9 @@ Watch this [video to learn about zero-knowledge proofs](about-mina/what-are-zero

### What are zkApps?

Minas zero-knowledge smart contracts are referred to as zkApps. zkApps provide powerful and unique characteristics such as unlimited off-chain execution, privacy for private data inputs that are never seen by the blockchain, the ability to write smart contracts in TypeScript, & more.
Mina's zero-knowledge smart contracts are referred to as zkApps. zkApps provide powerful and unique characteristics such as unlimited off-chain execution, privacy for private data inputs that are never seen by the blockchain, the ability to write smart contracts in TypeScript, and more.

Learn more about [zkApps work](/zkapps).
See [zkApps Overview](/zkapps).

### How does consensus work on Mina?

Expand Down
13 changes: 4 additions & 9 deletions docs/about-mina/protocol-architecture.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,21 @@ title: Protocol Architecture
hide_title: true
---

import ResponsiveVideo from '@site/src/components/common/ResponsiveVideo';

:::note

A new version of Mina Docs is coming soon! This page will be rewritten.

:::

# Protocol Architecture

## How Does it Work?

Check out this short video explaining how the Mina protocol works in detail:

<iframe
id="youtube-iframe"
width="560"
height="315"
src="https://www.youtube-nocookie.com/embed/eWVGATxEB6M?start=100&enablejsapi=1&rel=0"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
<ResponsiveVideo src="https://www.youtube-nocookie.com/embed/eWVGATxEB6M?start=100&enablejsapi=1&rel=0" />

### Timestamps

Expand Down
Loading

0 comments on commit 6cda8a6

Please sign in to comment.