Demystifying JAM - Presentation
Demystifying
Note:
blog.kianenigma.com/posts/tech/demystifying-jam/
Polkadot 1
- Social
- OpenGov
- DOT Token → Security
- Fellowship
- Technological
- Heterogeneous Execution Sharding, with Shared Security
Note:
Sharding and heterogeneity enabled by the use of WASM.
Heterogeneous Execution Sharding, with Shared Security
Let's break it down:
- Execution Sharding
- With Shared Security
- Heterogeneous
--
Sequential Blockchain
- Opposite of execution sharding.
- How blockchains usually work
--
Poorly Execution Sharded
- Sharding the validator set: less security
--
Execution Sharded with Shared Security
- Original vision of ETH 2 was to be this, with 64 shards.
- ELVES
--
Heterogeneous
- WASM bytecode
--
Evolution of Polkadot
... is all about flexible usage of cores
- You need more to get more out of your core? Async Backing!
- You need more cores? Elastic scaling!
- You don't want to commit to 6m? Agile-coretime!
- You need less than one core? On-demand coretime!
- You want to do something other than a parachain in your core? JAM!
Path of a Parachain Block
--
Path of a Parachain Block
--
Path of a Parachain Block
--
Path of a Parachain Block
--
Path of a Parachain ::: block
Notes:
- Execution by core validators + made available for further auditing
- State root updated by all Polkadot validators
--
On-chain vs. In-core
- In-core
- Executed by a subset of validators + made available for further auditing
- On-chain
- Executed by all validators: state root update.
In-core, on-chain dualism in execution sharding.
--
Data Availability
Polkadot validators already attest to keeping some data available for a long (few weeks) period of time
JAM
Now you know everything to understand JAM.
--
JAM (0)
Gutting of Polkadot such that the following are directly exposed to developers.
- What happens In-core
- What happens On-chain
- What is placed in Data Availability
Note:
A parachain can only control what happens in-core. It cannot really control what happens on-chain. It also cannot readily add any data to the Data availability layer (well, it can, using remarks
, which is a hack)
--
JAM (1)
- ..and removes a lot of blockchain/parachain-centric opinions.
--
JAM (2)
- ..and is therefore an evolution for the Polkadot Relay Chain (Cloud).
- Parachains, Governance, Staking, AH and everything else remains intact.
Removing Opinions
- JAM is programmable via a Service.
- PVM Bytecode.
- Invocation of a service are called a Work Item[1].
- A group of work Items are called Work Package.
Note:
--
In-core and On-chain
- A Service is:
fn refine()
: What happens in-corefn accumulate()
: What happens on-chainfn on_transfer()
: Send messages to other services post accumulate
--
Refine
- Massive amounts of gas available.
- Access to data availability (~28 day persistence)
- No direct access to the JAM state (stateless)
--
Accumulate
- Direct access to the JAM state (stateful)
- Less gas available
- Fully synchronous: Access the refine results of all other services, from possibly all other cores at once.
--
JAM (Recap)
Allowing Services to program exactly how they want to use:
- In-core execution
- On-chain execution
- Data availability
Path of a JAM Work Package
--
Path of a JAM Work Package
Path of a JAM Work Package
Path of a JAM Work Package
--
Path of a JAM Work Package
--
Path of a JAM Work Package
JAM
PVM
- Metered
- Very fast (50% native)
- PVM instance can invoke another instance
- Pause and resume
CoreChains Service
Polkadot Parachains as a JAM Service.
Insights
(personal opinion)
- What is best implemented as a service?
- Low level
- Crucial to get this right
- Polkadot has JAM within it, but it is "fixed"
- Services <> Interoperability
- Semi-coherence
- No transactions? Great!
Note:
- Services will likely not be equivalent to smart contract or even parachains; Think more along the lines of "Kernel functions".
- Crucial to get this right
- Service interoperability? Wrong question.
- Semi-Coherence. Good!
- Polkadot has all the JAM components, but they are fixed.
- Less is more: No transactions? Good!
come to think of it, a smart contract can have arbitrary, user-defined entry-points. A service is not.
--
Questions
Appendix
Kernel Update Analogy
Note:
Hardware is what provides compute and bandwidth, and the kernel is part of the OS that moderates the hardware access.
Current Polkadot. A lot of stuff is part of the "Kernel/OS".
--
--
--
Work Item
graph LR subgraph WorkPackage WI1[Work Item 1] WI2[Work Item 2] WI3[Work Item 3] end subgraph WorkReport WR1[Work Result 1] WR2[Work Result 2] WR3[Work Result 3] end WI1 --> WR1 WI2 --> WR2 WI3 --> WR3
And depending on the context, Work Package, Work Result and Work Report. ↩︎
- Made with 💎 Obsidian-Digital-Garden
- © Kian Paimani 2024. Content on this site is licensed under a Creative Commons Attribution 4.0 International License.