Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos,puntuation mark and wrong spelling and word use in the documentation site #26

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1ace7a3
fix commas and spelling issues
emmz3230 May 31, 2024
f5aff77
fix some word and sentences
emmz3230 May 31, 2024
1c602ae
commas and sentence error fixed
emmz3230 May 31, 2024
0468040
sppelling error
emmz3230 May 31, 2024
9751fce
added comma and correct word
emmz3230 Jun 1, 2024
f5715b2
remove commas and add comma to the right place
emmz3230 Jun 1, 2024
527cabe
remove comma and some word
emmz3230 Jun 1, 2024
1583966
fix typos nd add comma
emmz3230 Jun 1, 2024
c6ef56a
remove word like the, and added comma
emmz3230 Jun 1, 2024
5feb395
add puntuation marks and remove where it is neccesary to remove
emmz3230 Jun 1, 2024
effa4a7
remove punctuation and word spelling
emmz3230 Jun 1, 2024
9ef0044
add punctuation mark
emmz3230 Jun 1, 2024
f7b7624
change word,add puntuations,remove space
emmz3230 Jun 1, 2024
cb2c42f
added space between word and add a word
emmz3230 Jun 1, 2024
f527190
added puntuation mark and remove some words
emmz3230 Jun 1, 2024
cd279b8
change word and add puntuation marks
emmz3230 Jun 1, 2024
16d22b4
add word and punctuation
emmz3230 Jun 1, 2024
50b5280
add words and puntuation marks
emmz3230 Jun 1, 2024
44865de
add word and commas
emmz3230 Jun 1, 2024
f724f4d
add a word and puntuation mark
emmz3230 Jun 1, 2024
ee03850
make space changes
emmz3230 Jun 1, 2024
b7e40ce
fix typos
emmz3230 Jun 1, 2024
7f589cb
fix word spelling
emmz3230 Jun 1, 2024
293f921
remove comma
emmz3230 Jun 1, 2024
fb252d0
change a word position
emmz3230 Jun 1, 2024
06a2d2e
fix typo and add words
emmz3230 Jun 1, 2024
212803b
add some word
emmz3230 Jun 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,105 changes: 5,105 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

89 changes: 68 additions & 21 deletions pages/architecture.en.mdx

Large diffs are not rendered by default.

44 changes: 12 additions & 32 deletions pages/cairo.en.mdx
Original file line number Diff line number Diff line change
@@ -1,43 +1,23 @@
# Cairo
It has been well established within the Ethereum community that rollups are the most effective way to scale Ethereum and remain credibly neutral and decentralized at the same time. This has led to Ethereum's rollup-centric roadmap(opens in a new tab), which is now being worked upon by multiple companies and developers in the Ethereum ecosystem. It's no surprise that we are going to see thousands of rollups in the future. While each rollup is going to be different in terms of business logic and use cases, the technical fundamentals largely fall into one of the two categories: optimistic and ZK rollups. We won't go into the details of the two, but Vitalik's post(opens in a new tab) covers them in detail.

## Ethereum roadmap
In general, my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM computation and ZK rollups are likely to win out for simple payments, exchange and other application-specific use cases, but in the medium to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves.

It has been well established within the Ethereum community that rollups are the most effective way to scale Ethereum
and remain credibly neutral and decentralized at the same time. This has led to Ethereum's [rollup-centric roadmap](https://ethereum-magicians.org/t/a-rollup-centric-ethereum-roadmap/4698)
which is now being worked upon by multiple companies and developers in the Ethereum ecosystem. It's no surprise that we are going to see thousands
of rollups in the future. While each rollup is going to be different in terms of business logic and use cases, the technical fundamentals largely fall into one of the
two categories: Optimistic and ZK rollups. We won't go into the details of the two but Vitalik's [post](https://vitalik.eth.limo/general/2021/01/05/rollup.html) covers them in detail.
- Vitalik

> In general, my own view is that in the short term, optimistic rollups are likely to win out for general-purpose EVM computation and ZK rollups are likely to win out for simple payments, exchange
> and other application-specific use cases, but in the medium to long term ZK rollups will win out in all use cases as ZK-SNARK technology improves.
>
> \- Vitalik
In short, Optimistic rollups are good solutions until we don't have efficient and cheap ZK tech to verify execution. However, once we have that - an ergonomic programming language which can be efficiently proven and easily written - ZK rollups allow near-instant verifiability and composability for app chains, something that cannot just happen with optimistic rollups.

In short, Optimistic rollups are good solutions until we don't have efficient and cheap ZK tech to verify execution. However, once we have that - an ergonomic programming language which
can be efficiently proven and easily written - ZK rollups allow near-instant verifiability and composability for app chains, something which cannot just happen with
Optimistic rollups.
Why Cairo?

## Why Cairo?
Faster Proving

### Faster Proving
Cairo has been built to be provable since day one. While Solidity has been battle-tested over the years, it was never made with proving in mind. It was simply a smart contract language for Ethereum. On the contrary, Cairo has been built by Starkware (the pioneers of ZK technology) and has been optimized for proving and verifiability since the start.

Cairo was built to be provable since day one. While Solidity has been battle-tested over the years, it was
never made considering proving in mind. It was simply a smart contract language for Ethereum. On the contrary,
Cairo has been built by Starkware (the pioneers of ZK technology) and has been optimized for proving and
verifiability since the start.
Image has been taken from here(opens in a new tab)

![cairo_vs_evm](../static/img/cairo_vs_evm.png)
_Image has been taken from [here](<https://www.cairo-lang.org/the-whats-what-of-the-cairo-world/#:~:text=The%20Cairo%20VM%20is%20intentionally,EVM%20(Ethereum%20virtual%20machine).&text=Read%20%5C%20write%20memory%20requires%20more%20computation%20to%20generate%20a%20proof.>)_
A better smart contract language

### A better smart contract language
While Solidity is an older and more popular language for writing smart contracts, it's also the first attempt at creating a smart contract language. As a result, it has had a lot of shortfalls that Cairo has keeping proving aside. This includes, but is not limited to, stack management, linear type systems, and function imports. You can read more about the language here(opens in a new tab).

While Solidity is an older and more popular language for writing smart contracts, it's also the first attempt at creating
a smart contract language. As a result, it has had a lot of shortfalls that Cairo solves keeping proving aside. This includes but is
not limited to stack management, linear type system, and function imports. You can read more about the language [here](https://book.cairo-lang.org/).
Battle-tested ZK tech

### Battle tested ZK tech

The EVM might be older in terms of a smart contract VM. However, when it comes to the zkEVM, it's relatively new and has just started
to get tested. On the other hand, Cairo based app chains go as far back as early as [2021](https://dydx.exchange/blog/public). The Cairo tech has been
used by dYdX, Sorare, Starknet, and many others over the years and today it has been used to trade more than $1 trillion in volume and currently
secure upwards of $700 million in TVL.
The EVM might be older in terms of a smart contract VM. However, when it comes to the zkEVM, it's relatively new and has just started to get tested. On the other hand, Cairo-based app chains go as far back as 2021 (opens in a new tab). The Cairo tech has been used by dYdX, Sorare, Starknet, and many others over the years and today it has been used to trade more than $1 trillion in volume and currently secure upwards of $700 million in TVL.
61 changes: 56 additions & 5 deletions pages/chain-id.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,75 +4,126 @@ import { Steps } from "nextra-theme-docs";

## Fetching your Chain ID:

The default chain ID on Madara is `SN_GOERLI`, to verify your chain ID, a POST call can be made to the RPC endpoint.<br></br>
The default chain ID on Madara is `SN_GOERLI`, To verify your chain ID, a POST call can be made to the RPC endpoint.<br></br>

<Steps>

### Initiate RPC Request:

- Execute the following POST request via curl to query the chain ID from your Madara node.

- Endpoint: http://localhost:9944 (replace with the appropriate remote URL).
``` bash

```bash

curl --location 'http://localhost:9944' \

--header 'Content-Type: application/json' \

--data '{

"id": 0,

"jsonrpc": "2.0",

"method": "starknet_chainId",

"params": {}

}'

```

### Parse Response:

Extract the chain ID in hex format from the "result" field within the JSON response.
``` bash

```bash

{

"jsonrpc": "2.0",

"result": "0x534e5f474f45524c49",

"id": 0

}

```

### Translate Hex:

Use a hex converter tool (e.g., https://stark-utils.vercel.app/converter) to obtain the readable string representation of the chain ID.

</Steps>

## Setting a custom Chain ID:

The Chain ID for your Madara app chain is configured in `crates/runtime/src/pallets.rs`.

In Madara your chain ID is represented as the montgomery representation for a string.
To update this follow the below steps;

To update this, follow the below steps:

<Steps>

### Define your Chain ID:

Choose a string to represent your app chain.

### Convert Chain ID to felt

Navigate to `https://stark-utils.vercel.app/converter` and input your chosen string. The generated felt value is your hexadecimal representation for the string.

![stack](../static/img/stark-utils.png)
### Generate montgomery representation:

### Generate montgomery representation:

Use Starkli to convert the felt value to a montgomery representation compatible with Madara.

```bash

starkli mont 85046245544016

[

18444022593852143105,

18446744073709551615,

18446744073709551615,

530195594727478800,

]

```

### Update the Chain ID:

Open crates/primitives/chain-id/src/lib.rs and add your Chain ID alongside existing definitions:

```rust

pub const MY_APP_CHAIN_ID: Felt252Wrapper = Felt252Wrapper(starknet_ff::FieldElement::from_mont([

18444025906882525153,

18446744073709551615,

18446744073709551615,

530251916243973616,

]));

```

### Update `pallets.rs`:

- Modify the import statement in `crates/runtime/src/pallets.rs` to include your new Chain ID definition (refer to https://github.com/keep-starknet-strange/madara/blob/main/crates/runtime/src/pallets.rs#L13 for reference).

- Update the usage of the Chain ID within the code itself (refer to https://github.com/keep-starknet-strange/madara/blob/main/crates/runtime/src/pallets.rs#L164 for reference).

Rebuild your Madara app chain with the updated pallets.rs file. Your app chain will now operate with your custom Chain ID.
Expand Down
40 changes: 30 additions & 10 deletions pages/config.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,59 @@ import { Steps } from "nextra-theme-docs";
# Configuration

In this section, we will look at the different parameters you can tweak as a runtime engineer

for your blockchain to be perfectly tailored to your needs.

| Parameter | Location | Interpretation | Default |
| Parameter | Location | Interpretation | Default |

| ------------------- | ------------------------------ | ------------------------------------------------------------------------------------ | --------- |
| MILLISECS_PER_BLOCK | `crates/runtime/src/config.rs` | Average expected block time targeted. | 6000 (ms) |
| BlockHashCount | `crates/runtime/src/config.rs` | Maximum number of block number to block hash mappings to keep (oldest pruned first). | 2400 |

| MILLISECS_PER_BLOCK | `crates/runtime/src/config.rs` | Average expected block time targeted. | 6000 (ms) |

| BlockHashCount | `crates/runtime/src/config.rs` | Maximum number of block number to block hash mappings to keep (oldest pruned first). | 2400 |

The core component of Madara is a custom substrate pallet named `starknet` which you can find under `crates/pallets/starknet`.

However as mentioned in the introduction, Madara is generic by essence.
It defines a set of types in its configuration specifically the traits that should be implemented by these types **NOT** the types themselves.
However, as mentioned in the introduction, Madara is generic in essence.

It defines a set of types in its configuration, specifically the traits that should be implemented by these types, NOT the types themselves.

This very powerful concept will allow you to easily change core components of your chain.

Let's take a look at these types and their default values.

```rust

// `crates/runtime/src/pallets.rs`

// ...

/// Configure the Starknet pallet in pallets/starknet.

impl pallet_starknet::Config for Runtime {

type RuntimeEvent = RuntimeEvent;

type StateRoot = pallet_starknet::state_root::IntermediateStateRoot<Self>;

type SystemHash = mp_starknet::crypto::hash::pedersen::PedersenHasher;

type TimestampProvider = Timestamp;

type UnsignedPriority = UnsignedPriority;

}

```

| Type | Interpretation | Default |
| Type | Interpretation | Default |

| ----------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| RuntimeEvent | Event type that will be emitted on extrinsics' execution. | Substrate RuntimeEvent |
| StateRoot | Defines how the state root is computed from the state. | [Starknet State Root](https://docs.starknet.io/documentation/architecture_and_concepts/State/starknet-state/#state-commitment) |
| SystemHash | Hashing function used to compute commitments. | Pedersen |
| TimestampProvider | Defines how the timestamp is retrieved (used for block timestamp) | [Timestamp Pallet](https://docs.rs/pallet-timestamp/latest/pallet_timestamp/) |

| RuntimeEvent | Event type that will be emitted on extrinsics' execution. | Substrate RuntimeEvent |

| StateRoot | Defines how the state root is computed from the state. | [Starknet State Root](https://docs.starknet.io/documentation/architecture_and_concepts/State/starknet-state/#state-commitment) |

| SystemHash | Hashing function used to compute commitments. | Pedersen |

| TimestampProvider | Defines how the timestamp is retrieved (used for block timestamp) | [Timestamp Pallet](https://docs.rs/pallet-timestamp/latest/pallet_timestamp/) |
24 changes: 16 additions & 8 deletions pages/contribute.en.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@ import { Callout } from "nextra-theme-docs";

# Contribute to Madara

Madara has been built from the day 1 in the most open-source way possible, and will always follow the principles that drive the Starknet ecosystem since day 1.
Madara has been built from day 1 in the most open-source way possible and will always follow the principles that have driven the Starknet ecosystem since day 1.

Anyone is free to join the telegram group [here](https://t.me/MadaraStarknet), come chat, ask for help, discuss anything!

Regular community calls are also organized which you will always find the agenda in the [GitHub dicussions](https://github.com/keep-starknet-strange/madara/discussions).
Regular community calls are also organized, and you will always find the agenda in the [GitHub dicussions](https://github.com/keep-starknet-strange/madara/discussions).

<Callout type="info" emoji="🧪">
Have an idea of an ambitious hack related to one layer of the stack ? Such as
a new DA mode or a fancy new VM ? Go ahead and create a discussion on the
GitHub repo, if all good you'll be invited to present it at one community call
and then start implementing it!

Have you got an idea of an ambitious hack related to one layer of the stack ? Such as

a new DA mode or a fancy new VM ? Go ahead and create a discussion on the

GitHub repo, if all is well, you'll be invited to present it at a community call

and then start implementing it!

</Callout>

## Developers

Madara contributions are rewarded through [OnlyDust](https://app.onlydust.xyz/).<br></br>
_What does that mean ?_ It means that you as a developer are free to pick any open issue and submit a PR. Once the PR is merged you will be paid according to the time/difficulty of the PR.

What does that mean ? It means that you, as a developer, are free to pick any open issue and submit a PR. Once the PR is merged, you will be paid according to the time and difficulty of the PR.

There are already more than 20 contributors and we are just waiting for you 😎

## Bug Hunting
Expand All @@ -26,4 +34,4 @@ Found a bug ? Please submit an [issue](https://github.com/keep-starknet-strange/

## Documentation

Missing anything in these docs ? Spotted a typo ? Please submit a PR or create an issue on [GitHub](https://github.com/EvolveArt/madara-docs/). As everything we do, we grow together and the more eyes we have looking at it the better it will be.
Missing anything in these documents? Spotted a typo ? Please submit a PR or create an issue on [GitHub](https://github.com/EvolveArt/madara-docs/). As everything we do, we grow together and the more eyes we have looking at it the better it will be.
Loading