Plume 백서

Plume

원문

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

epancy explains why a block’s reported gas limit may appear inflated despite the effective execution costs. #### Block numbers Plume assigns its own block numbers, distinct from Ethereum’s, with multiple Plume blocks potentially fitting within a single Ethereum block. However, each Plume block is always associated with exactly one Ethereum block. In Plume smart contracts, querying `block.number` returns a value close to the L1 Ethereum block number when the sequencer received the transaction, though it may not be exact. Timing assumptions based on block numbers are reliable over several hours but not within minutes, similar to Ethereum. Plume blocks start at 0 from genesis and increase sequentially, with the sequencer determining block transitions based on transaction activity. Blocks are produced as needed, meaning block production may be sporadic during hours of low activity. When querying a Plume node’s RPC, transaction receipts return the Plume block number, with the corresponding Ethereum block number available in the `l1BlockNumber` field. #### Block timestamps Block timestamps on Plume are determined by the sequencer’s clock and are independent of the timestamp of the Ethereum block. Each Plume block timestamp must be equal to or greater than the previous one and must fall within set boundaries—no more than 24 hours in the past or one hour in the future. Since the sequencer may experience delays in posting batches to Ethereum, it has limited flexibility to adjust timestamps within the defined boundaries to maintain chain stability and prevent reorganization. ### RPC methods[​](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/comparison-overview#rpc-methods) <a href="#rpc-methods" id="rpc-methods"></a> Most of the RPC methods available on Plume behave exactly the same as the methods do on Ethereum. However, some methods may result in a different output or add more information on Plume. These methods behave the same as they do on Arbitrum, so information about the exact differences is available on [Arbitrum's documentation of RPC methods](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/rpc-methods). ### Solidity Support Smart contracts on Plume mostly behave the same as they do on Ethereum. However, some properties and functions on Solidity smart contracts return a different result on Plume. The operations that return a different result are the same as Arbitrum's, so more information is available on [Arbitrum's documentation of Solidity support](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/solidity-support). ### Cross-chain messaging[​](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/comparison-overview#cross-chain-messaging) <a href="#cross-chain-messaging" id="cross-chain-messaging"></a> Arbitrary messages can be passed from Ethereum to Plume. These are commonly known as "parent chain to child chain messages". Developers using this functionality should familiarize themselves with how they work. Find more information about it in [Parent chain to child chain messaging](https://docs.arbitrum.io/how-arbitrum-works/l1-to-l2-messaging). Similarly, Plume can also send messages to Ethereum. Find more information about them in [Child chain to parent chain messaging and the outbox](https://docs.arbitrum.io/how-arbitrum-works/l2-to-l1-messaging). ### Precompiles[​](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/comparison-overview#precompiles) <a href="#precompiles" id="precompiles"></a> Plume supports all precompiles available in both Ethereum and Arbitrum, with methods smart contracts can call the same way they can Solidity functions. You can find a full reference of them in [Precompiles](https://docs.arbitrum.io/build-decentralized-apps/precompiles/overview). ### NodeInterface[​](https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/comparison-overview#nodeinterface) <a href="#nodeinterface" id="nodeinterface"></a> Plume includes a special `NodeInterface` contract available at address `0xc8` that is only accessible via RPCs (it's not actually deployed on-chain, and thus can't be called by smart contracts). Find more information about this interface in [NodeInterface](https://docs.arbitrum.io/build-decentralized-apps/nodeinterface/overview). # Gas and Fees Gas is used by Plume to track the cost of executing a transaction. It works the same as Ethereum gas, in the sense that every EVM instruction costs the same amount of gas that it would on Ethereum. Plume's gas calculations are very similar to [Arbitrum's gas calculations](https://docs.arbitrum.io/how-arbitrum-works/gas-fees), but gas is paid in $PLUME rather than in $ETH. There are two parties a user pays when submitting a tx: * the poster, if reimbursable, for Ethereum resources such as the Ethereum calldata needed to post the tx * the network fee account for Plume resources, which include the computation, storage, and other burdens Plume nodes must bear to service the tx The Ethereum component is the product of the Transaction's estimated contribution to its Batch's size — computed using Brotli on the transaction by itself — and Plume's view of Ethereum's data price, a value which dynamically adjusts over time to ensure the batch-poster is ultimately fairly compensated. The Plume component consists of the traditional fees Geth would pay to stakers in Ethereum, such as the computation and storage charges applying the State Transition Function entails. Plume charges additional fees for executing Plume-specific precompiles, whose fees are dynamically priced according to the specific resources used while executing the call. ### Ethereum gas pricing[​](https://docs.arbitrum.io/how-arbitrum-works/gas-fees#parent-chain-gas-pricing) <a href="#parent-chain-gas-pricing" id="parent-chain-gas-pricing"></a> Plume dynamically prices Ethereum gas, with the price adjusting to ensure that the amount collected in Ethereum gas fees is as close as possible to the costs that must be covered, over time. Ethereum costs include batch posting costs and rewards. * Batch posting costs reflect the actual cost incurred by a batch poster when submitting batch data to Ethereum. Each time a batch is posted, the Ethereum contract sends a "batch posting report" to the Plume, detailing who paid for the batch and the basefee at the time. This report enters Plume's Delayed Inbox and is processed after a delay. Upon arrival, Plume calculates the batch cost by multiplying the reported basefee by the batch's data cost. The pricer then records the amount due to the batch submitter. * Optional per-unit rewards can be set for handling transaction calldata, which may be paid to the Sequencer or any other party incurring per-byte costs. The Ethereum pricer tracks and updates the funds due to the designated reward recipient as batch posting reports arrive. Ethereum calldata fees arise because the Sequencer or batch poster incurs gas costs when posting transactions on Ethereum as calldata. These fees are credited to the batch poster to offset expenses. Every transaction routed through the Sequencer pays a calldata fee, whereas transactions from the delayed inbox do not, as they already pay Ethereum gas fees when inserted into the delayed inbox. The Ethereum pricing algorithm determines this fee by estimating a transaction’s size, considering its compressibility, and multiplying it by the current price per byte. The cost is then converted into Plume gas units, resulting in a "poster fee" for the transaction. A dynamic pricing algorithm adjusts the per-byte price based on the balance between collected fees and actual costs incurred by batch posters, increasing or decreasing prices to maintain equilibrium. ### Plume gas pricing[​](https://docs.arbitrum.io/how-arbitrum-works/gas-fees#child-chain-gas-pricing) <a href="#child-chain-gas-pricing" id="child-chain-gas-pricing"></a> The gas price on Plume has a set floor, which can be queried via [ArbGasInfo](https://phoenix-explorer.plumenetwork.xyz/address/0x000000000000000000000000000000000000006C)'s `getMinimumGasPrice` method. Estimating Plume gas can be done via a Plume Node’s `eth_estimateGas` RPC, which returns a value sufficient to cover the full transaction fee at Plume's current gas price. Multiplying this value by the Plume gas price gives the total Ether required for a transaction. Since Ethereum calldata prices fluctuate, the estimate may change over time. Alternatively, calling `NodeInterface.gasEstimateComponents()` provides the gas limit for a transaction, with the total cost calculated by multiplying the gas estimate by the Plume basefee. Plume gas fees function similarly to Ethereum’s gas system, where the gas used by a transaction is multiplied by the current basefee to determine the total fee. The basefee is managed by an "exponential mechanism" similar to Ethereum’s EIP-1559, adjusting based on network usage. It compares gas consumption to a speed limit, currently set at 7,000,000 gas per second on Plume Mainnet, and maintains a backlog that increases when gas is used and decreases every second by the speed limit amount. If the backlog grows, the basefee rises to slow gas usage; if it shrinks, the basefee decreases to allow more transactions. The basefee follows an exponential function of the backlog, where parameters control how quickly the price escalates. Transaction prioritization on Plume follows a first-come, first-served basis, meaning tips are ignored, and users always pay the basefee regardless of any tip amount. ### Total fee and gas estimation[​](https://docs.arbitrum.io/how-arbitrum-works/gas-fees#total-fee-and-gas-estimation) <a href="#total-fee-and-gas-estimation" id="total-fee-and-gas-estimation"></a> The total fee charged to a transaction is the Plume basefee, multiplied by the sum of the Plume gas used plus the Ethereum calldata charge. As on Ethereum, a transaction will fail if it fails to supply enough gas, or if it specifies a basefee limit that is below the current basefee. Ethereum also allows a "tip" but Plume ignores this field and never collects any tips. # Finality Finality in blockchain systems refers to the point at which a transaction becomes irreversible and permanently included in the blockchain's ledger. Plume offers two levels of finality. #### Soft Finality[​](https://docs.arbitrum.io/how-arbitrum-works/sequencer#soft-finality) - 1 block (\~250 ms) <a href="#soft-finality" id="soft-finality"></a> Soft finality refers to the preliminary confirmation of transactions based on the Sequencer's real-time feed. It occurs as soon as the sequencer orders the transaction in its off-chain inbox, locally executes it using the Plume VM, and gives a transaction receipt back to the client. Key characteristics include: * **Immediate Confirmation**: Transactions are confirmed almost instantly as they are accepted and ordered by the Sequencer. This typically takes \~250 ms and doesn't require any other on-chain confirmations. * **Provisional Assurance**: The confirmations are provisional and rely on the Sequencer's integrity and availability. That is, a malicious or faulty Sequencer could deviate between what it promised in the transaction receipt and what is ultimately published in a batch. * **High Performance**: Enables applications to offer rapid responses and real-time interactions, enhancing user experience. #### Hard Finality[​](https://docs.arbitrum.io/how-arbitrum-works/sequencer#hard-finality) - 64 blocks after posting to Ethereum (\~30 minutes) <a href="#hard-finality" id="hard-finality"></a> Hard finality occurs when batched transactions get posted to Ethereum. These batches are typically posted every few minutes during normal traffic on Plume, after which the transaction inherits the full security of Ethereum. It's recommended to wait for two Ethereum epochs, or 64 blocks, to minimize the chances of any potential re-orgs happening on Ethereum. Key characteristics include: * **Strong Security Guarantees**: When included in blocks on Ethereum, transactions inherit Ethereum's security assurances. * **Decentralized Assurance**: Anyone, including yourself, can run a Plume validator node to confirm that the L1 batch is legitimate. Only a single well-behaved validator is needed to ensure that the transaction is finalized. * **Data Availability**: All transaction data is recorded on-chain, ensuring transparency and verifiability. If any malicious validator tries to deviate from this finalized state, any honest validator can submit a fraud proof challenge within 7 days and win. Once the honest validator has succeeded in the challenge, the correct finalized state will be propagated to Ethereum. Even though the state is finalized within 30 minutes, in order to ensure that there is enough time for honest validators to challenge malicious actors, no messages will be propagated from the Ethereum outbox until after the 7 days is up. This means that withdrawals from Plume are subject to a 7-day delay. # DeFi Strategy Shortcuts Plume has partnered with Enso to create Shortcuts to turn crosschain DeFi strategies into atomic, gas-efficient transactions for liquidity migration and provide seamless user experience to dApps. ### Getting Started <a href="#nfpw5it9ujqw" id="nfpw5it9ujqw"></a> Enso's battle-tested [routing engine](https://docs.enso.build/pages/build/get-started/overview) provides a standardized interface to interact with different protocols, despite their differences.&#x20; **Routing APIs**. Both routing APIs return a transaction object—the executable form of the route, which executes atomically, regardless of the number of steps: * [**/route API**](https://docs.enso.build/pages/build/get-started/route): Specify input/output tokens and run optimized execution paths * [**/bundle API**](https://docs.enso.build/pages/build/get-started/bundling-actions): Chain custom shortcut blueprints that interact with various protocols by chaining different actions **Utility APIs.** Additional APIs bring information about: * supported [tokens](https://docs.enso.build/pages/build/get-started/protocol-data#filter-supported-tokens) with TVL and APY values, * [available actions](https://docs.enso.build/pages/build/reference/actions) - the unified interaction interfaces used to build routes declaratively, * supported [projects](https://docs.enso.build/api-reference/integration/projects) and [protocols](https://docs.enso.build/pages/build/get-started/protocol-data#get-supported-protocols), * wallet [balanaces and DeFi positions](https://docs.enso.build/pages/build/get-started/balances) for any address. {% hint style="success" %} You can explore supported tokens and protocols using [Enso Navigator](https://navigator.enso.build/projects?\&chainId=98866). {% endhint %} To explore what's possible with Enso, check out [Routing Examples](#id-2x6l0spkqgtx), and for further ideas check out the [Shortcuts Library](https://docs.enso.build/pages/build/examples/shortcuts). #### Integration <a href="#ya8r7adbju3f" id="ya8r7adbju3f"></a> You can integrate Enso in your UI or backends in following ways: * [Crosschain Route Widget](https://happypath.enso.build/)—a React component and a standalone application for frictionless token transfers. Whereas You can [integrate into your own application](https://docs.enso.build/pages/templates/cross-chain-route-widget). * REST [API](https://docs.enso.build/pages/api-reference/overview) & [SDK](https://github.com/EnsoBuild/sdk-ts) for a more controlled setup. ### Routing Examples <a href="#id-2x6l0spkqgtx" id="id-2x6l0spkqgtx"></a> The following examples demonstrate how to use Enso's [GET /route API](https://docs.enso.build/pages/build/get-started/route) with protocols such as Mystic, Solera, Nucleus, Tempest, Dinero, and Origin.&#x20; #### Basic Token Swap <a href="#y5b6lxw2d9e9" id="y5b6lxw2d9e9"></a> The simplest route you can construct with Enso is a token swap. In this example, we're creating a path from bridged USDC.e to PUSD. The result will contain: * `route.route`: The route object with the exact path and parameters * `route.tx`: The transaction object that can be executed on-chain {% tabs %} {% tab title="SDK" %} ```typescript const client = new EnsoClient({ apiKey: 'your-api-key' }); const route = await client.getRouteData({ fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', chainId: 98866, amountIn: ['1000000000000000000'], slippage: '300', tokenIn: ['0x54FD4da2Fa19Cf0f63d8f93A6EA5BEd3F9C042C6'], tokenOut: ['0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F'], routingStrategy: 'router' }); console.log("Route", route.route); console.log("Transaction", route.tx); ``` {% endtab %} {% tab title="cURL" %} ```bash curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -d '{ "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "chainId": 98866, "amountIn": ["1000000000000000000"], "slippage": "300", "tokenIn": ["0x54FD4da2Fa19Cf0f63d8f93A6EA5BEd3F9C042C6"], "tokenOut": ["0xdddD73F5Df1F0DC31373357beAC77545dC5A6f3F"], "routingStrategy": "router" }' | jq ``` {% endtab %} {% endtabs %} #### Mystic Vaults: Depositing PLUME for myUSDC <a href="#tvugfc7g55rw" id="tvugfc7g55rw"></a> The following call will construct a route for depositing **PLUME** (`tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE`) as a collateral to get **myUSDC** (`tokenOut=0x6c92efa3F77760619bb13d395836415ac18C86dc`), with receiver address getting all output tokens. Under the hood, the route designs two operations: * swap PLUME (input token) for USDC.e * deposit USDC.e into the myUSDC pool, interacting with primary `0xCE192A6E105cD8dd97b8Dedc5B5b263B52bb6AE0` {% hint style="success" %} The exact route is determined at runtime, and optimized against current market conditions. {% endhint %} Explore [Mystic Positions](https://navigator.enso.build/tokens?chainId=98866\&project=mystic). {% tabs %} {% tab title="SDK" %} ```typescript const routeData = await client.getRouteData({ fromAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', receiver: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', chainId: 98866, amountIn: ['1000000000000000000'], slippage: '300', tokenIn: ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE'], tokenOut: ['0x6c92efa3F77760619bb13d395836415ac18C86dc'], routingStrategy: 'router' }); console.log("Route", route.route); console.log("Transaction", route.tx); ``` {% endtab %} {% tab title="cURL" %} ```bash curl -X POST 'https://api.enso.finance/api/v1/shortcuts/route' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -d '{ "fromAddress": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "receiver": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", "chainId": 98866, "amountIn": ["1000000000000000000"], "slippage": "300", "tokenIn": ["0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE"], "tokenOut": ["0x6c92efa3F77760619bb13d395836415ac18C86dc"], "routingStrategy": "router" }' | jq ``` {% endtab %} {% endtabs %} #### Solera: Depositing PLUME for aPlunALPHA <a href="#id-7m7tfee9rjmk" id="id-7m7tfee9rjmk"></a> The following call will generate a route for depositing **PLUME** `tokenIn=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE` as a collateral to get **aPlunALPHA** `tokenOut=0x5d0EC9B10e6759719CeFE14b8c881634678b32f2`, with receiver address getting all output tokens. In this multi-step process, Enso saves you 2 transactions by constructing a route with: * swap **PLUME** for **PUSD** using enso.swap action * deposit **PUSD** into **NALPHA** Nucleus pool, interacting with primary `0xc9f6a492fb1d623690dc065bbced6dfb4a324a35` * deposit **NALPHA** into the **Solera** pool, inter
프로젝트로 돌아가기