Pharos 백서

Pharos

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 18쪽 중 7쪽

b8d09816bc211386d/src/v2/MessageTransmitterV2.sol#L143). The message recipient must implement the following methods to handle messages based on their finality threshold: * Implement [IMessageHandlerV2#handleReceiveFinalizedMessage](https://github.com/circlefin/evm-cctp-contracts/blob/63ab1f0ac06ce0793c0bbfbb8d09816bc211386d/src/interfaces/v2/IMessageHandlerV2.sol#L35) to receive messages with `finalityThresholdExecuted` ≥ 2000. * Implement [IMessageHandlerV2#handleReceiveUnfinalizedMessage](https://github.com/circlefin/evm-cctp-contracts/blob/63ab1f0ac06ce0793c0bbfbb8d09816bc211386d/src/interfaces/v2/IMessageHandlerV2.sol#L51) to receive messages with `finalityThresholdExecuted` < 2000. This distinction allows the recipient to control the level of finality it requires before accepting a message. ## Message Format ### Message Header The top-level message header format is standard for all messages passing through CCTP. | Field | Offset | Solidity Type | Length (bytes) | Description | | --------------------------- | ------ | ------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------- | | `version` | 0 | `uint32` | 4 | Version identifier - use 1 for CCTP | | `sourceDomain` | 4 | `uint32` | 4 | Source domain ID | | `destinationDomain` | 8 | `uint32` | 4 | Destination domain ID | | `nonce` | 12 | `bytes32` | 32 | Unique message nonce (see [CCTP V2 Nonces](#cctp-v2-nonces)) | | `sender` | 44 | `bytes32` | 32 | Address of MessageTransmitterV2 caller on source domain | | `recipient` | 76 | `bytes32` | 32 | Address to handle message body on destination domain | | `destinationCaller` | 108 | `bytes32` | 32 | Address permitted to call MessageTransmitterV2 on destination domain, or bytes32(0) if message can be received by any address | | `minFinalityThreshold` | 140 | `uint32` | 4 | Minimum finality threshold before allowed to attest (see [CCTP V2 Finality Thresholds](#cctp-v2-finality-thresholds)) | | `finalityThresholdExecuted` | 144 | `uint32` | 4 | Actual finality threshold executed from source chain (see [CCTP V2 Finality Thresholds](#cctp-v2-finality-thresholds)) | | `messageBody` | 148 | `bytes` | dynamic | App-specific message to be handled by recipient | #### Nonces A CCTP nonce is a unique identifier for a message that can only be used once on the destination domain. Circle assigns CCTP nonces offchain. The nonce for each message in a transaction can be queried through the [`GET /v2/messages`](https://developers.circle.com/api-reference/cctp/all/get-messages-v2) endpoint, using the transaction hash as a query parameter. {% hint style="info" %} **Why `bytes32` type for addresses** CCTP is built to support EVM chains, which use 20 byte addresses, and non-EVM chains, many of which use 32 byte addresses. Circle provides a [`Message.sol` library](https://github.com/circlefin/evm-cctp-contracts/blob/40111601620071988e94e39274c8f48d6f406d6d/src/messages/Message.sol#L145-L157) as a reference implementation for converting between address and `bytes32` in Solidity. {% endhint %} ### Message body The message format includes a dynamically sized `messageBody` field, used for application-specific messages. For example, `TokenMessengerV2` defines a [BurnMessageV2](https://github.com/circlefin/evm-cctp-contracts/blob/master/src/messages/v2/BurnMessageV2.sol) with data related to crosschain transfers. | Field | Offset | Solidity Type | Length (bytes) | Description | | ----------------- | ------ | ------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `version` | 0 | `uint32` | 4 | Version identifier - use 1 for CCTP | | `burnToken` | 4 | `bytes32` | 32 | Address of burned token on source domain | | `mintRecipient` | 36 | `bytes32` | 32 | Address to receive minted tokens on destination domain | | `amount` | 68 | `uint256` | 32 | Amount of burned tokens | | `messageSender` | 100 | `bytes32` | 32 | Address of caller of `depositForBurn` (or `depositForBurnWithCaller`) on source domain | | `maxFee` | 132 | `uint256` | 32 | Maximum fee to pay on the destination domain, specified in units of `burnToken` | | `feeExecuted` | 164 | `uint256` | 32 | Actual fee charged on the destination domain, specified in units of `burnToken` (capped by `maxFee`) | | `expirationBlock` | 196 | `uint256` | 32 | An expiration block 24 hours in the future is encoded in the message before signing by attestation service, and is respected on the destination chain. If the burn expires, it must be re-signed. Expiration acts as a safety mechanism against problems with finalization, such as a stuck sequencer. | | `hookData` | 228 | `bytes` | dynamic | Arbitrary data to be included in the `depositForBurn` on source domain and to be executed on destination domain | {% hint style="info" %} **`expirationBlock` on ARB-stack blockchains** For ARB-stack destination blockchains (Arbitrum, EDGE, and Plume), the `expirationBlock` is an Ethereum (L1) block number, not the L2 block number. ARB-stack blockchains track blocks internally using the parent blockchain (Ethereum). When validating expiration for these blockchains, compare the `expirationBlock` value against the current Ethereum block number, not the L2 block number. {% endhint %} ## API hosts and endpoints CCTP provides a set of API hosts and endpoints to manage messages, attestations, and transaction details for your crosschain USDC transfers. ### API service hosts | Environment | URL | | ----------- | ------------------------------------- | | **Testnet** | `https://iris-api-sandbox.circle.com` | | **Mainnet** | `https://iris-api.circle.com` | {% hint style="info" %} **API Service Rate Limit** The CCTP API service rate limit is 35 requests per second. If you exceed 35 requests per second, the service blocks all API requests for the next 5 minutes and returns an HTTP 429 response. {% endhint %} ### API endpoints CCTP endpoints enable advanced capabilities such as fetching attestations for **Standard Transfer** or **Fast Transfer** burn events, verifying public keys across versions, accessing transaction details, querying fast transfer allowances and fees, and initiating re-attestation processes. Below is an overview of the CCTP public endpoints. Click on any endpoint for its API reference. | Endpoint | Description | Use Case | | -------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | [`GET /v2/publicKeys`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-public-keys-v2/README.md) | Returns public keys for validating attestations across all supported CCTP versions. | Retrieve public keys to verify attestation authenticity for crosschain transactions. | | [`GET /v2/messages`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-messages-v2/README.md) | Retrieves messages and attestations for a given transaction or nonce, supporting messages for all CCTP versions. | Fetch attestation status and transaction details. | | [`POST /v2/reattest`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/reattest-message/README.md) | Re-attests a soft finality V2 message to achieve finality or revive expired Fast Transfer burns. | Handle edge cases requiring updated attestations or finalize transactions with stricter rules. | | [`GET /v2/fastBurn/USDC/allowance`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-fast-burn-usdc-allowance/README.md) | Retrieves the current USDC Fast Transfer allowance remaining. | Monitor available allowance for Fast Transfer burns in real-time. | | [`GET /v2/burn/USDC/fees`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-burn-usdc-fees/README.md) | Returns the fees for USDC transfers between specified source and destination domains. | Calculate transaction costs before initiating a Fast or Standard Transfer. | {% hint style="info" %} **Deprecated endpoint** The endpoint `/v2/fastBurn/USDC/fees` is deprecated. Use [`/v2/burn/USDC/fees`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-burn-usdc-fees/README.md) instead to retrieve both Fast and Standard Transfer fees. **Note:** This deprecation does **not** affect [`/v2/fastBurn/USDC/allowance`](https://github.com/PharosNetwork/docs/blob/main/api-reference/cctp/all/get-fast-burn-usdc-allowance/README.md) (see preceding table), which remains active and valid. {% endhint %} ## Finality thresholds CCTP has the concept of a finality threshold, which is a chain-agnostic representation of the confirmation level required before an attestation is issued. This allows integrators to specify how many confirmations are needed based on their risk tolerance or use case. In CCTP, each message specifies a `minFinalityThreshold`. This threshold indicates the minimum level of confirmation required for Circle's attestation service (Iris) to attest to the message. Iris will not attest to a message at a confirmation level below the specified minimum threshold. This allows applications to enforce a desired level of finality before acting on an attestation on the destination chain. ### Defined finality thresholds CCTP V2 defines the following finality thresholds: | Finality Threshold | Value | | ------------------ | ----- | | **Confirmed** | 1000 | | **Finalized** | 2000 | ### Messages and finality * Messages with a `minFinalityThreshold` of **1000** or lower are considered **Fast** messages. These messages are eligible for fast attestation at the *confirmed* level by Iris. * Messages with a `minFinalityThreshold` of **2000** are considered **Standard** messages. These messages are attested to at the *finalized* level by Iris. {% hint style="info" %} Only two finality thresholds are supported. Any `minFinalityThreshold` value below **1000** is treated as **1000**, and any value above **1000** is treated as **2000**. {% endhint %} ## Fees For information about CCTP transfer fees, including fee tables by blockchain, the `maxFee` parameter, and Standard Transfer fee switch support, see [CCTP Fees](https://developers.circle.com/cctp/concepts/fees). ## Hooks Hooks in CCTP V2 are metadata that can be attached to a burn message, allowing integrators to execute custom logic at the destination chain. Hook execution is left entirely to the integrator, offering maximum flexibility and enabling broader crosschain compatibility without altering the core CCTP protocol. ### Design overview CCTP does not implement hook execution in the core protocol. Instead, hooks are treated as opaque metadata passed along with the burn message. This design allows integrators to define and control how hooks are processed on the destination chain, based on their own infrastructure and trust model. ### Key benefits * **Maximum flexibility for integrators** * Determine execution timing: pre-mint or post-mint * Implement custom recovery or error-handling strategies if hook execution fails * Choose any execution environment (EVM or non-EVM); even non-EVM chains can support Hooks as data passed into a function call. * **Improved Compliance and Security Separation** * **Compliance**: By delegating hook execution to the integrator, the protocol maintains a clear boundary between CCTP's core message-passing capabilities and application-specific logic. This modular approach helps integrators meet their own compliance requirements with greater flexibility. * **Security**: By keeping hook execution outside the core protocol, CCTP maintains a smaller and more focused security surface, while allowing integrators to manage their own execution environments independently. # LayerZero ## Overview LayerZero provides omnichain messaging infrastructure that allows smart contracts to communicate across different blockchain networks. On Pharos, LayerZero enables developers to build applications that send messages and transfer assets across multiple chains, with configurable security through Decentralized Verifier Networks (DVNs). ## Network Configuration LayerZero is available on Pacific Mainnet with the following configuration: ### Core Parameters | Parameter | Value | | ----------------- | ------- | | Chain Key | pharos | | Stage | mainnet | | Endpoint ID (EID) | 30407 | ### Endpoint V2 Contracts | Contract | Address | | ----------------- | ------------------------------------------ | | endpointV2 | 0x6F475642a6e85809B1c36Fa62763669b1b48DD5B | | sendUln302 | 0xC39161c743D0307EB9BCc9FEF03eeb9Dc4802de7 | | receiveUln302 | 0xe1844c5D63a9543023008D332Bd3d2e6f1FE1043 | | blockedMessageLib | 0xc1ce56b2099ca68720592583c7984cab4b6d7e7a | | executor | 0x4208D6E27538189bB48E603D6123A94b8Abe0A0b | ## When to Use LayerZero LayerZero is typically used for: * Sending messages across chains * Building omnichain applications * Coordinating contract logic across multiple networks * Use cases requiring flexible security configuration via DVNs ## Integration Notes * Use Endpoint V2 contracts to send and receive cross-chain messages * Configure DVNs based on your application's security requirements * Suitable for applications that require customizable cross-chain messaging ## Metadata API LayerZero provides metadata APIs to query deployments and configuration details. * **Deployments:**\ <https://metadata.layerzero-api.com/v1/metadata/deployments> * **DVN Providers:**\ <https://metadata.layerzero-api.com/v1/metadata/dvns> * **Example (Ethereum DVNs):**\ <https://metadata.layerzero-api.com/v1/metadata/dvns?chainNames=ethereum> ## Next Steps * Configure your contracts to interact with LayerZero endpoints * Select appropriate DVNs for your use case * Test cross-chain messaging flows across supported networks # Wallet ## Overview Wallets and custody solutions are used to manage accounts, sign transactions, and control assets on the Pharos Network. As a developer, you’ll use wallets for interacting with applications, while custody solutions are important for managing funds securely, especially in production environments. ## What You Can Do with Wallets * Create and manage accounts * Sign and send transactions * Interact with smart contracts * Connect to decentralized applications * Manage assets across networks ## Custody for Applications For applications and teams, custody solutions provide more advanced capabilities such as: * Multi-signature (multisig) transaction approvals * Secure key management * Role-based access control * Operational security for managing funds ## Why It Matters Choosing the right wallet or custody solution is important for both development and production. * Individual developers typically use wallets for testing and interaction * Teams and protocols rely on custody solutions for secure fund management and operational workflows ## Available Solutions Pharos supports wallet and custody solutions for different use cases. Refer to the pages below for setup and usage: * Safe MultiSig * Fordefi # Safe MultiSig Safe (Gnosis Safe) is one of the most widely used multi-signature wallets in the blockchain ecosystem. It enables teams and DAOs to securely manage digital assets and smart contract permissions through configurable multi-signature approvals. Developers and organizations can create Safe wallets to manage treasury funds, protocol upgrades, and governance-controlled contracts on the Pharos network. ## Safe UI Production interface for interacting with Safe wallets on Pharos: [https://app.safe.global](https://app.safe.global/welcome/accounts) ## Transaction Service API Developers can interact programmatically with the Safe Transaction Service for automation and integration. **Swagger API Endpoint** <https://transaction.safe.pharosnetwork.xyz> ### This service enables: * Transaction creation and submission * Signature collection * Transaction status monitoring * Integration with automation workflows # Fordefi ## Overview Fordefi provides institutional-grade wallet infrastructure for securely managing digital assets. It uses MPC (Multi-Party Computation) technology to eliminate single private keys, enabling secure transaction signing along with policy-based access control for teams and organizations. ## Enable Pharos Network Pharos can be enabled directly within the Fordefi platform from the Chains settings: <https://app.fordefi.com/settings/chains?search=PHAROS\\&page=1> ## Key Features * MPC-based key management * Policy-based transaction approvals * Institutional custody workflows * Secure signing infrastructure * Integration with DeFi protocols ## When to Use Fordefi Fordefi is typically used for: * Managing treasury and protocol funds * Secure transaction signing without single key exposure * Teams requiring policy-driven approval workflows * Institutional-grade custody and operations ## Integration Notes * Enable Pharos from the Chains settings before initiating transactions * Configure policies and approval flows based on your team’s requirements * Suitable for both operational workflows and production environments ## Next Steps * Enable Pharos in your Fordefi account * Set up policies and access controls * Start managing assets and signing transactions securely # Pharos Skill Engine > v0.1.0 · Atlantic Testnet & Pacific Mainnet ## Part 1 — What Is the Pharos Skill Engine? The Pharos Skill Engine is a packaged developer toolkit that lets an AI agent perform any on-chain operation on the Pharos — check balances, send transactions, deploy and verify Solidity contracts, run batch airdrops, and generate Web3 interaction scripts — entirely through CLI commands. It is not an SDK, not an API, and not a smart contract framework. It is a self-contained knowledge and tooling package that a developer installs once and then hands to an AI agent (like Claude). The agent reads the package, understands what Pharos operations are available, and executes them by running the correct `cast` and `forge` commands. ### The Core Idea **Natural language in → on-chain action out.** A developer says "deploy an ERC20 token called Pharos Gold with symbol PGD" and the agent reads the Skill Engine, finds the one-click ERC20 template, generates the deploy script, runs it, and returns the contract address — all without the developer writing a single line of Solidity or a single CLI command by hand. ### What It Is Made Of | File / Folder | What It Is | Role | | -------------------------------- | -------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `SKILL.md` | The entry point — read by the AI agent first | Defines what capabilities exist and where to find detailed instructions for each | | `assets/networks.json` | Network configuration | RPC URLs, chain IDs, explorer URLs, native token symbols for both Atlantic testnet and mainnet | | `assets/tokens.json` | Known token registry | Pre-populated ERC20 addresses and decimals for both networks | | `assets/erc20/StandardERC20.sol` | Built-in ERC20 contract template | Ready-to-deploy OpenZeppelin-based ERC20 with configurable name, symbol, decimals, supply | | `assets/airdrop/` | Built-in airdrop infrastructure | Distributor contracts and batch scripts; supports up to 6000+ addresses via CSV | | `assets/templates/` | Script generation templates | JS (ethers.js v6), TypeScript (viem), Python (w
프로젝트로 돌아가기