Skip to content

Commit

Permalink
Add PoZK miner documents (#7)
Browse files Browse the repository at this point in the history
* Add some PoZK docs

* Update

* Add some miner docs

* Update
  • Loading branch information
sunhuachuang authored Oct 10, 2024
1 parent 169846c commit 07cec1a
Show file tree
Hide file tree
Showing 19 changed files with 455 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The URL the site will be built for
base_url = "https://docs.zypher.network"
title = "Zypher Network"
title = "Zypher"
description = "Zypher Game Framework Documentation | Zypher Network Docs"

# The site theme to use.
Expand Down
6 changes: 6 additions & 0 deletions content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ section = "zytron"
url = "/zytron/chain/overview/"
weight = 30

[[extra.menu.main]]
name = "PoZK"
section = "pozk"
url = "/pozk/overview/"
weight = 40

[[extra.list]]
title = "Secret Engine"
content = 'A suite of SDKs to enable secure execution of verifiable encrypted computations, ensuring strategic elements remain sealed on-chain'
Expand Down
26 changes: 26 additions & 0 deletions content/pozk/2048.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
+++
title = "Example - Game2048"
description = "An example about how to build prover and play."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00
draft = false
weight = 5005
sort_by = "weight"
section = "pozk"
template = "docs/page.html"

[extra]
section = "pozk"
lead = 'An example about how to build prover and play.'
toc = true
top = false
+++

## Introduction
Learning the zk-powered game by programming a guessing game. [Guessing Game →](../guessing-game)

## Build 2048 prover

## Register to prover market

## Integrate to game
8 changes: 8 additions & 0 deletions content/pozk/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
title = "PoZK"
description = "Prover network for ZK games."
template = "docs/section.html"
sort_by = "weight"
weight = 1
draft = false
+++
Binary file added content/pozk/arch.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/pozk/miner-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
117 changes: 117 additions & 0 deletions content/pozk/miner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
+++
title = "Become a miner"
description = "How to become a miner and earn rewards."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00
draft = false
weight = 5002
sort_by = "weight"
section = "pozk"
template = "docs/page.html"

[extra]
section = "pozk"
lead = 'How to become a miner and earn rewards.'
toc = true
top = false
+++

## Introduction
Miners are responsible for generating all proofs in the network, so they need not only computing power support, but also stake guarantee. At the same time, miners will receive most of the rewards in the network.

Because there are various prover programs in the network, different programs have different hardware requirements, so even laptops and mobile phones also have the opportunity to participate in mining and get rewards. Of course, high-computing power devices will complete more prover tasks and get more opportunities.

Let's running a miner program in your devices.

## Setup
1. Install latest [docker](https://www.docker.com)
2. Download or copy [miner docker-compose template](https://github.com/zypher-game)
```
version: '3'
networks:
default:
name: pozk
services:
pozk-miner:
image: zyphernetwork/pozk-miner:0.0.17
container_name: pozk-miner
ports:
- "9098:9098"
volumes:
- ./:/usr/pozk
- /var/run/docker.sock:/var/run/docker.sock
command:
- --miner=0x0000000000000000000000000000000000000000
- --endpoints=https://linea-mainnet-zytron.zypher.game
- --network=testnet
# - --config=/usr/pozk/config.toml # advance configure, default is none
# - --base-path=/usr/pozk # change host base path for docker use, default is /usr/pozk
# - --server=http://pozk-miner:9098 # the pozk-miner server with default networks: pozk
# - --docker-proxy=xxx # if need use docker proxy server
# - --zero-gas=xxx # if need other zero gas server uri, default is zytron 0 gas service
pozk-frontend:
image: zyphernetwork/pozk-frontend:0.0.10
container_name: pozk-frontend
ports:
- "4000:4000"
environment:
- API_BASE_URL=http://localhost:9098
- NETWORK=testnet
```

3. Run `docker compose up -d`

TIPS: if you use nginx, you can use the config to proxy:
```
server {
listen 80;
server_name xxx.com;
location ~ ^/(api|login|tasks) {
proxy_pass http://127.0.0.1:9098;
}
location / {
proxy_pass http://127.0.0.1:4000;
}
}
```

## Stake a prover (game)
Open browser, and visit: `https://localhost:4000`

1. Connect wallet use your miner account
<img src="../miner-0.png" alt="Miner 0" width="100%"/>

2. You need to setup a local controller for mining
<img src="../miner-1.png" alt="Miner 1" width="100%"/>

3. You can choose generate new or import one
<img src="../miner-2.png" alt="Miner 2" width="100%"/>

4. You need enable the controller and submit it to the chain
<img src="../miner-3.png" alt="Miner 3" width="100%"/>

5. Now, you can view the dashboard
<img src="../miner-4.png" alt="Miner 4" width="100%"/>

## Install the prover
1. You will see the provers list in the dashboard, and your staking status.
<img src="../miner-5.png" alt="Miner 5" width="100%"/>

2. You can stake the prover and download in local device.

3. It will automatically start accepting orders for mining after you download the prover.

## Collect rewards

1. You can see all rewards which can collect by epoch.
<img src="../miner-6.png" alt="Miner 6" width="100%"/>

2. After you collected the rewards, it will in `collected rewards`, and after an epoch, you can make a claim.
<img src="../miner-7.png" alt="Miner 7" width="100%"/>

3. After claim, it will send to you wallet directly.
42 changes: 42 additions & 0 deletions content/pozk/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
+++
title = "Overview"
description = "Prover network for ZK games."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00
draft = false
weight = 5000
sort_by = "weight"
section = "pozk"
template = "docs/page.html"

[extra]
section = "pozk"
lead = 'Prover network for ZK games'
toc = true
top = false
+++

## Introduction
PoZK is a prover network for ZK games.

In order to allow players to play games smoothly on various terminal devices without being restricted by zk computing power, we launched the ZK prover network to solve the problem of players' computing power.

At the same time, computing power will be rewarded. Each proof represents the correctness of the result of a game. Each proof is meaningful, so each computing power will be rewarded. Not only miners will get computing power rewards, but players will also get game rewards. Promote more games to join and more players to experience decentralized games.

Here is the architecture diagram of the entire product, illustrating the relationship between the various components (roles)

<img src="../arch.jpg" alt="Architecture" width="100%"/>


Here is an explanation of the complete workflow, from players to miners in the PoZK network.

<img src="../workflow.jpg" alt="Workflow" width="100%"/>

## Build a prover
How to build a prover for game and use PoZK network. [More →](../prover)

## Become a miner
How to become a miner and earn rewards. [More →](../miner)

## Play for earn
How to play games and earn rewards. [More →](../player)
28 changes: 28 additions & 0 deletions content/pozk/player.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
+++
title = "Play for earn"
description = "How to play games and earn rewards."
date = 2021-05-01T08:00:00+00:00
updated = 2021-05-01T08:00:00+00:00
draft = false
weight = 5003
sort_by = "weight"
section = "pozk"
template = "docs/page.html"

[extra]
section = "pozk"
lead = 'How to play games and earn rewards.'
toc = true
top = false
+++

## Introduction
TODO

## Stake for earn

## Play a game

## Create a proof task

## Collect rewards
Loading

0 comments on commit 07cec1a

Please sign in to comment.