> For the complete documentation index, see [llms.txt](https://docs.rome.builders/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rome.builders/ko/reference/json-rpc.md).

# JSON-RPC 지원

Rome EVM 엔드포인트에서 지원되는 Ethereum JSON-RPC 메서드와 Rome 고유 동작 — Foundry, Hardhat, ethers, viem, MetaMask용.

Rome EVM 엔드포인트는 표준 Ethereum JSON-RPC를 사용합니다. Foundry, Hardhat, ethers, viem, MetaMask는 다른 EVM 체인과 마찬가지로 Rome에서도 동작합니다. 이 페이지에는 지원되는 항목과 알아둘 만한 Rome 전용 동작이 정리되어 있습니다.

## 지원되는 메서드

**코어(상태 및 실행):** `eth_chainId`, `eth_blockNumber`, `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount`, `eth_call`, `eth_estimateGas`, `eth_gasPrice`, `eth_maxPriorityFeePerGas`, `eth_feeHistory`.

**블록 및 트랜잭션:** `eth_getBlockByNumber`, `eth_getBlockByHash`, `eth_getBlockReceipts`, `eth_getTransactionByHash`, `eth_getTransactionReceipt`, `eth_sendRawTransaction`, 블록 번호/개수 기준 변형.

**로그 및 필터:** `eth_getLogs`, `eth_newFilter`, `eth_newBlockFilter`, `eth_getFilterChanges`, `eth_getFilterLogs`, `eth_uninstallFilter`.

**WebSocket 구독:** `eth_subscribe` / `eth_unsubscribe` (`newHeads`, `logs`). See [WebSocket 구독](https://docs.rome.builders/ko/developer-guides/websocket-subscriptions.md).

**Net / web3:** `net_version`, `net_listening`, `net_peerCount`, `web3_clientVersion`.

**간단한 인트로스펙션 메서드:** `rpc_modules` (나열) `debug`, `eth`, `net`, `rome`, `rpc`, `txpool`, `web3`), `eth_syncing` (항상 `false`), `eth_accounts` (항상 빈 목록) `eth_getUncleCountByBlockNumber`, `eth_getUncleCountByBlockHash`, `eth_getUncleByBlockNumberAndIndex` 그리고 `eth_getUncleByBlockHashAndIndex` (언클이 없으므로 개수는 `0x0` 이며 조회 결과는 `null`), `eth_newPendingTransactionFilter` (허용되지만 공개 mempool이 없으므로 해시를 반환하지는 않습니다), 그리고 `txpool_status`, 항상 `{"pending":"0x0","queued":"0x0"}` 공개 mempool이 없기 때문입니다.

**트레이싱:** `debug_traceRomeTransaction` 트랜잭션 해시를 받아 여러 호출을 하나의 배치로 묶은 트랜잭션에 대해 서브 호출별 및 CPI별 내역을 반환합니다. 일반적인 트랜잭션은 `null`, 알려지지 않았거나 아직 인덱싱되지 않은 해시도 마찬가지입니다.

### 지원되지 않음

`debug_traceTransaction` / `trace_*` (Ethereum 스타일의 트랜잭션 트레이싱; 반환값은 `-32601`), `eth_getProof`, `eth_createAccessList`, `eth_blobBaseFee` (blob 트랜잭션이 없음), 그리고 `txpool_*` 이외의 메서드 `txpool_status` (공개 mempool 없음). `newPendingTransactions` 구독은 수락되지만 절대 이벤트를 내보내지 않습니다.

## Rome 확장 메서드

표준 Ethereum RPC 외에도, 프록시는 다음을 노출합니다 `rome_*` 메서드:

| 메서드                               | 목적                                                                                                                                 |
| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `rome_emulateTx`                  | 오프체인에서 트랜잭션을 에뮬레이트합니다(솔라나 실행 결과 반환)                                                                                                |
| `rome_emulateTxWithPayer`         | 특정 payer를 대상으로 에뮬레이트                                                                                                               |
| `rome_emulateCallAccounts`        | 에뮬레이트하고 호출이 닿는 솔라나 계정을 반환                                                                                                          |
| `rome_emulateRegRollup`           | 롤업 등록을 에뮬레이트                                                                                                                       |
| `rome_getResources`               | 프록시 리소스 풀 상태(payer, holder) 보고                                                                                                     |
| `rome_mintId`                     | ERC-20 래퍼 뒤에 있는 SPL 민트를 해석                                                                                                         |
| `rome_buildInfo`                  | 프록시 빌드 + 온체인 프로그램 정보                                                                                                               |
| `rome_isCompatible`               | 프록시/프로그램 호환성 확인                                                                                                                    |
| `rome_solanaTxForEvmTx`           | EVM 트랜잭션 해시의 솔라나 트랜잭션(들) 가져오기                                                                                                      |
| `rome_sendUnsignedTransaction`    | 서명되지 않은 트랜잭션 제출(합성 송신자 흐름)                                                                                                         |
| `rome_composeUnsignedAtomicV1`    | 솔라나 지갑의 Ed25519 서명으로 승인된, 서명되지 않은 EIP-1559 본문에 대해 하나의 Solana v1 트랜잭션을 구성합니다. 지갑이 서명하고 앱이 브로드캐스트합니다. 호출이 하나의 원자적 트랜잭션에 맞지 않으면 거부합니다 |
| `rome_composeUnsignedIterativeV1` | 동일하지만, 모든 레그를 반환합니다(들어가면 원자적, 아니면 반복 레그); 지갑이 각 레그에 서명하고 이를 제출합니다 `rome_submitSignedV1Plan`                                        |
| `rome_submitSignedV1Plan`         | 서명된 플랜을 브로드캐스트합니다(최대 64개 레그); 프록시는 전송만 담당하고, 지갑이 계속 수수료 payer입니다                                                                   |
| `rome_relayUnsignedV1`            | 하나의 지갑 서명으로, 프록시의 payer가 레그를 구동합니다; synthetic이 Rome 가스 비용을 지불합니다(먼저 다음으로 자금을 넣으세요 `rome_composeExternalDepositV1`). EVM tx 해시를 반환  |
| `rome_composeExternalDepositV1`   | 지갑의 토큰에서 synthetic의 네이티브 가스 잔액을 충전하는, 지갑 서명 1회의 트랜잭션                                                                               |

## Rome 전용 동작

### 가스는 솔라나에서 파생됩니다 — 추정하고, 하드코딩하지 마세요

Rome에서는 실행을 Solana compute unit으로 계측하며, 이는 EVM 가스로 노출됩니다. 쓰기 비용의 대부분은 솔라나 계정을 생성하는 데 듭니다: 한 번도 사용되지 않은 수신자, 새 토큰 계정, 배포된 컨트랙트. 그런 계정들은 추정치에 포함됩니다. 실무상 의미:

* **사용 `eth_estimateGas`, 그리고 절대 하드코딩하지 마세요 `21000`.** 표준 툴(`forge create`, `cast`, Hardhat, ethers, viem, MetaMask)은 이미 이를 호출해 쓸 수 있는 값을 받아옵니다. 솔라나 프로그램에 닿는 호출의 경우 여유분을 더하고(SDK의 `submitRomeTx` 은 1.3배 패딩) 추정치 자체가 revert하면 가스 상한을 설정하세요. 하드코딩된 `21000` 한도는 쓰기가 계정을 생성할 때마다 실패합니다. 예를 들어 한 번도 사용된 적 없는 주소로의 전송 같은 경우입니다.
* **Rome는 실제 사용된 가스만 청구합니다.** 아래 측정에서는 사용된 가스가 추정치를 한 번도 넘지 않았으므로, 실제 작업보다 더 높은 추정치는 차액을 청구하지 않습니다.
* **툴링이 추가하는 여유분은 그대로 두세요.** 상태는 추정과 트랜잭션이 체인에 올라가는 순간 사이에 바뀔 수 있고, Solana CPI를 수행하는 호출의 추정치는 낮게 나올 수 있습니다. SDK의 `submitRomeTx` 은 여유분으로 추정치를 1.3배로 패딩합니다.

Hadrian에서 측정했으며, 당시 가스 가격은 약 10.4 gwei였습니다:

| 쓰기                                       | `eth_estimateGas` | 사용된 가스    |
| ---------------------------------------- | ----------------- | --------- |
| 한 번도 사용되지 않은 주소로의 네이티브 전송                | 1,086,961         | 1,086,961 |
| 기존 주소로의 네이티브 전송                          | 21,000            | 10,001    |
| 한 번도 사용되지 않은 주소로의 wUSDC 전송               | 2,544,921         | 2,544,921 |
| 가스를 wUSDC로 래핑(`withdraw_to_ata`)         | 21,000            | 10,001    |
| 래퍼 승인(`approve_spl` Helper precompile에서) | 21,000            | 10,001    |
| 10바이트 컨트랙트 배포                            | 1,147,921         | 1,147,921 |

이것들은 한 체인에서의 단일 측정값이며, 한도가 아닙니다. 수치는 호출이 생성해야 하는 계정에 따라 달라지므로, 그대로 복사하지 말고 각 쓰기마다 추정하세요.

### `forge script --broadcast` 가 필요합니다 `--skip-simulation`

`forge script` 의 브로드캐스트 가스 한도를 **로컬** 시뮬레이션에서 가져오므로, Rome의 가스 모델에 비해 자원이 부족하게 설정됩니다. 추가하세요 `--skip-simulation` 그래서 Foundry가 체인의 `eth_estimateGas` 대신 사용하도록:

```bash
forge script script/Deploy.s.sol:Deploy \
  --rpc-url <RPC> --private-key $PRIVATE_KEY --broadcast --skip-simulation
```

`forge create`, `cast send`, 그리고 Hardhat은 영향을 받지 않습니다 — 이미 온체인에서 추정합니다.

### `eth_getLogs` 는 범위가 제한됩니다(\~12,000개 블록)

Infura, Alchemy 및 기타 프로덕션 RPC와 마찬가지로, `eth_getLogs` 너무 넓은 블록 범위를 거부합니다(오류 `-32005`). 쿼리 범위를 제한하세요:

```javascript
const latest = await provider.getBlockNumber();
const logs = await contract.queryFilter(filter, latest - 5000, latest);
```

하나의 `queryFilter` 범위를 지정하지 않으면 모든 기록을 스캔하며 제한을 초과합니다 — 명시적인 `fromBlock`/`toBlock`. 영수증 기반 이벤트 어설션(예: tx를 기다리고 로그를 읽는 것)은 영향을 받지 않습니다.

### 수수료

`eth_gasPrice` 실제 오라클 기반 가격을 반환합니다. 지갑(메타마스크 포함)은 이를 사용해 올바른 수수료를 표시합니다. 제출된 수수료 필드는 관대하게 허용됩니다 — 레거시와 EIP-1559 트랜잭션 모두 표준 툴링 기본값으로 정상적으로 체인에 올라갑니다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.rome.builders/ko/reference/json-rpc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
