0Pricing
Web3 & DApp Development Fundamentals · レッスン

メッセージングプロトコル

LayerZero、CCIP

「メッセージングプロトコル」はCoddyKit上の無料Web3 & DApp Development Fundamentalsレッスンです。 これはレッスン4/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これはWeb3 & DApp Development Fundamentals学習パスの一部であり、ウェブとCoddyKitアプリ全体で進捗が同期されます。 Web3 & DApp Development Fundamentalsコースには全4レッスンが含まれています。

このレッスンの一部はまだ翻訳されておらず、英語で表示されています。

Beyond Token Bridges

Moving tokens is just the start. Cross-chain messaging protocols let contracts on one chain send arbitrary data and trigger functions on another.

This generalizes bridging into full cross-chain application logic.

What Is a Messaging Protocol?

A messaging protocol is infrastructure that delivers a payload from a source-chain contract to a destination-chain contract, with some security guarantee about authenticity.

Developers build on top of it instead of operating their own validators.

Generic Message Passing

With generic message passing (GMP), you can send any encoded data — not just token amounts.

A single message can instruct a destination contract to mint, vote, update state, or call any function.

sendMessage(
    destChainId,
    destContract,
    abi.encode("setReward", 500)
);

LayerZero

LayerZero is a messaging protocol that uses two independent parties: an Oracle (delivers block headers) and a Relayer (delivers proofs).

A message is valid only if both agree, so security relies on these two being independent and not colluding.

LayerZero Endpoints

Apps integrate via on-chain endpoints. A contract calls send on its source endpoint and implements lzReceive to handle incoming messages.

function lzReceive(
    uint16 srcChain,
    bytes srcAddress,
    uint64 nonce,
    bytes payload
) external {
    // handle the cross-chain message
}

Chainlink CCIP

CCIP (Cross-Chain Interoperability Protocol) from Chainlink uses its decentralized oracle network to relay messages and tokens.

It adds a separate Risk Management Network that independently monitors for anomalies and can pause transfers.

CCIP Messages

CCIP messages can carry data, tokens, or both. Developers send an EVM2AnyMessage and pay fees in LINK or the native gas token.

Client.EVM2AnyMessage message =
  Client.EVM2AnyMessage({
    receiver: abi.encode(dest),
    data: payload,
    tokenAmounts: tokens,
    feeToken: linkAddress
  });

Security Through Independence

Both LayerZero and CCIP aim to remove single points of failure by separating roles (oracle vs relayer, or DON vs risk network).

The security argument is that compromising the system requires colluding across independent components.

Idempotency and Replay Protection

Receiving contracts must guard against duplicate delivery. Messages carry a nonce so handlers can ensure each is processed exactly once.

This is the same replay-protection principle bridges need.

require(!seen[srcChain][nonce], "dup");
seen[srcChain][nonce] = true;

Use Cases

Generic messaging enables powerful patterns:

  • Cross-chain governance — vote on one chain, execute on another
  • Omnichain tokens — one token usable everywhere
  • Cross-chain DeFi — borrow on A, use on B

Putting It Together

Messaging protocols like LayerZero and CCIP deliver arbitrary cross-chain messages, enabling omnichain applications. They reduce trust by separating independent roles and require replay protection in receiving contracts.

This completes your cross-chain journey.

Quick Check

Test your messaging protocol knowledge.

Recap: Messaging Protocols

You learned that:

  • Messaging protocols deliver arbitrary cross-chain data, not just tokens
  • LayerZero uses independent oracle + relayer; apps implement lzReceive
  • Chainlink CCIP uses a DON plus a risk-management network
  • Receivers need nonce-based replay protection
  • They enable omnichain governance, tokens, and DeFi

Course complete!

よくある質問

「メッセージングプロトコル」レッスンは無料ですか?

はい。「メッセージングプロトコル」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Web3 & DApp Development Fundamentalsコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Web3 & DApp Development Fundamentalsコースには全4レッスンが含まれています。

「メッセージングプロトコル」で何を学びますか?

LayerZero、CCIP ブラウザで直接実行するハンズオンコードでWeb3 & DApp Development Fundamentalsを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。

Web3 & DApp Development Fundamentalsを始めるのに経験は必要ですか?

事前経験は必要ありません。CoddyKitのWeb3 & DApp Development Fundamentalsは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン4/4です。

「メッセージングプロトコル」レッスンにはどのくらい時間がかかりますか?

ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。

このWeb3 & DApp Development Fundamentalsレッスンでコードを書いて実行できますか?

はい。すべてのWeb3 & DApp Development Fundamentalsレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。

このコースのすべてのレッスン

  1. クロスチェーンの概念
  2. ブリッジアーキテクチャ
  3. ブリッジのセキュリティリスク
  4. メッセージングプロトコル
← Web3 & DApp Development Fundamentalsに戻る