From e8adc03caabbac644a3e8157c0daf2eee0963dd7 Mon Sep 17 00:00:00 2001 From: zzzckck Date: Thu, 5 Sep 2024 08:22:11 +0000 Subject: [PATCH] deploy: 38a80d0719ff42b406af6f5c934e8a1f0533d2d7 --- bnb-opbnb/faq/cross-chain-faqs/index.html | 2 +- .../developers/json-rpc-api/index.html | 1196 +++++++++++++++ .../json_rpc_apis/finality-api/index.html | 1314 +++++++++++++++++ .../developers/quick-guide/index.html | 2 +- bnb-smart-chain/index.html | 2 +- search/search_index.json | 2 +- sitemap.xml | 394 ++--- sitemap.xml.gz | Bin 1930 -> 1956 bytes 8 files changed, 2715 insertions(+), 197 deletions(-) create mode 100644 bnb-smart-chain/developers/json-rpc-api/index.html create mode 100644 bnb-smart-chain/developers/json_rpc_apis/finality-api/index.html diff --git a/bnb-opbnb/faq/cross-chain-faqs/index.html b/bnb-opbnb/faq/cross-chain-faqs/index.html index 2fee1321e4..e021ef0c21 100644 --- a/bnb-opbnb/faq/cross-chain-faqs/index.html +++ b/bnb-opbnb/faq/cross-chain-faqs/index.html @@ -2274,7 +2274,7 @@

Directly interacting with smart contract functions that exist on L2(opBNB) from L1(BSC), is not possible as all smart contracts on L2 are isolated from L1.

With that said, there is a way for developers to allow arbitrary message sending by writing their own contracts to build their required business logic. More details here.

Can I directly transfer assets between opBNB and Greenfield?

-

Currently, direct cross-chain transfers between opBNB and Greenfield are not supported. However, users can achieve cross-chain transfers between these two networks by conducting a two-step process through the Binance Smart Chain (BSC). This involves transferring assets from opBNB to BSC and then from BSC to Greenfield.

+

Currently, direct cross-chain transfers between opBNB and Greenfield are not supported. However, users can achieve cross-chain transfers between these two networks by conducting a two-step process through the BNB Smart Chain (BSC). This involves transferring assets from opBNB to BSC and then from BSC to Greenfield.

diff --git a/bnb-smart-chain/developers/json-rpc-api/index.html b/bnb-smart-chain/developers/json-rpc-api/index.html new file mode 100644 index 0000000000..cdd1be9b2f --- /dev/null +++ b/bnb-smart-chain/developers/json-rpc-api/index.html @@ -0,0 +1,1196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + JSON-RPC API - BSC Develop + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ + + +
+ + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + +

JSON-RPC API - BSC Develop

+ +

BSC (BNB Smart Chain) is EVM-compatible and strives to be as compatible as possible with the Go-Ethereum API. However, BSC also has unique features, such as faster finality and the storage of blob data on the execution layer, which require their own specialized APIs.

+

Geth(Go-Ethereum) API

+

BSC is nearly fully compatible with the Geth APIs. Any exceptions or incompatibilities are explicitly listed. If you’re looking for detailed usage of a specific API, you will most likely find the answer in the following link:

+

Geth JSON-RPC API documentation.

+

Finality

+

Ethereum’s PoS consensus protocol, known as “Gasper,” is built on LMD-GHOST (a fork choice rule) and Casper FFG (a finality gadget). Similarly, BSC’s consensus protocol, called “Parlia,” is constructed on top of a difficulty-based fork choice mechanism with FFG, as described in BEP-126. To further enhance BSC’s throughput, validators are allowed to produce multiple consecutive blocks, as explained in BEP-341. These differences result in BSC having a unique finality process compared to Ethereum. For more details, please refer to the the following doc:

+

BSC Finality API.

+ + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+ +
+ + + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bnb-smart-chain/developers/json_rpc_apis/finality-api/index.html b/bnb-smart-chain/developers/json_rpc_apis/finality-api/index.html new file mode 100644 index 0000000000..c13342190d --- /dev/null +++ b/bnb-smart-chain/developers/json_rpc_apis/finality-api/index.html @@ -0,0 +1,1314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + Finality API - BSC Develop + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + Skip to content + + +
+
+ + + +
+ + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + +
+
+ + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + +

Finality API - BSC Develop

+ +

Finality is a crucial aspect of blockchain security, ensuring that once a block is confirmed, it cannot be reversed or altered. This provides users with the confidence to act on the information in the block without delay.

+

Probabilistic Finality and Economic Finality

+

In probabilistic finality, the deeper a block is buried in the chain, the lower the likelihood of it being reverted. The more blocks follow a particular block, the more likely the chain containing that block will be the longest. Typically, BSC users should wait for at least 11 or 15 different validators to seal a block. If validators are allowed to produce multiple consecutive blocks, the number of blocks required to achieve probabilistic finality is approximately 11*n or 15*n, where “n” is the number of consecutive blocks produced.

+

Economic Finality refers to the high cost associated with reverting a block. In proof-of-stake systems that use a slashing mechanism (such as Casper FFG, Tendermint, or BSC Fast Finality), if validators violate the voting rules, part or all of their stake can be forfeited. This economic penalty makes it extremely expensive to undermine finality. Generally, block n achieves economic finality by block n+2, meaning that BSC Fast Finality reduces the confirmation time to two blocks in most cases. This improves the user experience by making transaction confirmation faster and more reliable.

+

Economic Finality API

+

eth_getHeaderByNumber as in the Ethereum client.

+

Parameters +1. QUANTITY|TAG +* HEX String - an integer block number +* String “earliest” for the earliest/genesis block +* String “latest” - for the latest mined block +* String “safe” - for the latest justified head block +* String “finalized” - for the latest finalized block

+

eth_getBlockByNumber as in the Ethereum client.

+

Parameters +1. QUANTITY|TAG +* HEX String - an integer block number +* String “earliest” for the earliest/genesis block +* String “latest” - for the latest mined block +* String “safe” - for the latest justified head block +* String “finalized” - for the latest finalized block +2. Boolean - If true it returns the full transaction objects, if false only the hashes of the transactions.

+

eth_newFinalizedHeaderFilter

+

Here are two APIs that can help you trace the latest finalized blocks: +1. Create a finalized header filter: +

curl -X POST "http://localhost:8545" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_newFinalizedHeaderFilter","params":[],"id":1}'
+
+This will return an rpc.ID which will expire in 5 minutes, then you can get another: +
{"jsonrpc":"2.0","id":1,"result":"0xcbdc7c21459e2cfbf72e2028f15a98c"}
+
+2. Get latest finalized blocks using above rpc.ID. You can call it many times until rpc.ID expires: +
curl -X POST "http://localhost:8545" -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0xcbdc7c21459e2cfbf72e2028f15a98c"],"id":1}'
+
+This will return block hashes: +
{"jsonrpc":"2.0","id":1,"result":["0x4b52061726b9f15905217699fd5dab8ff9bb704b3b16d27c34541cb15752a91f","0x2b984b80b25f0dddc92ba11290a3d250fc8a3ec6a09bd485c21dbbb8155d2f90"]}
+
+

Combined Probabilistic Finality and Economic Finality API

+

These methods allow you to handle block finality using a straightforward API.

+

eth_getFinalizedHeader

+
    +
  • verifiedValidatorNum must be within the range [1, len(currentValidators)].
  • +
  • This function calculates probabilisticFinalizedHeight as the highest height of the block verified by verifiedValidatorNum validators and then returns the block header with a height equal to max(fastFinalizedHeight, probabilisticFinalizedHeight).
  • +
  • The height of the returned block header is guaranteed to increase monotonically. +For example: +
    curl -X POST "http://localhost:8545/" -H "Content-Type: application/json"  --data '{"jsonrpc":"2.0","method":"eth_getFinalizedHeader","params":[15],"id":1}'
    +
  • +
+

eth_getFinalizedBlock

+
    +
  • verifiedValidatorNum must be within the range [1, len(currentValidators)].
  • +
  • This function calculates probabilisticFinalizedHeight as the highest height of the block verified by verifiedValidatorNum validators and then returns the block header with a height equal to max(fastFinalizedHeight, probabilisticFinalizedHeight).
  • +
  • If fullTx is true, the block includes all transactions; otherwise, only transaction hashes are included.
  • +
  • The height of the returned block is guaranteed to be monotonically increasing. +For example: +
    curl -X POST "http://localhost:8545/" -H "Content-Type: application/json"  --data '{"jsonrpc":"2.0","method":"eth_getFinalizedBlock","params":[11, false],"id":1}'
    +
    +curl -X POST "http://localhost:8545/" -H "Content-Type: application/json"  --data '{"jsonrpc":"2.0","method":"eth_getFinalizedBlock","params":[15, true],"id":1}'
    +
  • +
+ + + + + + + + + + + + + + + + +
+
+ + + +
+ + + +
+ +
+ + + + +
+ + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bnb-smart-chain/developers/quick-guide/index.html b/bnb-smart-chain/developers/quick-guide/index.html index f865c3c9da..9246fe7aa6 100644 --- a/bnb-smart-chain/developers/quick-guide/index.html +++ b/bnb-smart-chain/developers/quick-guide/index.html @@ -2123,7 +2123,7 @@

Get TokensJSON-RPC API

Interacting with BSC requires sending requests to specific JSON-RPC API methods. BSC’s APIs are compatible with Geth. -- JSON-RPC API

+- JSON-RPC API

Developer Tools