Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 9d89e08

Browse files
Merge pull request #36 from NilFoundation/nil-initial
Nil initial
2 parents 0919488 + 9840f0b commit 9d89e08

File tree

13 files changed

+333
-14
lines changed

13 files changed

+333
-14
lines changed

.vscode/settings.json

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
{
44
"language": "mdx",
55
"scheme": "file"
6+
},
7+
{
8+
"language": "markdown",
9+
"scheme": "file"
610
}
711
]
812
}

docusaurus.config.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ const config = {
8282
[
8383
'@docusaurus/plugin-content-docs',
8484
{
85-
id: 'zksharding',
86-
path: 'zksharding',
87-
routeBasePath: 'zksharding',
88-
sidebarPath: './sidebars.js'
85+
id: 'nil',
86+
path: 'nil',
87+
routeBasePath: 'nil',
88+
sidebarPath: './sidebar-nil.js'
8989
}
9090
],
9191
],
@@ -126,8 +126,8 @@ const config = {
126126
},
127127
{
128128
position: 'left',
129-
label: 'zkSharding',
130-
to: 'https://nil.foundation/blog/post/nil_zkSharding'
129+
label: '=nil;',
130+
to: '/nil/intro'
131131
},
132132
{
133133
position: 'left',

nil/intro.mdx

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import Thesis from '@site/static/img/nil/nil-icons/thesis.png'
2+
import Principles from '@site/static/img/nil/nil-icons/principles.png'
3+
import {Card, CardSection} from '@site/src/components/CardSection'
4+
5+
# Overview
6+
7+
## Definition
8+
9+
=nil; is a sharded blockchain that leverages the following features:
10+
11+
* **Modularity**. =nil; offers an execution layer while using Ethereum for data availability and consensus.
12+
* **Horizontal scalability**. In =nil;, execution is spread across shards, allowing for completing tasks in parallel.
13+
* **Vertical scalability**. Validator implementation in =nil; is scaled vertically via intra-shard parallelization.
14+
15+
=nil; offers an effective strategy for scaling Ethereum while avoiding the limitations typically associated with the modular approach such as state and liquidity fragmentation.
16+
17+
:::tip[Why =nil;?]
18+
19+
As =nil; is highly scalable, it is ideal for applications that are demanding in terms of algorithm complexity, or time and memory usage:
20+
21+
* Crowdsourcing platforms
22+
* Autonomous virtual worlds
23+
* Decentralized exchanges
24+
25+
:::
26+
27+
## Structure of the Documentation
28+
29+
### Introduction
30+
31+
Learn the basics of what =nil; is and how it works.
32+
33+
<CardSection>
34+
<Card icon={<img src={Thesis}/>} id='thesis' title='Thesis' description='Read about the "how" and "why" of =nil;' to='./thesis'/>
35+
<Card icon={<img src={Principles}/>} id='principles' title='Principles' description='Grasp the fundamentals of the architecture of =nil;' to='./principles'/>
36+
</CardSection>

nil/principles.mdx

Whitespace-only changes.

nil/thesis.mdx

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import Flows from '@site/static/img/nil/flows.png'
2+
3+
# Thesis
4+
5+
This page explains the rationale behind the architecture of =nil; and provides insight into how =nil; resolves the fundamental monolithic vs. modular dispute.
6+
7+
## Problem statement
8+
9+
The rollup-centric roadmap to scaling Ethereum and the rise in the popularity of rollups introduced a significant issue: state fragmentation.
10+
11+
State fragmentation means that parts of Ethereum's global state are effectively scattered across systems that are distinct from Ethereum itself. This leads to the following outcomes:
12+
13+
* Liquidity and users are spread across various networks all of which have a unique infrastructure
14+
* Cross-network operations being difficult to secure, resulting in more hacks
15+
* Worsened developer and user experience. It falls either on developers or users to ensure cross-chain operations which adds an unnecessary layer of complexity
16+
17+
The architecture of =nil; is designed specifically to resolve these issues.
18+
19+
## Solution
20+
21+
Instead of focusing on improving interoperability (which only produces a 'bandaid' fix to the fragmentation problem), the goal of =nil; is to maximise scalability.
22+
23+
=nil; achieves this by integrating both horizontal and vertical scaling supported by zkSharding.
24+
25+
:::info[Definitions]
26+
27+
**Horizontal scaling** refers to improving the throughput of a chain by adding more nodes.
28+
29+
**Vertical scaling** is improving the throughput of a chain by upgrading the capacity of existing nodes or upgrading hardware utilization.
30+
31+
**zkSharding** is a type of sharding architecture in which the shards responsible for execution algo generate zero-knowledge proofs (ZKP) verifying intra-shard state transitions. There is also a dedicated shard for coordinating execution shards and communicating with Ethereum.
32+
33+
:::
34+
35+
zkSharding allows for combining horizontal and vertical sharding within the scope of one sharded network.
36+
37+
* More shards can be added as needed without compromising security
38+
* Nodes in a shard can employ parallelized VMs for vertical intra-shard scaling
39+
40+
Cross-shard communications are incorporated directly into the =nil; protocol. This means that the issue of fragmentation is avoided entirely as each shard can call contracts deployed on a different shard via transactions verified through ZKP.
41+
42+
## Flows
43+
44+
The following diagram shows how =nil; organizes execution shards, the main shard, the transfer of ZKPs, and communications with Ethereum.
45+
46+
<img src={Flows}/ >

sidebar-nil.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default {
2+
nil: [
3+
{
4+
type: 'category',
5+
label: 'Introduction',
6+
collapsed: false,
7+
collapsible: true,
8+
items: [
9+
{
10+
type: 'doc',
11+
label: 'Overview',
12+
id: 'intro',
13+
},
14+
{
15+
type: 'doc',
16+
label: 'Thesis',
17+
id: 'thesis'
18+
},
19+
{
20+
type: 'doc',
21+
label: 'Principles',
22+
id: 'principles'
23+
}
24+
]
25+
},
26+
27+
]
28+
}

src/components/CardSection/index.tsx

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import React, { ReactNode, PropsWithChildren } from 'react';
2+
import Link from '@docusaurus/Link';
3+
import clsx from 'clsx';
4+
5+
export function CardSection({
6+
id,
7+
title,
8+
children,
9+
description,
10+
className,
11+
hasSubSections = false,
12+
HeadingTag = 'h3',
13+
}: {
14+
id?: string;
15+
title: string;
16+
children: ReactNode;
17+
description?: ReactNode;
18+
hasSubSections?: boolean;
19+
HeadingTag?: keyof JSX.IntrinsicElements;
20+
className?: string;
21+
}) {
22+
return (
23+
<div
24+
className={clsx(
25+
'homepage-section',
26+
hasSubSections && 'has-sub-sections',
27+
className
28+
)}
29+
>
30+
{title && <HeadingTag id={id ?? title}>{title}</HeadingTag>}
31+
{description && <p className="section-description">{description}</p>}
32+
<div className="section-content">{children}</div>
33+
</div>
34+
);
35+
}
36+
37+
export function Card({
38+
id,
39+
icon,
40+
title,
41+
description,
42+
to,
43+
tag,
44+
className,
45+
}: PropsWithChildren<{
46+
id?: string;
47+
icon?: JSX.Element;
48+
title: string;
49+
description?: string;
50+
to: string;
51+
tag?: {
52+
label: string;
53+
color: string;
54+
description: string;
55+
};
56+
className?: string;
57+
}>) {
58+
return (
59+
<Link to={to} className={clsx("homepage-card",className)}>
60+
{icon && <div className="icon">{icon}</div>}
61+
<div className="card-content">
62+
<div className="title" id={id && title}>
63+
{title}
64+
</div>
65+
{description && <div className="description">{description}</div>}
66+
</div>
67+
{tag && (
68+
<div className="tag absolute right-0 top-0 h-16 w-16">
69+
<span
70+
className="absolute right-[-28px] top-[-2px] w-[80px] rotate-45 transform bg-gray-600 py-1 text-center font-semibold text-white"
71+
style={{ backgroundColor: tag.color }}
72+
title={tag.description}
73+
>
74+
{tag.label}
75+
</span>
76+
</div>
77+
)}
78+
</Link>
79+
);
80+
}

src/components/HomepageFeatures/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ const ProductsList =
3131
image: zkSharding,
3232
description: (
3333
<>
34-
<p>=nil; zkSharding is the first Ethereum zkRollup with sharding — an alternative to the current Ethereum scalability ecosystem.</p>
35-
<p>The unique combination of zkRollup and sharding enables secure and parallel transaction execution across dedicated shards while maintaining Ethereum's economic security and providing application developers with full composability and transparent data access.</p>
34+
<p>=nil; is a sharded blockchain that resolves Ethereum scalability issues via zkSharding.</p>
35+
<p>=nil; aims to achieve global scale without state, liquidity or user fragmentation.</p>
3636
<p><a href="https://nil.foundation/blog/post/nil_zkSharding">https://nil.foundation/blog/post/nil_zkSharding</a></p>
37+
<p>Documentation, tutorials and recipes for application developers, proof producers, and validators.</p>
3738
</>
3839
),
3940
},
@@ -95,7 +96,7 @@ export default function HomepageNilProducts() {
9596
<div className={'row' + ' ' + styles.rowFlex}>
9697
<div className='col col-6'>
9798
<div id='zk-sharding-docs'>
98-
<NilProduct image={ProductsList[2].image} description={ProductsList[2].description} onDocsClick={GoToDocs("https://nil.foundation/blog/post/nil_zkSharding")}></NilProduct>
99+
<NilProduct image={ProductsList[2].image} description={ProductsList[2].description} onDocsClick={GoToDocs("/nil/intro")}></NilProduct>
99100
</div>
100101
</div>
101102
<div className='col col-6'>

0 commit comments

Comments
 (0)