Understanding the Data Structure - Algorand

Understanding the Data Structure

post by anoushka on Jun 29, 2022

Hi I’m new here. Can someone explain the underlying data structure of where the accounts, assets and smart contracts exactly lie in relation to each other on the blockchain including the metadata in the json file? I just need a clarity regarding this.

post by fabrice on Jun 30, 2022

Hi @anoushka, which metadata and JSON are you talking about?

Is it for creating NFTs? If yes, I recommend reading Create an NFT - Algorand Developer Portal (after reading the sections before ideally.)

All the transactions are stored in blocks composing the blockchain.

When you create an asset/ASA/NFT, the ASA parameters are stored in the transaction fields of the transaction creating the ASA.

These ASA parameters are therefore stored in the blocks of the blockchain (since transactions are stored in blocks).

A couple of notes:

Now for technical details that may or may not be relevant

Archival nodes store all the blocks.

They also compute from the transactions in the blockchain the “state of the blockchain” which is composed of all the assets/ASA created (with ASA parameters), all the applications created, as well as the balances and “local state” of all the accounts (+ some other information for consensus etc).

(Concretely the blocks and the state of the blockchain are stored in sqlite databases inside each node. But again, this is just a technical detail as other implementations of nodes may do things differently.)

Non-archival nodes store the state of the blockchain and the last 1000 nodes.

A diagram about all of that:

If what I said above does not seem to make sense, I highly encourage you to first read What is a blockchain? - Algorand Developer Portal

Related topics

Topic Replies Views Activity
Adding meta data to an asset 9 944 Jun 2022
How to build a database on Algorand? 5 608 Jun 2022
ARC-0003 - Algorand Standard Asset Parameters Conventions for Fungible and Non-Fungible Tokens 12 2400 Mar 2023
NFT smart contract 1 479 Sep 2021
NFT marketplace general smart contract architecture question 2 1000 Mar 2022