Exclusive for Project

Introduction

The builder of project can use RPC Exclusive for Project without subscribing to a plan.

MEV Protect RPC Exclusive for Project can provide MEV protection for orderflow projects like DEX, TG Bot, Wallet, and DApp on Ethereum and BSC, supporting refunds to the project users or project builders themselves.

Compared to RPC General for Wallet User, RPC Exclusive for Project will provide each project builder with a Exclusive RPC URL, supporting visual customization of RPC domain names, transaction disclosure, refunds, and revert protection, facilitating the project builder to integrate RPC at a low cost and quickly.

How to integrate RPC into your project

1. Configure RPC

  1. Register and log in to the portal at blockrazor.io.

  2. Under the Scutum module, click on the RPC page to view the configuration information of your RPC.

  3. Click on Update to enter the configuration update page, and adjust the parameters according to your needs. The meaning of the parameters is shown in the following table.

Parameters
Meaning

Default RPC URL

Each account automatically generates 1 Ethereum RPC and 1 BSC RPC by default. The Default RPC URL is automatically generated and cannot be modified.

Custom RPC URL

The third-level domain is allowed to be modified, and the Custom RPC URL can be promoted to the project's end-users through websites or docs, guiding them to add custom RPC within their wallets.

Hint

The system defaults to sharing the transaction's hash, to, calldata, functionSelector, and logs fields with the Searcher. The more fields shared, the greater the possibility of obtaining refunds, please proceed with caution after evaluating the need for disclosure of transaction data.

Refund Address

The default refund address is tx.origin, which means the refund will be returned to the sender of the transaction. It can be modified to a fixed refund address (EOA or contract address).

Refund Percent

The refund percent defaults to 90% on Ethereum and 99% on BSC, with the adjustment range 1-99%. The higher the refund percent, the longer it may take for the transaction to be included in a block.

Revert Protection

revert protection is enabled by default; if a transaction is detected to revert, it will not be included in the block. To ensure fast inclusion in a block, it is recommended to set priority fee (Ethereum) when sending transactions.

  1. Click Confirm, the system will update the RPC configuration in real time.

2. Integrate RPC

  1. Find the configuration file or code: Open the project workspace and locate the file or code segment that configures the RPC node in the DApp project. This could be a configuration file such as .env, config.js, truffle-config.js, etc., or it could be hardcoded directly in the code.

  2. Modify the RPC URL: Change the RPC URL in the configuration file or code to the Scutum RPC URL.

  3. Test the connection: After making the change, run the DApp or the corresponding test script locally to ensure that the new RPC URL works properly. You can use methods like web3.eth.net.isListening() or ethers.provider.pollingInterval to check if the connection is successful.

  4. Deploy the update: If the test passes, you can deploy the changes to the production environment.

// import Web3
const Web3 = require('web3');

// Create a Web3 instance and connect to the RPC.
const web3 = new Web3('https://ethereum-rpc.publicnode.com'); // You can replace the RPC URL with the Scutum RPC URL here.

// check the connection
web3.eth.net.isListening()
  .then((listening) => {
    console.log('Web3 connected: ', listening);
  })
  .catch((err) => {
    console.error('Web3 connection error: ', err);
  });

3. Query Transactions

  1. Log in to blockrazor.io.

  2. Under the Scutum module, click on Refunds to view the refund, and click on Transactions to view the transactions submitted to dedicated RPC.

JSON RPC

In addition to supporting the standard JSON RPC methods, Scutum also supports customized JSON RPC method called eth_sendMevBundle, with which the project builder can send bundles to the MEV Protect RPC Exclusive for Project.

On BSC, eth_sendMevBundle allows transactions with 0 gwei in the bundle, but the average gasPrice of transactions(excluding those from the public mempool) which meets the demand of the Validator in the bundle must still be no less than 1 gwei. Since head builders of BSC have a preference for this model, it is recommended to construct transactions with 0 gwei.

Request parameters

Bundle

Parameters
Mandatory
Format
Example
Remark

txs

mandatory

[]bytes

[ "0xf84a……e54284" ]

raw txs, up to 50 transactions allowed to be set

revertingTxHashes

optional

[]hash

["0x1f23……0abb1e"]

Transactions that allow to be reverted, a subset of txs

maxBlockNumber

mandatory

uint64

39177941

The maximum block number valid for this bundle

optional

refundAddress

optional

address

"0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c"

If there is a transaction field with a value of true in hint, this field needs to be set.

refundPercent

optional

int

99

If there is a transaction field with a value of true in hint, this field needs to be set.

hint

The disclosure for the transaction data in field txsis set by hint. If it is set to true, it will be regarded as disclosing the corresponding transaction field. If it is false, it will be regarded as not disclosing the corresponding transaction field. If it is not set, the default is false.

Parameters
Mandatory
Format
Example
Remark

hash

optional

bool

true

transaction hash

from

optional

bool

false

sender of the transaction

to

optional

bool

false

receiver of the transaction

value

optional

bool

false

value being transacted

nonce

optional

bool

false

nonce

calldata

optional

bool

false

calldata

functionSelector

optional

bool

false

the first 4 bytes of the contract function signature hash

gasLimit

optional

bool

false

gas limit

gasPrice

optional

bool

false

gas price

logs

optional

bool

true

event logs emitted during transaction execution(this field synchronously sets whether to disclose state changes in the state object)

Request Example

curl -X POST -H "Content-Type: application/json" --data '{
	"id": 1
	"jsonrpc": "2.0",
	"method": "eth_sendMevBundle",
	"params": [{
		"txs": ["0xf84a8080808080808193a0437a5584216e68d1ff5bd7803161865e058f9bf4637fd1391213eac03ae64444a00df12bffe475d5dd8cc1544b72ee280471f1dcb5173827ba41eb25cfc3e54284"],
		"revertingTxHashes": [],
		"maxBlockNumber": 39177941,
		"hint": {
			"hash": true,
			"from": false,
			"to": false,
			"value": false,
			"nonce": false,
			"calldata": false,
			"functionSelector": false,
			"gasLimit": false,
			"gasPrice": false,		
			"logs": true
		},
		"refundAddress": "0x9abae1b279a4be25aeae49a33e807cdd3ccffa0c",
		"refundPercent": 99
	}]
}'<ETH_NODE_URL>

Response Example

normal

{"jsonrpc":"2.0","id":1,"result": "0x11111111..."}

abnormal

{"jsonrpc":"2.0","id":1,"jsonerror":{"code":-38000,"message":"nonce too low: address 0x9Abae1b279A4Be25AEaE49a33e807cDd3cCFFa0C, tx: 0 state: 45"}}

Last updated