Rosetta API is a set of API protocols used to interface with blockchain software. Developed by Coinbase of the United States. It is now supported by many blockchain projects.

To put it simply, before the advent of this set of protocols, each blockchain project used its own API interface, but the vastly different interfaces implemented similar functions, which brought a lot of unnecessary work to the dockers of these software.

With the Rosetta API protocol, each project implements a set of servers that support the protocol change, so there is no need to rewrite the docking code on the client side.

This set of agreements is mainly divided into the following parts:

Construction

As the name suggests, the construction part is to create something from scratch. For example, the "address" in the blockchain, or in a broader sense, "the mechanism for locking and unlocking assets on the chain".

Just as a new employee needs to enter biometric information such as fingerprints or face into the company's access control system after joining the company, so that they can enter the company when they go to work. When creating an address, we also need to enter some information that only we know, so that we can later have the right to manage the assets in this address.

This is the role of the /construction/derive

Data

The blockchain can be understood as a global public database, so we need some APIs to obtain and retrieve data on the blockchain. For example, get the balance of an address. It is the /account/balance interface.

At the same time, using this interface to obtain balance, we can also verify the legitimacy of the address.

For another example, if you want to get the data of a certain block height, you use the /block interface.

summary

The emergence of Rosetta API provides great convenience for the block linking work, but due to the different understanding of the regulations of each project, various special situations will still occur in actual implementation, and adaptation is required.


Ljzn
399 声望102 粉丝

网络安全;函数式编程;数字货币;人工智能