# BSC
### Introduction
The BSC Private Mempool delivers private transaction stream data, which is pushed base on the SSE protocol and uniformly in bundle format. Transactions within the data stream are uniformly desensitized, disclosing only transaction fields authorized for release.
Private Mempool can be applied to a variety of scenarios, including backrunning, copy trading, and sniping.
To avoid data interruption due to network fluctuations, it is recommended to establish a reconnection mechanism.
### Endpoint
{% hint style="info" %}
Please keep the domain for subscribing to bundles consistent with the domain for sending bundles. For example, if you subscribe to `https://jp-bscscutum.blockrazor.xyz/stream`, send bundles to `https://jp-bscscutum.blockrazor.xyz`.
{% endhint %}
{% hint style="info" %}
Private data streams vary across regions. It is recommended to subscribe to all three endpoints simultaneously.
{% endhint %}
| 地區 | 端點 |
|---|
| Tokyo | https://jp-bscscutum.blockrazor.xyz/stream |
| New York | https://us-bscscutum.blockrazor.xyz/stream |
| Frankfurt | https://ger-bscscutum.blockrazor.xyz/stream |
| Dublin | https://ire-bscscutum.blockrazor.xyz/stream |
### Authentication
To verify the credential, please set the auth token. An example is as follows:
```json
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer " \
--data '{}' \
https://jp-bscscutum.blockrazor.xyz/stream
```
```
https://jp-bscscutum.blockrazor.xyz/stream?token=
```
The \ in the example must be obtained after registering for BlockRazor. The steps are as follows:
1. Go to [https://www.blockrazor.io](https://www.blockrazor.io/) and click on \[Register] in the upper right corner of the webpage, the system will redirect you to the registration page.
2. On the registration page, enter your email and password, then click \[Register], the system will send an account activation email to your mailbox.
3. Go to your mailbox, check the account activation email, and click on the account activation link.
4. After completing the account activation, proceed to log in, check your account information, and copy the auth token.
### Rate Limit
| | Tier 4 | Tier 3 | Tier 2 | Tier 1 | Tier 0 |
| ----------- | ------ | ------ | --------- | --------- | --------- |
| Data Stream | - | - | 2 streams | 2 streams | 2 streams |
### Bundle Type
#### **Raw Bundle**
Raw Bundle refers to the bundle that has not been followed by the strategy transaction. Transactions in Raw Bundle come from two channels.
Transactions submitted through `eth_sendRawTransaction` will be automatically constructed as a bundle by BlockRazor RPC and pushed to Private Mempool. The Raw Bundle in this scenario only contains one transaction;
For the Raw Bundle submitted through `eth_sendMevBundle`, the transactions come from the public mempool or are self-constructed. The Raw Bundle in this scenario can contain up to 50 transactions.
#### Followed Bundle
After the client executes the backrun, coping trading or sniping strategy on Raw Bundle, it can choose to continue to disclose the bundle to Private Mempool to execute the nested backrun strategy. At this time, the bundle disclosed to the Private Mempool is the Followed Bundle, which contains all transactions in Raw Bundle, and one strategy transaction.
### Data Stream Structure
**Bundle**
| Patameters | Format | Remark |
|---|
| chainID | string | ETH: 1, BSC:56 |
| hash | string | bundle hash, data streams are pushed uniformly in the form of bundles |
| txs | []tx | transactions included in bundle |
| nextBlockNumber | uint64 | the block number where the bundle is going to be included |
| maxBlockNumber | uint64 | the maximum block number valid for this bundle |
| proxyBidContract | string | proxy contract address of bundle bidding, biding call for detail can be found in Broken link. |
| refundAddress | string | input parameter of bidding call, the bidding will be refunded to refundAddress in proportion. |
| refundCfg | int | input parameter of bidding call |
| state | []state | state change of state objects in EVM, data stream example |
**txs**
| Patameters | Format | Remark |
|---|
| hash | string | transaction hash |
| from | string | sender of the transaction |
| to | string | receiver of the transaction |
| value | hex | value being transacted |
| nonce | uint64 | nonce |
| calldata | string | calldata |
| functionSelector | string | the first 4 bytes of the contract function signature hash |
| logs | []log | event logs emitted during transaction execution |
**log**
| Patameters | Format | Remark |
|---|
| address | string | the smart contract address that triggered the event |
| topics | []string | event log topcis |
| data | string | storage area for non-index data |
#### **state**
{% hint style="info" %}
the default data stream does not contain `state` field, if you need it, please modify the url of RPC Endpoint to [https://jp-bscscutum.blockrazor.xyz/stream?state=true](https://jp-bscscutum.blockrazor.xyz/stream?state=true)
{% endhint %}
| Patameters | Format | Remark |
|---|
| "0x7C3b……3cb9E2" | []string | The address of the state object where the data changes, which can be EOA or smart contract |
| "0x935b……6cf608" | string | the Key of the changed data in state object |
| "0x0000……3ffc00" | string | the Value of changed data in state object |
### Data Stream Example(default)
```json
{
"chainID":"56" //ETH: 1, BSC:56
"hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51" // bundle hash
"txs":[{
"hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51"
"from":"0xB4647b856CB9C3856d559C885Bed8B43e0846a47"
"to":"0x0000000000000000000000000000000000001000"
"value":"0x1c4eda9192000"
"nonce":88036
"calldata":"0xf340fa01000000000000000000000000b4647b856cb9c3856d559c885bed8b43e0846a47"
"functionSelector":"0xe47d166c"
"logs":[
{
"address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
"topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
"data": "0x"
}
{
"address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
"topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
"data": "0x"
}
]
}]
"nextBlockNumber":39177941 //the block number where the bundle is going to be included
"maxBlockNumber":39177941 //the maximum block number valid for this bundle
"proxyBidContract":"0x74Ce839c6aDff544139f27C1257D34944B794605" //bidding contract address, call the contract's proxyBid method to bid
"refundAddress":"0x6c1bcf1b99d9f0819459dad661795802d232437e", //the bidding amount will be refunded to refundAddress in proportion
"refundCfg":10380050 //refund configuration
}
```
### Data Stream Example(including state)
{% hint style="info" %}
The default data stream does not contain `state` field, if you need to obtain it, please modify the url of RPC Endpoint to [https://bsc.blockrazor.xyz/stream?state=true](https://bsc.blockrazor.xyz/stream?state=true)
{% endhint %}
```json
{
"chainID":"56" //ETH: 1, BSC:56
"hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51" // bundle hash
"txs":[{
"hash":"0x2ba4c05436d4a48a0ce30341a3164b34b31c091a28ed62618f7b0512aba41f51"
"from":"0xB4647b856CB9C3856d559C885Bed8B43e0846a47"
"to":"0x0000000000000000000000000000000000001000"
"value":"0x1c4eda9192000"
"nonce":88036
"calldata":"0xf340fa01000000000000000000000000b4647b856cb9c3856d559c885bed8b43e0846a47"
"functionSelector":"0xe47d166c"
"logs":[
{
"address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
"topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
"data": "0x"
}
{
"address": "0x6c1bcf1b99d9f0819459dad661795802d232437e",
"topics": ["0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000000000000000000000000000"],
"data": "0x"
}
]
}]
"nextBlockNumber":39177841 //the block number where the bundle is going to be included
"maxBlockNumber":39177941 //the maximum block number valid for this bundle
"proxyBidContract":"0x74Ce839c6aDff544139f27C1257D34944B794605" //bidding contract address, call the contract's proxyBid method to bid
"refundAddress":"0x6c1bcf1b99d9f0819459dad661795802d232437e", //the bidding amount will be refunded to refundAddress in proportion
"refundCfg":10380050 //refund configuration
"state": { //state change of state objects
"0x7C3b00CB3B40Cc77d88329A58574E29cFA3cb9E2": { //The address of the state object where the data changes, which can be EOA or smart contract
"0x935b605129a438014d6ae0692623c5e1fbf83d5a631f5a0f8489a301966cf608": "0x00000000000000000000000000000000000000000000010c86a7e418723ffc00"
//"the Key of the changed data in state object":"the Value of changed data in state object"
}
}
}
```