# Integration of the Ethereum Remote Procedure Call (RPC)

## RPC Integration Process

The integration of the Ethereum Remote Procedure Call (RPC) system involves a two-step process, detailed in the following subsections.

### 1. Node enhancements

The signature verification logic has been enhanced to support Ethereum's curve, **secp256k1**. This improvement was effectively incorporated using existing abstractions and interfaces.&#x20;

To accommodate Ethereum's standard, transactions now include additional information, seamlessly reaching the node. After initial processing, these transactions are converted to conform to the default MultiversX format, ensuring smooth progression through the next processing stages.

### 2. RPC endpoints integration into MultiversX's Proxy

OneFinity's RPC integration leverages **Go Ethereum**. Key points:

* Endpoints are responsible for translating between Ethereum and MultiversX formats.
  * The translation includes the conversion between Ethereum based addresses and MultiversX based addresses
* Certain endpoints, such as `eth_call`, automatically prefill data to ensure requests are accurately mapped to the MultiversX API.
* Websockets are **not supported** at the moment

### 3. Available OneFinity's RPC Endpoints and key differences

* eth\_chainId - fully supported
* eth\_gasPrice - fully supported
* eth\_getBalance - fully supported
* eth\_blockNumber - returns the latest finalised block number
* eth\_getBlockByNumber&#x20;
  * Ethereum's special filters are mapped to the following MultiversX equivalent
    * `PendingBlockNumber`, `LatestBlockNumber` -> latest block number
    * `FinalizedBlockNumber`, `SafeBlockNumber` -> latest finalised block number
  * fullTx is supported
  * certain Ethereum-specific fields that lack equivalents on MultiversX will not be included in the response.
* eth\_getBlockByHash&#x20;
  * similar to `eth_getBlockByNumber`, Ethereum-specific fields are omitted in the response.
* eth\_getCode - fully supported
* eth\_getStorageAt - it is supported; however, the output may vary since it retrieves data from MultiversX-based storage.
* eth\_getBlockReceipts&#x20;
  * simillarly to eth\_getBlockBy endpoints, the filters are supported
  * certain Ethereum-specific fields that lack equivalents on MultiversX will not be included in the response (eg. transactionIndex, cumulativeGasUsed)
* eth\_call&#x20;
  * while MultiversX doesn't have an exact equivalent for this method, its implementation aims to fully support it to the best possible extent. When invoking `eth_call` on Ethereum, many request parameters can be omitted. To ensure compatibility, we prefill any information that would be mandatory in order to make the API requests on MultiversX
  * the implementation switches between calling the MultiversX's simulate transaction and sc query based on the parameters sent on the request
  * state and block overrides are **not currently supported**
* eth\_estimateGas&#x20;
  * the request will be prefilled with any additional data in order to ensure compatibility
  * state overrides are **not currently supported**
* eth\_getBlockTransactionCountByNumber - fully supported
* eth\_getBlockTransactionCountByHash - fully supported
* eth\_getTransactionCount - fully supported
* eth\_getTransactionByHash
  * certain Ethereum-specific fields that lack equivalents on MultiversX will not be included in the response (eg. TransactionIndex, GasFeeCap)
* eth\_getTransactionReceipt&#x20;
  * similar to `eth_getTransactionByHash`, Ethereum-specific fields are omitted in the response.
* eth\_sendRawTransaction - fully supported
  * will take care of the mapping between the Ethereum transaction format and the MultiversX transaction format

***

## Environment-specific RPC configurations

Please see the relevant section [here](/technical-documentation/environments.md).


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onefinity.network/technical-documentation/integration-of-the-ethereum-remote-procedure-call-rpc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
