On Documenting polkadot-sdk

I have been trying to improve polkadot-sdk's documentation for more than a year now. It has been a difficult journey, and admittedly beyond what I and a handful of others can reasonably solve.

As a lot of teams are applying to solve the same problems through governance and/or Decentralized Futures, I am sharing my retrospective of a year+ of working on this. I will also share how I believe teams getting funding will be most effective in working on this:.

To a large extent, I am wrapping up my contributions to this effort. My intention in writing this is to ensure all of my thoughts around it are publicly available, should they be useful to anyone in posterity. All of this is my personal opinion, and not Parity's.

Generally, when I refer to polkadot-sdk here, I mean a subset of the tools in Polkadot SDK that one needs to build a meaningful and useful application on Polkadot. That is, at the minimum: FRAME, Substrate, XCM and some offchain library to build a UI. A high level understanding of Polkadot itself is also needed. In summary:
flowchart
	polkadot[Polkadot as a Platform] --> polkadot_sdk
	polkadot_sdk --> onchain
	polkadot_sdk --> offchain 
	onchain --> substrate
	onchain --> frame
	onchain --> xcm
	offchain --> subxt
	offchain --> PAPI
	offchain --> PJS-API

Retrospective

The Bad

I will start by acknowledging that explaining polkadot[/-sdk] is hard. This is what I learned both from doing async documentation, and participating as a teacher in the Polkadot Blockchain Academy.

  1. First, there is a lot of Web3 background knowledge that needs to be explained, or assumed. More troublesome, Polkadot itself is a unique Web3 system, and has lots of novel concepts: Origins, Extrinsic, Runtime, Runtime API, Forkless Runtime upgrades and its implications, Host Functions, Metadata, Dispatch, Core (Polkadot Core), Parachain. I am not even opening the jar of all XCM related concepts here.
  2. Rust is a difficult language, and the intricate way we decided to use it does not help.
  3. Moreover, the space moves fast. Look at the material around polkadot-sdk 2 years ago. A lot of it is less and less relevant today. Heck, even the name polkadot-sdk was not around, we are still in the process of re-establishing polkadot-sdk as a replacement of substrate[1].

The Good

It is worth emphasizing here that this increased longevity applies to (new) content that is already correct and up-to-date.
I have demonstrated an example of this here.

With this hypothesis, I believe there are two tools future educators can use to help with this:

  1. polkadot-sdk-docs: A strong foundation of API docs, references on foundational topics, and examples that are guaranteed to be always correct (because they live in polkadot-sdk repository and are always compiled as a part of its CI). Some of the FAQ that might be asked about this crate is covered in:
    1. Why Rust Docs?
    2. Scope
    3. Principles
  2. Recordings from the Polkadot Blockchain Academy. I hope to see the latest Singapore edition be out soon (as the XCM module has undergone significant changes), but for now the Hong Kong recordings are an excellent resource.

The Future

Wishlist

This is how I think teams applying for funding regarding documentation will be most impactful.

Forward-Looking

All in all, I suggest educators to focus on creating tutorials on forward-looking topics, even if it means producing less.

You might argue that a lot of this is pretty advanced, and hard to grasp for those who are outside the circle of core contributors of polkadot-sdk, and you are right about that. And this brings me to the next point.

Expect Better

Expect better from core devs of polkadot-sdk. Foundational knowledge that explains the basics of an API and how it is intended to be used is not a nice-to-have, but a must. Core developers should provide the foundation for educators and technical writers in the space to create new content about the latest features. I hope to see most of this low level documentation to live in polkadot-sdk-docs.

Finally, to make this process fruitful, you, as educators, build on top of the core documentation and backlink to it. This creates a strong mutual incentive for both parties to benefit from one another and maintain provide their share of the work. More specifically, I would imagine that polkadot-sdk maintainers will be more and more encouraged to provide foundational API documentation, if they know these are often used.

Build on the shoulder of giants, as the saying goes.

Awesome Lists

There are so many cool developer tools out there, yet I am surprised to not often find them. I think the best way to aggregate these are indeed a standard awesome-list. We have an old one that is no longer maintained by Parity, and a new community driven awesome-dot. I hope to see a consolidation of the two into awesome-polkadot, with a dedicated maintainer.


  1. I am of the opinion that we should stop using "Substrate" as a keyword, and use "Polkadot SDK" as much as possible instead. Substrate should not be used as a standalone term, and instead it is a part of Polkadot SDK. ↩︎

  2. I am most excited about exploring the idea of opinionated frame_system variants. As in, FRAME is not frame_system. A runtime can be written with FRAME, and not use frame_system. An opinionated frame_system can be one that is 1. has more assumptions, and already encompasses multiple pallets in it, such as timestamp 2. has fewer generics, and more types hard-coded. ↩︎

  3. Explaining the typical example of allowing free transactions if one has a valid personhood certificate. ↩︎

  4. I am sure more exists, yet I am not familiar with them, see Awesome Lists. ↩︎