Workspace IndexKnowledge Notes › Solana

#181PoC

Solana

EVM-vs-Solana study + a sample Anchor program on devnet.

Not yet scoped.

Why

A deliberate non-EVM data point: every other on-chain demo here is Ethereum-family (Hyperliquid, Sepolia AA, PBS); Solana is the largest ecosystem with a genuinely different execution model, worth understanding rather than assuming EVM concepts transfer.

How it works

Planned: an Anchor (Rust) program deployed to Solana devnet — starting with a PDA-based counter, then a small SPL-token escrow to exercise Solana's account model (all state passed in explicitly, rather than living in contract storage) and cross-program invocations. The page would connect via Phantom/wallet-adapter and call the program through its Anchor-generated TypeScript client. Not yet built.

Related code

# Solana's account model — unlike EVM contract storage, all state lives in accounts
# that are passed into every instruction explicitly. Simulates a PDA-based counter
# program: the "program" has no storage of its own, only the accounts it's handed.

import hashlib
from dataclasses import dataclass, field


@dataclass
class Account:
    pubkey: str
    owner_program: str
    data: dict = field(default_factory=dict)


def find_program_address(seeds: list, program_id: str) -> str:
    """Mimic Solana's deterministic PDA derivation (real PDAs also walk bump seeds
    off the ed25519 curve; this stdlib version just needs to be deterministic)."""
    joined = b"".join(seed.encode() for seed in seeds) + program_id.encode()
    return "PDA_" + hashlib.sha256(joined).hexdigest()[:16]


COUNTER_PROGRAM_ID = "Counter1111111111111111111111111111111111"


def initialize_counter(owner_pubkey: str) -> Account:
    """Every account a Solana program touches must be passed in explicitly — there
    is no implicit contract storage the way EVM `SSTORE` provides."""
    pda = find_program_address(["counter", owner_pubkey], COUNTER_PROGRAM_ID)
    return Account(pubkey=pda, owner_program=COUNTER_PROGRAM_ID, data={"count": 0})


def increment(counter_account: Account, signer_pubkey: str) -> None:
    """The 'instruction': operates only on the account object it's handed, never on
    hidden global state — this is the account model the card's howItWorks names."""
    if counter_account.owner_program != COUNTER_PROGRAM_ID:
        raise PermissionError("account not owned by this program")
    counter_account.data["count"] += 1
    print(f"  signer={signer_pubkey[:8]}... incremented {counter_account.pubkey[:12]}... "
          f"-> count={counter_account.data['count']}")


if __name__ == "__main__":
    print("Solana account model — PDA-based counter (state passed in, not stored implicitly)\n")

    owner = "User11111111111111111111111111111111111111"
    counter = initialize_counter(owner)
    print(f"Derived PDA for owner: {counter.pubkey}")
    print(f"Owned by program:      {counter.owner_program}\n")

    print("Calling increment three times, passing the account explicitly each time:")
    for _ in range(3):
        increment(counter, owner)

    print(f"\nFinal on-chain state (lives in the account, not the program): {counter.data}")

Where it lands in Jayverse

  • Dark Horse: use the Anchor PoC to test whether a Dark Horse idea actually needs Solana. A small PDA counter and SPL escrow is the cheapest way to check whether any Dark Horse candidate needs Solana's parallel execution rather than an EVM devnet.
  • Devnet: keep this study standalone. Jayverse's own devnet stays Anvil/EVM; the Solana PoC's job is comparison, not adding a second chain to any current service's critical path.

Key expressions

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

Expression뜻 · 쓰이는 자리
data point하나의 사례, 참고 자료 · 여러 비교 대상 중 의미 있는 표본 하나를 가리킬 때. "a deliberate non-EVM data point"
exercise (a model)(기능을) 실제로 시험해보다, 활용해보다 · 이론이 아니라 코드로 직접 그 구조를 써볼 때. "to exercise Solana's account model"
cross-program invocation프로그램 간 호출(CPI) · 솔라나에서 한 프로그램이 다른 프로그램을 호출하는 방식. "cross-program invocations"
passed in explicitly명시적으로 전달되다 · 상태가 암묵적으로 저장되는 게 아니라 매번 인자로 넘겨질 때. "all state passed in explicitly"
worth understanding이해할 가치가 있는 · 당연시하지 말고 제대로 짚고 넘어가야 할 대상을 말할 때. "worth understanding rather than assuming EVM concepts transfer"
AA계정 추상화(Account Abstraction) · 이더리움에서 지갑을 스마트컨트랙트처럼 다루는 표준(ERC-4337 등), 이 카탈로그의 다른 데모("Sepolia AA")가 다루는 주제. "Hyperliquid, Sepolia AA, PBS"
PBS제안자-빌더 분리(Proposer-Builder Separation) · 블록 생성자와 제안자를 분리하는 이더리움 아키텍처, 이 카탈로그의 다른 데모가 다루는 주제. "Sepolia AA, PBS"
PDA프로그램 파생 주소(Program Derived Address) · 개인키 없이 프로그램이 결정론적으로 파생시켜 소유하는 솔라나 계정 주소, EVM의 컨트랙트 스토리지에 대응하는 솔라나식 상태 저장 방식. "starting with a PDA-based counter"
SPL솔라나 프로그램 라이브러리 토큰 표준(Solana Program Library Token) · 솔라나의 표준 토큰 규격, 이더리움의 ERC-20에 대응. "a small SPL-token escrow"

← All Knowledge Notes · Workspace Index · Top ↑

솔라나

EVM-vs-솔라나 비교 연구 + devnet 위 샘플 Anchor 프로그램.

아직 범위 미정.

의도적으로 넣은 non-EVM 비교 대상입니다 — 여기 있는 다른 온체인 데모는 전부 이더리움 계열(Hyperliquid, Sepolia AA, PBS)이고, Solana는 실행 모델 자체가 다른 가장 큰 생태계라 EVM 개념이 그대로 통한다고 가정하지 않고 별도로 이해할 가치가 있습니다.

동작 방식

계획: Solana devnet에 배포하는 Anchor(Rust) 프로그램 — PDA 기반 카운터로 시작해서, Solana의 계정 모델(컨트랙트 저장소가 아니라 모든 상태를 명시적으로 전달)과 cross-program invocation을 연습할 수 있는 소규모 SPL 토큰 에스크로로 이어집니다. 페이지는 Phantom/wallet-adapter로 연결하고, Anchor가 생성한 TypeScript 클라이언트로 프로그램을 호출할 예정입니다. 아직 미구현.

관련 코드

# Solana's account model — unlike EVM contract storage, all state lives in accounts
# that are passed into every instruction explicitly. Simulates a PDA-based counter
# program: the "program" has no storage of its own, only the accounts it's handed.

import hashlib
from dataclasses import dataclass, field


@dataclass
class Account:
    pubkey: str
    owner_program: str
    data: dict = field(default_factory=dict)


def find_program_address(seeds: list, program_id: str) -> str:
    """Mimic Solana's deterministic PDA derivation (real PDAs also walk bump seeds
    off the ed25519 curve; this stdlib version just needs to be deterministic)."""
    joined = b"".join(seed.encode() for seed in seeds) + program_id.encode()
    return "PDA_" + hashlib.sha256(joined).hexdigest()[:16]


COUNTER_PROGRAM_ID = "Counter1111111111111111111111111111111111"


def initialize_counter(owner_pubkey: str) -> Account:
    """Every account a Solana program touches must be passed in explicitly — there
    is no implicit contract storage the way EVM `SSTORE` provides."""
    pda = find_program_address(["counter", owner_pubkey], COUNTER_PROGRAM_ID)
    return Account(pubkey=pda, owner_program=COUNTER_PROGRAM_ID, data={"count": 0})


def increment(counter_account: Account, signer_pubkey: str) -> None:
    """The 'instruction': operates only on the account object it's handed, never on
    hidden global state — this is the account model the card's howItWorks names."""
    if counter_account.owner_program != COUNTER_PROGRAM_ID:
        raise PermissionError("account not owned by this program")
    counter_account.data["count"] += 1
    print(f"  signer={signer_pubkey[:8]}... incremented {counter_account.pubkey[:12]}... "
          f"-> count={counter_account.data['count']}")


if __name__ == "__main__":
    print("Solana account model — PDA-based counter (state passed in, not stored implicitly)\n")

    owner = "User11111111111111111111111111111111111111"
    counter = initialize_counter(owner)
    print(f"Derived PDA for owner: {counter.pubkey}")
    print(f"Owned by program:      {counter.owner_program}\n")

    print("Calling increment three times, passing the account explicitly each time:")
    for _ in range(3):
        increment(counter, owner)

    print(f"\nFinal on-chain state (lives in the account, not the program): {counter.data}")

Jayverse에서의 위치

  • Dark Horse: Anchor PoC로 Dark Horse 아이디어가 실제로 Solana를 필요로 하는지 테스트한다. 작은 PDA 카운터와 SPL 에스크로가 Dark Horse 후보 중 어떤 것이 EVM devnet이 아니라 Solana의 병렬 실행을 필요로 하는지 확인하는 가장 저렴한 방법이다.
  • Devnet: 이 연구는 독립적으로 유지한다. Jayverse 자체 devnet은 Anvil/EVM으로 남는다. Solana PoC의 역할은 비교이지, 어떤 현재 서비스의 크리티컬 패스에 두 번째 체인을 추가하는 것이 아니다.

핵심 표현

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

Expression뜻 · 쓰이는 자리
data point하나의 사례, 참고 자료 · 여러 비교 대상 중 의미 있는 표본 하나를 가리킬 때. "a deliberate non-EVM data point"
exercise (a model)(기능을) 실제로 시험해보다, 활용해보다 · 이론이 아니라 코드로 직접 그 구조를 써볼 때. "to exercise Solana's account model"
cross-program invocation프로그램 간 호출(CPI) · 솔라나에서 한 프로그램이 다른 프로그램을 호출하는 방식. "cross-program invocations"
passed in explicitly명시적으로 전달되다 · 상태가 암묵적으로 저장되는 게 아니라 매번 인자로 넘겨질 때. "all state passed in explicitly"
worth understanding이해할 가치가 있는 · 당연시하지 말고 제대로 짚고 넘어가야 할 대상을 말할 때. "worth understanding rather than assuming EVM concepts transfer"
AA계정 추상화(Account Abstraction) · 이더리움에서 지갑을 스마트컨트랙트처럼 다루는 표준(ERC-4337 등), 이 카탈로그의 다른 데모("Sepolia AA")가 다루는 주제. "Hyperliquid, Sepolia AA, PBS"
PBS제안자-빌더 분리(Proposer-Builder Separation) · 블록 생성자와 제안자를 분리하는 이더리움 아키텍처, 이 카탈로그의 다른 데모가 다루는 주제. "Sepolia AA, PBS"
PDA프로그램 파생 주소(Program Derived Address) · 개인키 없이 프로그램이 결정론적으로 파생시켜 소유하는 솔라나 계정 주소, EVM의 컨트랙트 스토리지에 대응하는 솔라나식 상태 저장 방식. "starting with a PDA-based counter"
SPL솔라나 프로그램 라이브러리 토큰 표준(Solana Program Library Token) · 솔라나의 표준 토큰 규격, 이더리움의 ERC-20에 대응. "a small SPL-token escrow"

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