Assets, also called tokens, are used to represent physical assets (houses, machines, ingots, ...) or digital assets (photos, videos, ...) on the blockchain. Within a normal transaction that sends bitcoins from Alice to Bob, information is added (using for example the OP_RETURN) that certifies the sending of a certain amount of assets. In this way, the fact that Bob is now also the owner of the assets received is recorded on the blockchain. As the assets are assets, these transactions are carried out to certify 'real-world' events in the blockchain, such as the sale of gold bars from Alice to Bob.
There are numerous protocols for manipulating assets in the blockchain, one of the most used is Counterparty, which manages the creation and exchange of assets on Bitcoin.
The [login to view URL] site is an explorer of Counterparty. Displays information about all created assets (about 74000) and all Bitcoin transactions that exchange assets.
Extend the tool by adding the Asset class to the metadata package. The class must contain the getCounterpartyAssets method that renders the list of assets registered on xhcain (to do this, parry all the assets on the assets page, you don't need to browse any blockchains).
Precisely, for each asset, the method adds the following fields (comma separated) to a local [login to view URL] file:
name;
description;
total supply
a Boolean that indicates if the asset is divisible;
a Boolean that indicates if the asset is locked.
Once you have obtained the Asset list, create a second script that, using the API* (precisely the API /api/holders/{asset}), retrieves the information about the BTC addresses that own the assets. For each asset found, save the following data to a database:
name;
description;
total supply
a Boolean that indicates if the asset is divisible;
a Boolean that indicates if the asset is locked;
list of addresses that own the asset;
quantity of assets owned by each address.
NB: since there is no API available that makes the list of registered Assets, the first script of the project cannot be created using the API but it is necessary, as specified, to parse the assets page.