# Customizability and flexibility of parachain node Polkadot is a heterogeneous multi-chain. Polkadot provides the bedrock "relay-chain" upon which a large number of validatable, globally-coherent dynamic data-structures(eg, parachains) may be hosted side-by-side[1]. Thanks to extensibility of relay chain, each parachains has the highest degree of customizability and flexibility both technically and incentive mechanism.Technical and incentive changes will be decided by each para-chain governances and upgrades without a hard fork. Parachain(collator) node can be divided into below 3 technology stack layers. - Blockchain core layer - Substrate runtime layer - Off-chain worker layer ## Blockchain core layer This layer defines blockchain core utilities like a incentive system, block interval, block length, block weight. It is said that one of the general problems of state channel, lightning network is that there is a delay in commitment for open channel and on chain resolution due to state congestion. We can assume that this problem is solved by optimizing the block interval. ## Substrate runtime layer In substrate-based chains, the runtime is referd to as the "state transition function". This layer defines the storage items that are used to represent blockchain's state, the functions that allow blockchain users to make changes to this state. Celer pay runtime module and cApp(eg,condition) is located in this layer of tech stack. Parity teams provide [over 50 general runtime module](https://substrate.dev/docs/en/knowledgebase/runtime/frame) (eg, atomic swap, elections, staking and so on). Each parachains can freely customize the runtime module according to the application. Runtime module is composable in parachain and between parachains. Cross chain transaction is executed by [XCMP](https://hackmd.io/TscdQHxzQT6KmP1xAx7xLQ?view). There is latency in cross chain transaction so we can assume each parachains will specialize according to the domain specific. ## Offchain-worker layer This layer defines the off-chain jobs and off-chain storage. Parachain node can execute jobs like a off-chain data query, recurring submit transaction, recurring read on-chain state and so on. Off-chain storage is mainly used for stored data which is too expensive to store on-chain. Off-chain storage serves as a bridge for various off-chain worker threads to communicate to each others and between off-chain and on-chain logics. More information of off-chain worker is [here](https://hackmd.io/6e8t0EpdRsOb8HACn1a2fA?view). In ethereum, [keep3r.network](https://docs.keep3r.network/), [Chainlink](https://chain.link/), [API3](https://api3.org/) is located in this layer. Entity who outside of ethereum consensus system executes off-chain job. We can assume that offchain subsytem and off-chain data integration is secure and more efficient because these jobs is executed by parachain nodes(collators) who also execute on-chain logic(eg, state transition). But these expensive computation increases overhead of entire parachain. This layer also will specialize according to the domain specific between parachains. ## Reference [1] polkadot whitepaper (https://polkadot.network/PolkaDotPaper.pdf) [2] Substrate developer hub (https://substrate.dev/)