Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ npm run dev
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.



[Documentation](docs/Chainlib.md)

191 changes: 191 additions & 0 deletions docs/Chainlib.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# ChainLib Documentation
**Empowering Stories, Decentralized Freedom**

**Mission:** Own your stories, engage your readers, and earn from your content with blockchain transparency.

**ChainLib** is a decentralized e-library and NFT-powered publishing platform built to empower writers and readers through blockchain technology. It is being developed **on Starknet**, a Layer 2 ZK-rollup that ensures scalability, transparency, and censorship resistance

ChainLib provides a censorship-resistant, creator-first publishing experience eliminating middlemen, securing digital ownership, and rewarding reader engagement.

ChainLib enables:

* **Authors** to mint books as NFTs, retain creative rights, and earn royalties directly.
* **Readers** to discover unique works, own digital editions, and support authors without intermediaries.
* **All content** to be securely stored using decentralized technologies like **IPFS**, ensuring permanence and accessibility.

Built entirely on **Starknet**, ChainLib benefits from fast, scalable, and secure transactions without compromising decentralization.


## Why ChainLib Exists

The traditional publishing model is riddled with intermediaries, unfair revenue splits, and limited global access. ChainLib exists to:

* Empower writers with full ownership and transparent earnings.
* Provide readers with access to original, verifiable, and collectible digital content.
* Create a fair and direct relationship between authors and readers.
* Preserve cultural content through permanent blockchain storage.
* Make it possible for niche communities to thrive outside of mainstream publishing.
* Reduce censorship and gatekeeping by enabling authors to publish globally without centralized approval.

## Key Features

### Decentralized Storage

Books are all decentralized ensuring they’re censorship-resistant and permanently available. IPFS hash references are embedded in each book’s NFT metadata, guaranteeing integrity and traceability.

### NFT Publishing on Starknet

Every published book is minted as an **NFT (Non-Fungible Token)** using Starknet’s NFT standard. These NFTs are verifiable, collectible, and transferable. Books may include limited editions, token-gated chapters, or bonus content exclusive to holders.

### Cairo Smart Contracts

Royalty distribution, access rights, and ownership are all managed through **Cairo smart contracts** on Starknet, ensuring transparency and eliminating the need for intermediaries. Creators define royalty percentages and resale rights during publication.

### Reader Engagement & Rewards

Readers earn achievements and ranks by reading, reviewing, collecting, and engaging with content. XP points, reading challenges, and review streaks foster community participation and influence visibility.

### Wallet Integration (Starknet Wallets)

ChainLib supports **Starknet-compatible wallets** such as **Argent X** and **Braavos**, enabling easy onboarding and secure authentication. Wallet login unlocks book purchases, airdrops, and access to private author-reader experiences.

### Secondary Markets

ChainLib NFTs can be listed on emerging Starknet NFT marketplaces. Resale royalties are enforced via ChainLib’s smart contracts.

### Tokenbound Accounts

Each author and reader profile is bound to a smart contract wallet, enabling portable reputation and composable identity across the Starknet ecosystem.

## Getting Started: For Writers

### 1. Connect Your Starknet Wallet

Use **Argent X** or **Braavos** to sign in. All publishing actions are secured via wallet transactions.

### 2. Create an NFT Author Profile

Mint your on-chain identity, which stores your publishing history, profile details, and wallet address.

### 3. Agree to Publishing Terms

Accept a publishing contract stored on-chain, defining revenue splits and licensing terms.

### 4. Upload Your Book

Through the Author Dashboard:

* Upload manuscript (PDF, ePub, mobi)
* Add metadata: title, synopsis, language, license
* Upload cover art
* Choose pricing and access tiers
* Set royalty and resale rights

### 5. Mint Book NFT

After uploading, the book is minted as an NFT on Starknet. Readers can collect, access, or trade it.

### 6. Earn & Engage

Monitor your earnings, special editions, and host token-gated AMAs or book readings.

## Getting Started: For Readers

### 1. Connect Wallet

Use a Starknet wallet to access ChainLib. You can browse free books or buy NFTs.

### 2. Customize Your Preferences

Choose genres, languages, and authors to personalize your feed.

### 3. Browse Books

Filter by:

* NFT availability
* Genre, tags
* Popularity or rating

### 4. Read or Collect

* Read online or download
* Buy the NFT version for access to rare features or community perks

### 5. Earn Rewards

Gain XP, badges, and ranking boosts by:

* Reviewing books
* Completing reading challenges
* Sharing books with others

### 6. Join the Community

Participate in events, giveaways, and author-reader discussions.



## Book Categories

ChainLib supports:

* Fiction
* Non-Fiction
* Sci-Fi & Fantasy
* Memoirs
* Picture Books
* Poetry
* Graphic Novels
* Religious & Philosophical Texts
* Academic & Research
* Cultural Heritage
* DIY Guides
* Children's Books

## Educational & Cultural Impact

ChainLib supports:

* Underserved authors and communities
* Preservation of indigenous literature
* Free access to educational content
* Multilingual publishing and translation tools


### Stack Overview

* **Frontend**: Next.js (React)
* **Smart Contracts**: Cairo 1.0
* **Wallets**: Starknet (Argent X, Braavos)
* **Backend**: Node.js, SQLite
* **Storage**: IPFS
* **Indexing**: Starknet Indexers (custom subgraphs planned)
* **Authentication**: Starknet wallet sign-in

### Contributions

* Fork → Feature branch → Pull Request
* Include tests and clear descriptions

### Issues & Feature Requests

Please report via GitHub Issues.


## Frequently Asked Questions

**Can I use ChainLib without crypto?**
Yes, you can read free content without crypto. Buying NFT editions requires a wallet and on Starknet.

**Are my books permanently stored?**
Yes, all content is stored on onchain.

**Can I publish anonymously?**
Yes. You can use a pseudonymous wallet and publish without personal information.

**Can I resell NFT books?**
Yes. Book NFTs are transferable and enforce royalties via ChainLib smart contracts.

**Will I need to pay gas fees?**
A small gas fee applies to minting and transactions. Starknet keeps fees minimal.
Loading