Skip to content

Commit

Permalink
Merge pull request #1261 from ACStoneCL/feat-1.5.0
Browse files Browse the repository at this point in the history
Rebasing `feat-1.5.0` from `dev`
  • Loading branch information
ACStone-MTS authored Aug 24, 2023
2 parents f1de143 + 2c1901d commit 73f7cd2
Show file tree
Hide file tree
Showing 93 changed files with 6,897 additions and 7,455 deletions.
2 changes: 1 addition & 1 deletion check-md-unused.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const fs = require("fs");
// Constants
//----------------------------------
const excludedFolders = ["./source/blog/**/*", "./source/i18n/**/*"];
const excludedFiles = ["./source/docs/casper/index.md"];
const excludedFiles = ["./source/docs/casper/concepts/about.md"];

//----------------------------------
// Private Vars
Expand Down
25 changes: 17 additions & 8 deletions config/sidebar.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
concepts: [
"concepts/index",
"concepts/about",
"concepts/intro-to-dapps",
"concepts/accounts-and-keys",
"concepts/hash-types",
Expand Down Expand Up @@ -35,9 +36,17 @@ module.exports = {
"concepts/economics/consensus",
"concepts/economics/runtime",
"concepts/economics/gas-concepts",
"concepts/economics/concepts",
"concepts/economics/staking",
"concepts/economics/delegation",
{
type: "category",
label: "Staking",
collapsible: true,
collapsed: true,
link: {
type: "doc",
id: "concepts/economics/staking/concepts",
},
items: ["concepts/economics/staking/staking", "concepts/economics/staking/delegation"],
},
],
},
{
Expand Down Expand Up @@ -81,7 +90,6 @@ module.exports = {
],
developers: [
"developers/index",
"developers/table-of-contents",
"developers/prerequisites",
{
type: "category",
Expand Down Expand Up @@ -155,20 +163,19 @@ module.exports = {
],
},
"developers/dapps/technology-stack",
"developers/dapps/setup-nctl",
"developers/dapps/nctl-test",
"developers/dapps/template-frontend",
"developers/dapps/signing-a-deploy",
"developers/dapps/sending-deploys",
"developers/dapps/speculative-exec",
"developers/dapps/setup-nctl",
"developers/dapps/nctl-test",
//"developers/dapps/signer-integration",
//"developers/dapps/callstack-based", // NEW CONTENT WILL BE HERE
"developers/dapps/monitor-and-consume-events",
],
},
{
type: "category",
label: "Interacting with the Blockchain using CLI",
label: "Interacting with the Blockchain",
collapsible: true,
collapsed: true,
link: {
Expand All @@ -194,7 +201,9 @@ module.exports = {
"developers/cli/delegate",
"developers/cli/redelegate",
"developers/cli/undelegate",
"developers/cli/sending-deploys",
"developers/cli/installing-contracts",
"developers/cli/querying-global-state",
"developers/cli/calling-contracts",
"developers/cli/execution-error-codes",
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
---
id: welcome
title: Welcome
title: What is Casper?
slug: /
---

## What is Casper? {#what-is-casper}

Casper is a new [Turing-complete](./concepts/glossary/T.md#turing-complete-blockchain) smart-contracting platform, backed by a Proof-of-Stake (PoS) consensus algorithm and WebAssembly (Wasm). The network is a [permissionless](./concepts/glossary/P.md#permissionless), decentralized, public blockchain.
Casper is a new [Turing-complete](../concepts/glossary/T.md#turing-complete-blockchain) smart-contracting platform, backed by a Proof-of-Stake (PoS) consensus algorithm and WebAssembly (Wasm). The network is a [permissionless](../concepts/glossary/P.md#permissionless), decentralized, public blockchain.

The network's consensus protocol is called [Highway](https://arxiv.org/pdf/2101.02159.pdf), and it has several benefits over classic Byzantine Fault Tolerant (BFT) consensus protocols. First, Highway allows networks to reach higher thresholds of _finality_, meaning that more blocks are finalized, and validators agree to add them to the blockchain. Second, the protocol achieves flexibility by expressing block finality in ways not possible in BFT models. This protocol is built on the [correct-by-construction (CBC) Casper](https://github.com/cbc-casper/cbc-casper-paper) research.

Additionally, the Casper Network is optimized for enterprise and developer adoption. While leveraging blockchain technology, the network seeks to accelerate business operations via unique features like predictable network fees, upgradeable contracts, on-chain governance, privacy flexibility, and developer-friendly languages. Casper's [core features and strengths](./resources/build-on-casper.md) enable developers and enterprises to reap the benefits of blockchain technology.
Additionally, the Casper Network is optimized for enterprise and developer adoption. While leveraging blockchain technology, the network seeks to accelerate business operations via unique features like predictable network fees, upgradeable contracts, on-chain governance, privacy flexibility, and developer-friendly languages. Casper's [core features and strengths](../resources/build-on-casper.md) enable developers and enterprises to reap the benefits of blockchain technology.

Casper also solves the scalability trilemma. Notably, the network is optimized for security, decentralization, and high throughput. All this is achieved while evolving to provide leading solutions for open-source projects and enterprises.

## How does Casper work? {#how-does-casper-work}

Casper relies on a group of validators to verify transactions and uphold the network. Unlike Proof-of-Work networks, which need to centralize validators for economies of scale, Casper allows for the geographical decentralization of validators. Casper validators verify transactions based on staked tokens and receive CSPR rewards for participating in the PoS consensus mechanism. CSPR is the native token on the Casper Network.

To understand the design further, read [this article](../concepts/design/casper-design.md).

## Other Sections
## Disclaimer

- [Disclaimer](./disclaimer.md): Legal Disclaimer
Read the [Legal Disclaimer](../disclaimer.md) regarding this CasperLabs Tech Spec (this "Whitepaper").
2 changes: 1 addition & 1 deletion source/docs/casper/concepts/accounts-and-keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ casper-client get-account-info --help

### Using a block explorer

Using the [cspr.live](http://cspr.live) block explorer, open the Account in question, and expand the `Raw Data` section. Look for the `main_purse` field and find the corresponding URef. If you do not see data in the `Raw Data` section, then the account has not been funded yet.
Using the block explorer for [Mainnet](https://cspr.live/) or [Testnet](https://testnet.cspr.live/), open the Account in question, and expand the `Raw Data` section. Look for the `main_purse` field and find the corresponding URef. If you do not see data in the `Raw Data` section, then the account has not been funded yet.

<p align="center">
<img src={"/image/design/main_purse_uref.png"} alt="Image showing an account's main purse" width="500"/>
Expand Down
2 changes: 1 addition & 1 deletion source/docs/casper/concepts/callstack.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import useBaseUrl from '@docusaurus/useBaseUrl';

# Understanding Call Stacks

Users wishing to interact with a Casper network must do so through [sending a Deploy](../developers/dapps/sending-deploys.md). All Deploys consist of [session code](../developers/writing-onchain-code/writing-session-code.md) run in the context of the user account that sent the Deploy. The session code may [install contract code to global state](../developers/cli/installing-contracts.md), or interact with previously [installed contract code](../developers/writing-onchain-code/calling-contracts.md).
Users wishing to interact with a Casper network must do so through [sending a Deploy](../developers/cli/sending-deploys.md). All Deploys consist of [session code](../developers/writing-onchain-code/writing-session-code.md) run in the context of the user account that sent the Deploy. The session code may [install contract code to global state](../developers/cli/installing-contracts.md), or interact with previously [installed contract code](../developers/writing-onchain-code/calling-contracts.md).

When the session code within a Deploy interacts with one or more contracts, this is the beginning of a [`Call Stack`](https://docs.rs/casper-types/latest/casper_types/system/enum.CallStackElement.html). A call stack is the chronological order in which contracts call other contracts, initiated by an instance of session code.

Expand Down
2 changes: 1 addition & 1 deletion source/docs/casper/concepts/deploy-and-deploy-lifecycle.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Deploys and the Deploy Lifecycle
title: Deploy Lifecycle
slug: /deploy-and-deploy-lifecycle
---

Expand Down
8 changes: 6 additions & 2 deletions source/docs/casper/concepts/design/casper-design.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Overview of a Casper Network
---
title: Network Design
---

# Casper Network Design

## Introduction

Expand Down Expand Up @@ -225,7 +229,7 @@ Refer to the [Serialization Standard](../serialization-standard.md) for addition

## Tokens {#tokens-head}

Casper is a decentralized Proof-of-Stake blockchain platform that uses a consensus algorithm called [Highway](./highway.md). Having a unit of value is required to make this system work because users must pay for computation, and validators must have [stake](../economics/staking.md) to bond. In the blockchain space, this unit of value is a _token_.
Casper is a decentralized Proof-of-Stake blockchain platform that uses a consensus algorithm called [Highway](./highway.md). Having a unit of value is required to make this system work because users must pay for computation, and validators must have [stake](../economics/staking/staking.md) to bond. In the blockchain space, this unit of value is a _token_.

This chapter describes tokens and how one can use them on the Casper platform.

Expand Down
4 changes: 4 additions & 0 deletions source/docs/casper/concepts/design/highway.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
title: Highway Consensus
---

# The Highway Consensus Protocol

## What is Consensus?
Expand Down
39 changes: 7 additions & 32 deletions source/docs/casper/concepts/design/index.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,11 @@
---
title: Introduction
title: Overview
slug: /design
---

# Design

- [Network Communication](./p2p.md)
- [Identity](./p2p.md#identity)
- [Inter-node connections](./p2p.md#inter-node-connections)
- [Network](./p2p.md#network)
- [Gossiping](./p2p.md#communications-gossiping)
- [Requesting missing data](./p2p.md#requesting-missing-data)
- [Node Discovery](./p2p.md#node-discovery)
- [Execution Semantics](./casper-design.md#execution-semantics-head)
- [Measuring computational work](./casper-design.md#execution-semantics-gas)
- [Deploys](./casper-design.md#execution-semantics-deploys)
- [The Casper Network runtime](./casper-design.md#execution-semantics-runtime)
- [Accounts](./casper-design.md#accounts-head)
- [Creating an account](./casper-design.md#accounts-creating)
- [Permissions model](./casper-design.md#accounts-permissions)
- [The account context](./casper-design.md#accounts-context)
- [Unforgeable Reference (URef)](./casper-design.md##uref-head)
- [Permissions for URefs](./casper-design.md#uref-permissions)
- [Block Structure](./casper-design.md#block-structure-data)
- [Data fields](./casper-design.md#block-structure-data)
- [Tokens](./casper-design.md#tokens-head)
- [Token Generation and Distribution](./casper-design.md#token-generation-and-distribution)
- [Divisibility of Tokens](./casper-design.md#tokens-divisibility)
- [Purses and Accounts](./casper-design.md#tokens-purses-and-accounts)
- [Serialization Standard](../serialization-standard.md)
- [Block](../serialization-standard.md#serialization-standard-block)
- [Deploy](../serialization-standard.md#serialization-standard-deploy)
- [Values](../serialization-standard.md#serialization-standard-values)
- [Keys](../serialization-standard.md#serialization-standard-state-keys)
- [Permissions](../serialization-standard.md#serialization-standard-permissions)
| Topic | Description |
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| [Network Design](./casper-design.md) | Overview of execution semantics, account permissions, URefs, block structure, tokens, and more |
| [Network Communication](./p2p.md) | Peer-to-peer communication for Casper nodes |
| [Highway Consensus](./highway.md) | Brief overview of the Highway Consensus mechanism used in Casper networks |
| [Reading and Writing Data to Global State](./reading-and-writing-to-the-blockchain.md) | Storing and reading data from the blockchain |
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Reading and Writing Data to the Blockchain
---
title: Reading and Writing Data
---

# Reading and Writing Data to Global State

Casper features several means of reading and writing data to global state, depending on user needs and complexity. Reading data from global state can be done by dApps off-chain or by smart contracts on-chain. Writing data requires on-chain interactions due to the nature of the system. Storage in global state can be accomplished using [Dictionaries](../dictionaries.md) or [`NamedKeys`](../../developers/json-rpc/types_chain.md#namedkey).

Expand Down
8 changes: 6 additions & 2 deletions source/docs/casper/concepts/economics/consensus.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: Consensus
---

# Consensus Economics

Highway consensus is a continuous, trust-less process where a fixed set of validators engage in scheduled communication to advance the linear chain of finalized blocks, representing the history of changes to the global state of the blockchain. The fixed set of validators may change at each era boundary. The economics of this layer revolve around validator selection and incentivization of participation according to the schedule.
[Highway consensus](../design/highway.md) is a continuous, trust-less process where a fixed set of validators engage in scheduled communication to advance the linear chain of finalized blocks, representing the history of changes to the global state of the blockchain. The fixed set of validators may change at each era boundary. The economics of this layer revolve around validator selection and incentivization of participation according to the schedule.

## Entry {#entry}

Expand All @@ -19,7 +23,7 @@ Each bid contains a delegation rate and activity status. The delegation rate can

Delegation allows third parties to participate in consensus by adding weight to their preferred validators. Rewards received by validators are distributed in proportion to tokens bid and delegated. The current or prospective validator responsible for the bid receives a portion of the delegator rewards set by the delegation rate.

Currently, delegation is unrestricted. Please visit [Delegation details](./delegation.md) page to check more about delegation cost and related details.
Currently, delegation is unrestricted. Please visit [Delegation details](./staking/delegation.md) page to check more about delegation cost and related details.

## Incentives {#incentives}

Expand Down
8 changes: 6 additions & 2 deletions source/docs/casper/concepts/economics/gas-concepts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Gas and the Casper Blockchain
---
title: Gas Cost
---

# Gas and Resources

import useBaseUrl from '@docusaurus/useBaseUrl';

Expand Down Expand Up @@ -42,7 +46,7 @@ Here is an [example](https://cspr.live/deploy/afeb43036c41e667af8bc34782c48a66cf

## How do I determine the gas cost for a transaction?

Currently, we are hard at work to create tools to help you estimate gas costs. Meanwhile, we recommend using the NCTL tool on your local machine or the [Testnet](https://testnet.cspr.live/) to [deploy your contracts](../../developers/dapps/sending-deploys.md) in a test environment. You can check a deploy status and roughly see how much it would actually cost when deployed. You can estimate the costs in this way and then add a small buffer if the network state has changed. Note that when estimating gas cost locally or on the Testnet, the blockchain specification needs to match the specification of the Mainnet, where you will need to pay for the transaction with actual Casper (CSPR) tokens.
Currently, we are hard at work to create tools to help you estimate gas costs. Meanwhile, we recommend using the NCTL tool on your local machine or the [Testnet](https://testnet.cspr.live/) to [deploy your contracts](../../developers/cli/sending-deploys.md) in a test environment. You can check a deploy status and roughly see how much it would actually cost when deployed. You can estimate the costs in this way and then add a small buffer if the network state has changed. Note that when estimating gas cost locally or on the Testnet, the blockchain specification needs to match the specification of the Mainnet, where you will need to pay for the transaction with actual Casper (CSPR) tokens.

## Why do I see a gas limit error?

Expand Down
6 changes: 2 additions & 4 deletions source/docs/casper/concepts/economics/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
title: Economics Overview
title: Overview
slug: /economics
---

# Economics

This page presents an overview of the Casper economics.
# Overview of Casper Economics

Casper's economic activity can be conceptualized as taking place on four distinct layers: consensus, runtime, ecosystem, and the macroeconomy. Each layer, consensus and up, provides a foundation for the activity taking place on the next layer. A trust-less platform requires that proper incentives be provided to participants operating each of these layers to ensure that they work together to unlock the platform's value.

Expand Down
2 changes: 1 addition & 1 deletion source/docs/casper/concepts/economics/runtime.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Runtime Economics
title: Runtime
slug: /runtime
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
slug: /concepts/economics/concepts
---

# Staking Concepts

The Casper network is a Proof-of-Stake blockchain that allows validators to stake the Casper native token CSPR on the network. Validators receive CSPR as an incentive for continuing to maintain and secure the network. CSPR rewards are distributed as blocks are validated into existence and organized into eras.
Expand Down
Loading

0 comments on commit 73f7cd2

Please sign in to comment.