[DIS] CKB Textbook: Computing Common Knowledge Community Grants Proposal

Introduction

While we are seeing an increase in educational content about CKB here and there, our information about CKB L1 itself is somewhat lacking compared to other ecosystems of similar maturity level. Further, CKB is quite unique in its philosophy & architecture, and this uniqueness is apparent in nearly every subsystem of CKB. This deserves proper exposition which we do not have today.

CKB should be one of the top L1’s today based on technical merit. However, the best developers in the space and the most technical ones lack a go-to resource to really dig in and learn more about this beeautiful invention in a systematic way. Because of this, they ultimately move onto other ecosystems like Ethereum. This book is made to attract the best technical talents with the resource to start building on Nervos so that CKB can finally get the exposure and adoption it so rightly deserves.

If you really want to understand something, you have to understand it from first principles. This textbook is a first-principles introduction to CKB. But, since CKB’s design decisions are quite thoughtful and broadly relevant, they can serve as useful insights for blockchain architecture & engineering in general . I believe CKB is a very good blockchain to use as the foundational example of good blockchain design. So this book is simultaneously about both CKB and blockchain protocol engineering in general. This also enables the textbook to appeal to a wider audience, which only benefits us as a community & the industry at large.

So, a textbook about designing and building a blockchain, starting from the fundamentals, is one goal of this proposal. By using CKB as the specific blockchain discussed throughout all chapters of the textbook, the second goal is to explain CKB in a more holistic and deeper way than any other resource about CKB has done thus far.

My Background

I have worked in the blockchain industry at multiple layer 1 protocols, including having worked on Nervos from the early days since before testnet release. I was involved in the design of some of the earliest standards we have. Further, I founded Tempest which - despite the fact we lost funding - took advantage of every single unique aspect of CKB to construct a revolutionary new programming model I have come to refer to as “programmable automatons”. This highlights the fact that I understand what makes CKB & the cell model unique, as well as how to apply that uniqueness at the application level.

Most recently, I’ve designed a new L1 from scratch and designed a new consensus protocol which involved the authorship of many technical documents and education materials.

I’ve worked with top people in the space in across a variety of notable projects, which gives me a good social circle in which to solicit feedback, public review, and sharing as well.

Given my background in the industry, as well as the number of years I’ve been involved with Nervos specifically, I believe I am a good candidate to write such a book for the CKB community. Now that some of my other endeavors have calmed down, I also have the time to do this writing.

The Publishing Plan

The book would be a “living document” which CKB community members could view the progress of at any time. When the book is finished (it will be versioned) it will be published on the publishing platform built on top of CKB L1. This is the same platform as the platform that the last chapter of the book walks through building. This platform can be used for other materials created by future CKB community contributors as well.

The book will then be stewarded by the CKB community; “shares” will be minted using some of the platform’s features which give voting power to shareholders. Shareholders can then propose and vote on updates to the textbook contents and will collectively control & govern the on-chain authoritative record of the book. This allows us all to keep it up to date in a way that preserves the integrity of the content and keeps the community’s interests at heart. How shares will be distributed is to be determined, but I have a couple of ideas that I’ll share for discussion when I’ve fleshed them out a bit more (open to suggestions as well).

I may do something community oriented about the cover art as well. But will make the determination when the book is closer to being finished.

It is possible that we will also decide to publish physical copies. In this case, all sales proceeds will go directly to the community DAO fund.

If given a grant (details on request in section following the Book Contents), I will complete this project by August, 2024.

The book contents are shown below (subject to change as the book unfolds)

The Book Contents

Part 1: Foundations

  1. The Problem of Consensus
  2. Blockchain Based Consensus
  3. Introduction to Game Theory and Cryptoeconomics
  4. All the Cryptography You Need to Know
  5. Blockchain Protocol Design Process, Patterns and Problems
  6. Smart Contracts
  7. Bitcoin, Ethereum, and CKB

Part 2: Consensus

  1. Evaluating Consensus Protocols
  2. The State of Consensus Research
  3. Rate Limiting Mechanisms & Sybil Attacks
  4. Nakomoto Consensus
  5. CKB and NC-MAX
  6. Synchronization & Communication Protocols

Part 3: Execution Layer

  1. Design Considerations & Tradeoffs in Execution Layers
  2. The UTXO Model
  3. The Account Model
  4. Resource Oriented Models
  5. The Cell Model & its Data Structures
  6. EVM, RISC-V, WASM and Move: A Comparison
  7. The Economics of Execution

Part 4: State Model & Storage

  1. How Execution and Consensus Design Affect Storage Size & Growth
  2. Data Structures: DAGs, Trees, and Tries
  3. Transactional vs Analytic Databases or Why & How to Index the Blockchain
  4. The Economics of Global State

Part 5: Applications

  1. Decentralized Application Architecture on CKB
  2. Introduction to Smart Contracts on CKB
  3. Programming Patterns for Cells and Cell-Based Transactions
  4. Useful Tools
  5. Project: A Decentralized Publishing Platform
  6. Conclusion & Where to Go From Here

Budget

I suspect this book will take ~800 hours to write, including research required, development of exercises and problems, etc. That, combined with the development of the book website, organizing community graphics, promotion of the book, and editing, will take even more hours. Due to the impact I expect this book to have on the ecosystem & industry at large, combined with the magnitude of work required, I am requesting $165,000. I request this amount in CKB at a CKB price valuation of 1CKB/$0.004 - this is slightly higher price valuation than current market conditions, but I believe it is irrelevant due to CKB’s bright future. The reason for selecting a higher price point is to ensure there is buffer room between now and when the vote is held (if it passes this stage), as I’d rather take a little bit less from the DAO fund than a little bit more.

At the above-mentioned price point, the requested compensation in CKB comes to a total of 37,500,000 CKB.

These funds will be used in the following way:

  1. To compensate myself for the time I take to write the book and coordinate everything
  2. Hosting and other technical costs
  3. Compensation of contributors, reviewers and editors
  4. Design and development of the book website
  5. Development & deployment of the publishing platform (including the CKB required to store the contracts on chain)
12 Likes

Wowow my Friday just became amazing seeing this! :fire: I only really hang out in Nervos Nation and occasionally lurk here, but this proposal pushed me to finally create a forum account. I was part of the Tempest community too and was totally bummed when it didn’t work out. So I’ve known of Tannr’s work for a while now, and can confidently say that if there’s anybody who should be writing this CKB book, it’s this true OG.

Good luck Tannr, and let’s rally CKB supporters!

Hi Tannr,

I’m sure you would do a excellent job writing a book like this, probably the only person outside Nervos who would understand it enough to do so.

But whether or not your proposal is good value for the DAO, the big issue I see is that it’s a heap of money (CKB) for a reasonably long timeframe project and payed out in full when CKB is pretty much at ATL.

I personally would more likely consider voting for something like this if it was payed out either:

(a) Monthly over the year.

(b) Paid out after each section of the book is completed. (First amount paid in advance)

This way you would still receive the full amount in $, but the DAO would get the advantage of any rise in the price of CKB. Of course we take the risk that the price goes down further, so there’s that to think about as well.

But anyway, would this be something you would consider?

6 Likes

Hey Yeti - thank you for your reply.

I am totally open to splitting up the payouts if that is how the DAO would like to structure it.

To break each one down approach down:

Per Section

There are 5 parts to the book. Each payout would be released after completion of the section, with the exception of section 1, which is paid out in advance to provide the funds to start the project. In this case, it would be $33,000 per section (165,000 / 5)

Per month

With an expected delivery date of next August, that is 15 months (since this wouldnt start until this June due to voting periods etc). In this case, it would be $11,000 / month.

I am fine w/ either. With the per month approach, the DAO is in a better position to take advantage of price increase, while also more exposed to price decrease.

HOWEVER, since i am pricing the CKB at 1CKB/$0.004, this helps mitigate risk of price decrease. In the event that CKB price exceeds $0.004, we would use the current market price. So essentially I am proposing to price it at $0.004 OR market price, whichever is higher.

So, if CKB price drops further, this floor price of $0.004 is even better for the DAO as it completely eliminates the otherwise increase in CKB payout amount. If the price exceeds $0.004, then it also is good for the DAO, since it decreases the CKB payout amount. Either way, the DAO is automatically hedging against losses for any funds not-yet distributed… If the full amount is paid and then CKB price skyrockets, then that of course would not be great for the DAO.

Anyway, 100% open to either of these models. So let’s keep the conversation going!

3 Likes

Ok, that’s great you are at least open to the idea, it opens up some options, let’s see what everyone else thinks.

As the price of CKB is what most of us probably consider low at the moment and with the halvings of both CKB and BTC falling within the timeframe of the project, my opinion is this would be a good opportunity to take the risk on paying the funds over the life of the project.

3 Likes

As a community textbook, it should be free for community creators to use, and it is also funded by the community. I feel that should not consider the issue of later sales. If it is not a Nervos community developer, I should not need it.

Regarding the budget funds, I feel that it is too much. $165,000 (37,500,000 CKB) surprised me. I feel that you can only write the NERVOS part and lead the beginner developers to use ckb tutorials, so as to leave ample funds for CKB Community Fund DAO, so that the community can develop well.

6 Likes

Tanner, I support this Proposal. You have shown your worth over the years and you would be a perfect fit for writing a book on nervous. Thumbs up and I hope you get it.

3 Likes

I think the budget is too high, can you tell me what contribution you have made in nervos?

Hey there. I appreciate you taking the time to share your thoughts and participate in the discussion here. Unfortunately, I am having a really tough time understanding the point you’re making; I’ve re-read your post several times over the past 24 hours and still can’t understand it.

I’ll try to clarify exactly what I find confusing.

First,

As a community textbook, it should be free for community creators to use, and it is also funded by the community. I feel that should not consider the issue of later sales

  1. I agree it should be free for creators to use. And I obviously agree it is funded by the community. I think what you might be saying here is that community should not have to both fund it and pay to read it… I agree. The future sales of physical publishing was referring to sales to a wider market. I can easily issue a voucher to allow every community member who helped contribute to the book via vote or by other means to receive a copy for free.

Second,

Regarding the budget funds, I feel that it is too much. $165,000 (37,500,000 CKB) surprised me. I feel that you can only write the NERVOS part and lead the beginner developers to use ckb tutorials, so as to leave ample funds for CKB Community Fund DAO, so that the community can develop well.

I understand that you feel the proposed price is too much. What I don’t understand is the following sentences which I assume are meant to explain why it is too much. When you say “I feel that you can only write the NERVOS part and lead the beginner developers to use ckb tutorials”, I believe you’re suggesting this as an alternative to the textbook that is equal in impact while also significantly cheaper. If this is the case, then I have to disagree: the textbook will have significantly wider reach. It not only will serve as a high quality resource to help retain prospective ckb developers who wish to learn about CKB deeply. It will also serve as a means to introduce many talented developers wishing to learn blockchain in general from a high quality, advanced resource. As such, it will also bring developers into the ecosystem who would never have become aware of it in the first place. Finally, to be the first ecosystem to construct such a resource will be a big boost for the community in my opinion. Especially since I some resources that will enable me to get the book into the “classroom”, so to speak.

So, while I understand that you believe the cost estimate is too high, I don’t think the reason implied in your post justifies that belief.

If this is not desired by the community, though, then that is perfectly fine! That’s great information for me to have & I am glad we have this medium over which we can have these discussions.

1 Like

Can you explain why you think the budget is too high? Is it because you don’t think this will be an impactful project?

I gave a little synopsis of my relationship to Nervos in the “My Background” section of the proposal. I’m wondering if you read the full proposal?

Hi Tanner, onboarding as many developers as possible to Nervos is always a high priority, so I am glad to see your proposal.

As far as I know, Cryptape team is also working on developer education, including but not limited to docs hackathon, developer marketing, and more. So, I would suggest you discuss your CKB textbook idea with @janx (or Crystal) to perfect your contents and avoid repetitive things.

Moreover, CKB Academy is committed to ensuring that new CKB developers have an easy learning curve, by providing easy-to-understand interactive courses and friendly documentation. It is open source, so I am wondering if it is a better idea for you to make content contributions to CKB Academy rather than a new CKB book?

3 Likes

Nice - I’m really glad to see these resources being developed.

I think that the CKB Academy & other related education materials can help to fill in some sections of the textbook. But the textbook is slightly different in its goal & impact, I think. I find the distinction somewhat analogous to the distinction between, say, Ethereum Foundations very in depth documentation vs the book Mastering Ethereum (which serves as reference material in many OTHER courses about Ethereum and blockchain in general).

This textbook would, I believe, serve as a strong foundational reference for many other courses yet-to-be-taught about blockchain in general and Nervos. The fact it achieves a balance between both makes it as wide reaching as possible while being as beneficial to CKB community as possible.

1 Like

Having said that @JackyLHH , by sourcing some of the CKB related contents from these courses (especially for the introductory & intermediate content in Part 5, as well as some chapters & sections in Part 3), we could reduce the amount of hours required and, consequently, the cost.

So, perhaps this can get the best of both worlds: reduced costs & time, while also getting the textbook.

1 Like

TLDR; I recommend that the CKB community not be influenced by the tutorials we are creating and assess this proposal as an independent endeavor.

What We’re Working On

At Cryptape, we are currently focusing on creating new tutorials and how-to guides. We believe that a critical missing component in CKB documentation is detailed step-by-step guides designed for specific use cases that could help developers build what they want.

Currently, we are working on two new tutorials:

  1. Hello World - A simple tutorial that will give developers an idea of what it’s like to work with CKB.
  2. An NFT How-To - This tutorial will explain how to create and have fun with NFTs on CKB, along with explanations of key concepts and helpful tips.

Thoughts on Documentation

Technical documentation consists of different types of documents such as references, tutorials, how-to guides, and explanations. Tutorials serve as entry-level documents to show developers basic operations while how-to guides provide step-by-step instructions for completing specific tasks. References are accurate handbooks used to get more details about SDK/API (sometimes auto-generated) and understand the inner workings (not every developer cares), while explanations provide insight into why things were designed a certain way or the history/principles behind them.

Technical documentation is part of developer education which requires teaching skills beyond just being a good developer. Developers can do the job but sometimes they’re not the best teachers. For example, Andreas M. Antonopoulos who authored is not a Bitcoin core team member. Each teacher has their own style and techniques, some make their students laugh some don’t.

While we already have a solid permissionless platform (which recently passed 10m blocks without pause!), what we need most are various forms of developer education materials along with gifted “teachers” and advocates who can help others learn how to build on CKB.

I’d be happy to witness more efforts toward developer education. It is possible that the most exceptional and well-received documentation could originate from someone within our community, who knows!

7 Likes

I think most of the contents of Part1, Part2, and Part3, Part4 have been covered by

these articles are clear. Perhaps we need a better page to organize these articles, so that interested people can have a single entry to understand the big picture of CKB’s core design.

At present, what the CKB community lacks most is not these contents, but programming paradigms, best practices, and more cases about the cell model (target of Part5). So far, there are still a small number of people who really understand and grasp the huge potential of the Cell model. We need more people to understand the cell model and explore its possibilities in more dimensions.

In view of the fact that the total reserve of CKB Community Dao is only more than 200 million CKB and its current low price, it is necessary to carefully consider the extraction of 37 million CKB for Textbook. Perhaps it is reasonable to some extent to denominate in US dollars.

BTW, I think this is a great material for learning development on CKB, but it is in Chinese and out of date. (Welcome to CKB Docs)

8 Likes

I think the main target of this book should be developers. It is most appropriate to write directly on github or gitbook. Since it is similar to tutorials, it should only be deployed on the testnet. To sum up, I don’t think 2, 4, and 5 of the funds are necessary.

On nervos, do you have other projects besides Tempest, after all Tempest is not going on

2 Likes

@tianlitao I worked at the foundation lol. No, I don’t have any applications currently running on Nervos.
L
My profile on this forum site can give an idea of what some of the things I’ve done.

2 Likes

Those articles touch upon the topics that would be covered. I agree the topics overlap… this isn’t different from, say, the fact that an article posted in hackernoon can cover how servers work, as does a textbook on networking architecture.

Which is more in depth and appealing to the highly technical person?

I guess what you’re saying, then, is you don’t think information at textbook-level depth for these topics is worth the cost at the moment?

1 Like

I stand by Tanner’s proposal. You would be keen to observe the positive externalities taking place in this proposal, such as Tanner’s attention to Nervos as a base for app development in parallel. His textbook would be the first stepping stone of a bigger picture.

1 Like

Indeed, I think the CKB community does not need more content to discuss why CKB is better from the dimensions of consensus algorithm, programming model, economic model, etc. There have been many such elaborations, and this is not something that ordinary developers are keen to pay attention to.

And these explanatory content occupies most of the space in your arrangement.

What the community lacks is what better things can be made through CKB. Because in the past few years, the community has been always discussing why CKB’s various designs are better, but there is no really concrete thing to show, I can open a post on talk to index all these contents if needed.

5 Likes