Adding meta data to an asset - Algorand
Adding meta data to an asset
post by anoushka on Jun 27, 2022
If I want to create an asset out of my song, how can I add metadata to this asset?
post by Maugli on Jun 27, 2022
Hi, @anoushka, welcome!
You can specify an URL when you create your asset. Also, you can create a hash256 value from your song, and specify it when you create your asset. This “proves” on the blockchain that you had access to this song at the time of asset creation.
After asset creation, you can add information in the note field of a transaction, up to 1024 bytes, so you can enter URL or IPFS filename here. But don’t forget that others can access it, as the note field of the Algorand blockchain is public. If you want to store information in a secure way, encrypt it first.
post by anoushka on Jun 27, 2022
If I add my metadata to that URL, will it be on the blockchain?
post by Maugli on Jun 27, 2022
No, definitely not. It will be on the http server the URL points to.
See also ARCs/arc-0003.md at main · algorandfoundation/ARCs · GitHub and ARCs/arc-0069.md at main · algorandfoundation/ARCs · GitHub
post by anoushka on Jun 27, 2022
then how do I keep it on chain?
post by Maugli on Jun 28, 2022
Volume data should be stored separately, not on the blockchain.
Only a pointer to the volume data – in your case a pointer to your song – should be stored on the blockchain.
post by fabrice on Jun 28, 2022
To complement @Maugli’s answer: you can store small amounts of data on-chain but most blockchains (including Ethereum) are not made to store large amounts of data.
This is because storing data has a huge cost (cost of disk) and storing data on-chain has even more cost as it’s replicated by all (archival) nodes of the chain.
Because of that, the real cost of storing on-chain needs to be much much higher than storing on AWS S3 for example.
Blockchains provide transparency, immutability, and auditability.
If you want storage, you want to use dedicated solutions such as IPFS (https://ipfs.io/) and https://www.arweave.org/. And then you want to point to the IPFS/arweave location.
Note that doing so does not reduce security: arweave and IPFS URL contain a hash of the data, so anyone recovering the data from such a service can then check it matches the URL.
In other words, even if IPFS/arweave get attacked, the worst that can happen is that your data is no more accessible. But anyone with a copy of the data can easily put the data back in IPFS/arweave and make it available again.
So you keep all the benefits of the blockchain doing so. But you do not pay the huge cost to store huge amounts of data. (You just pay the cost of IPFS pinning for example, which depends on the service you use for pinning.)
Now, for metadata, if you are using ARC-69, ARCs/arc-0069.md at main · algorandfoundation/ARCs · GitHub, the metadata would be on-chain directly as long as it’s small enough (less than 1kB).
If you’re using ARC-3, the metadata is off-chain in IPFS/arweave. But once again, doing so does not remove most advantages of using the blockchain.
post by anoushka on Jun 28, 2022
Thanks a lot, this helps
post by anoushka on Jun 29, 2022
So if I’m using IPFS, my data won’t be accessible on the blockchain by other accounts?
post by Maugli on Jun 29, 2022
Your data will be accessible by the IPFS filename, stored on the blockchain.
Blockchain data is PUBLIC, so others can read this filename, too.