Workspace IndexKnowledge Notes › Linera microchains

#182PoC

Linera microchains

One chain per user — removing blockspace contention instead of pricing it.

Reference — docs/knowledge/linera-microchains.html.

Why

Almost every scaling design here takes contention as a given and competes for the block: PBS auctions it, gas prices it, a relayer sequences around it. Linera's premise is that contention is a choice — give each user their own chain and there is nothing to contend for. Worth reading precisely because it rejects the assumption the rest of the catalogue is built on.

How it works

Reading note: the microchain model where each user owns a chain they alone extend, validators run all of them, and cross-chain messages replace shared-state contention. The interesting question the note tracks is not throughput but composability — what happens to an application whose whole point is that many users touch the same state, like an order book.

Related code

"""Linera microchains PoC -- one chain per user, plus a cross-chain message delivery.
Illustrates the core mechanism: independent per-user chains remove contention for a
shared block; interaction between users happens via explicit cross-chain messages.
"""

from dataclasses import dataclass, field


@dataclass
class Microchain:
    owner: str
    blocks: list[str] = field(default_factory=list)
    inbox: list[str] = field(default_factory=list)

    def extend(self, operation: str) -> None:
        """Only the owner extends their own chain -- no contention with anyone else."""
        self.blocks.append(operation)

    def receive(self, message: str) -> None:
        self.inbox.append(message)
        self.blocks.append(f"applied cross-chain message: {message}")


class Validator:
    """Runs every microchain, and relays messages between them."""

    def __init__(self):
        self.chains: dict[str, Microchain] = {}

    def create_chain(self, owner: str) -> Microchain:
        chain = Microchain(owner=owner)
        self.chains[owner] = chain
        return chain

    def send_cross_chain(self, sender: str, recipient: str, message: str) -> None:
        self.chains[sender].extend(f"send to {recipient}: {message}")
        self.chains[recipient].receive(f"from {sender}: {message}")


if __name__ == "__main__":
    validator = Validator()
    alice = validator.create_chain("alice")
    bob = validator.create_chain("bob")
    carol = validator.create_chain("carol")

    # Each user extends their own chain independently -- no shared block to contend for.
    alice.extend("deposit 10 USDC")
    bob.extend("deposit 5 USDC")
    carol.extend("deposit 20 USDC")

    # One cross-chain message: alice pays bob. This is the only point where chains touch.
    validator.send_cross_chain("alice", "bob", "pay 3 USDC")

    for name, chain in validator.chains.items():
        print(f"\nchain[{name}] blocks:")
        for b in chain.blocks:
            print(f"  - {b}")

Where it lands in Jayverse

  • Verex: keep the CLOB on one shared chain rather than assuming it composes under sharding. The order book is exactly the shared-state case this note flags as hard for a per-user microchain model, so if Jayverse ever considers sharding by user, exclude Verex's book from that plan explicitly.
  • Devnet: read this as confirmation that Devnet's single shared chain is a deliberate choice. Most Jayverse services (Verex, Token/Bridge) depend on shared state that a per-user chain would fragment, so contention-removal-by-sharding is not a direction to pursue without a specific reason.

Key expressions

Words and phrases from this page worth keeping, with the Korean meaning and the sentence they come from.

Expression뜻 · 쓰이는 자리
take X as a givenX를 당연한 전제로 여기다 · 다른 접근법들이 의심 없이 받아들이는 가정을 지적할 때. "takes contention as a given"
compete for~을 두고 경쟁하다 · 한정된 자원(블록 공간)을 서로 차지하려 할 때. "compete for the block"
reject the assumption전제를 거부하다, 근본 가정 자체를 부정하다 · 남들과 다른 출발점을 취할 때. "it rejects the assumption the rest... is built on"
extend (a chain)체인을 이어나가다, 확장하다 · 사용자가 자기 체인에 블록을 계속 추가할 때. "a chain they alone extend"
the whole point핵심, 가장 중요한 요지 · 논의에서 진짜 중요한 부분이 무엇인지 짚을 때. "an application whose whole point is that many users touch the same state"
contend for~을 놓고 다투다, 경합하다 · 공유 자원을 두고 여러 참여자가 겨룰 때. "there is nothing to contend for"
PBS제안자-빌더 분리(Proposer-Builder Separation) · 블록 생성 권한을 경매로 분리해 컨텐션을 가격 매기는 구조의 예. "PBS auctions it, gas prices it"

← All Knowledge Notes · Workspace Index · Top ↑

Linera 마이크로체인

사용자당 체인 하나 — 블록스페이스 경합에 값을 매기는 대신 없애버리기.

참조 — docs/knowledge/linera-microchains.html.

여기 있는 거의 모든 확장 설계는 경합을 주어진 것으로 두고 블록을 놓고 경쟁합니다 — PBS는 경매에 부치고, 가스는 값을 매기고, 릴레이어는 그 주위로 순서를 잡습니다. Linera의 전제는 경합이 선택이라는 것입니다: 사용자마다 자기 체인을 주면 다툴 대상이 없습니다. 카탈로그의 나머지가 딛고 선 가정을 정면으로 거부하기 때문에 읽을 가치가 있습니다.

동작 방식

정독 노트: 각 사용자가 자기만 확장하는 체인을 소유하고, 검증자들이 그 전부를 돌리며, 공유 상태 경합을 체인 간 메시지가 대체하는 마이크로체인 모델. 노트가 따라가는 흥미로운 질문은 처리량이 아니라 조합 가능성입니다 — 여러 사용자가 같은 상태를 건드리는 것이 존재 이유인 애플리케이션(오더북 같은)은 어떻게 되는가.

관련 코드

"""Linera microchains PoC -- one chain per user, plus a cross-chain message delivery.
Illustrates the core mechanism: independent per-user chains remove contention for a
shared block; interaction between users happens via explicit cross-chain messages.
"""

from dataclasses import dataclass, field


@dataclass
class Microchain:
    owner: str
    blocks: list[str] = field(default_factory=list)
    inbox: list[str] = field(default_factory=list)

    def extend(self, operation: str) -> None:
        """Only the owner extends their own chain -- no contention with anyone else."""
        self.blocks.append(operation)

    def receive(self, message: str) -> None:
        self.inbox.append(message)
        self.blocks.append(f"applied cross-chain message: {message}")


class Validator:
    """Runs every microchain, and relays messages between them."""

    def __init__(self):
        self.chains: dict[str, Microchain] = {}

    def create_chain(self, owner: str) -> Microchain:
        chain = Microchain(owner=owner)
        self.chains[owner] = chain
        return chain

    def send_cross_chain(self, sender: str, recipient: str, message: str) -> None:
        self.chains[sender].extend(f"send to {recipient}: {message}")
        self.chains[recipient].receive(f"from {sender}: {message}")


if __name__ == "__main__":
    validator = Validator()
    alice = validator.create_chain("alice")
    bob = validator.create_chain("bob")
    carol = validator.create_chain("carol")

    # Each user extends their own chain independently -- no shared block to contend for.
    alice.extend("deposit 10 USDC")
    bob.extend("deposit 5 USDC")
    carol.extend("deposit 20 USDC")

    # One cross-chain message: alice pays bob. This is the only point where chains touch.
    validator.send_cross_chain("alice", "bob", "pay 3 USDC")

    for name, chain in validator.chains.items():
        print(f"\nchain[{name}] blocks:")
        for b in chain.blocks:
            print(f"  - {b}")

Jayverse에서의 위치

  • Verex: 샤딩해도 자연히 합성될 거라 가정하지 말고 CLOB을 하나의 공유 체인에 둔다. 오더북은 이 노트가 사용자별 마이크로체인 모델에서 어렵다고 지적하는 바로 그 공유 상태 사례이므로, 사용자별 샤딩을 고려하게 되더라도 Verex의 오더북은 명시적으로 그 계획에서 제외한다.
  • Devnet: 이 노트를 Devnet이 단일 공유 체인을 쓰는 것이 의도된 선택이라는 확인으로 읽는다. Verex, Token/Bridge 같은 대부분의 Jayverse 서비스는 사용자별 체인이 쪼개버릴 공유 상태에 의존하므로, 샤딩으로 경합을 없애는 방향은 특별한 이유 없이는 추구할 방향이 아니다.

핵심 표현

이 페이지의 영어 본문에서 배울 만한 단어와 표현, 뜻과 나온 자리.

Expression뜻 · 쓰이는 자리
take X as a givenX를 당연한 전제로 여기다 · 다른 접근법들이 의심 없이 받아들이는 가정을 지적할 때. "takes contention as a given"
compete for~을 두고 경쟁하다 · 한정된 자원(블록 공간)을 서로 차지하려 할 때. "compete for the block"
reject the assumption전제를 거부하다, 근본 가정 자체를 부정하다 · 남들과 다른 출발점을 취할 때. "it rejects the assumption the rest... is built on"
extend (a chain)체인을 이어나가다, 확장하다 · 사용자가 자기 체인에 블록을 계속 추가할 때. "a chain they alone extend"
the whole point핵심, 가장 중요한 요지 · 논의에서 진짜 중요한 부분이 무엇인지 짚을 때. "an application whose whole point is that many users touch the same state"
contend for~을 놓고 다투다, 경합하다 · 공유 자원을 두고 여러 참여자가 겨룰 때. "there is nothing to contend for"
PBS제안자-빌더 분리(Proposer-Builder Separation) · 블록 생성 권한을 경매로 분리해 컨텐션을 가격 매기는 구조의 예. "PBS auctions it, gas prices it"

← 전체 기술 노트 · 워크스페이스 인덱스 · 맨 위 ↑