How to link arweave metadata to ERC721 contract?


I successfully worked with IPFS Folders to host and access my metadata with an ERC-721 contract.
My json files are stored in an IPFS folder and the files named 1,2,3,4....

If I query tokenURI(1) i get

If I query tokenURI(2) i get

So far so good. File "1" is a json holding information and linking to the image url.
Everything works as expected - no problems so far. Linking to image and metadata works fine.

No I wanted to try Arweave for persisting metadata.
I upload the images in a folder named "images" and get for an example image the following id:
This can be viewed with:

Second step is creating the metadata.json file with the corresponding image arweave uris.

Metadata is designed like "ERC721 Metadata JSON Schema" defines and holds the information regarding the image.

"image": "",

I call this file "1" and save it on arweave within the folder metadata.
The folder lives here:

If I set the uri within the contract at the folder ID:
and try to get the Token URI I won´t get informations regarding the item.**1**
--> this won´t work because the file has an onw unique id in arweave and can´t be found with "/1".

The json itself has a different address:

So I conclude I´d had to map every address to the corresponding path. I understand, that this is a no go...

Another option would be to put all metadata json elements in one file save it to arweave and query only the part needed with an API like
"https:/myrestapi/1" --> loads the json json from arweave and parses the element given in the uri ("/1".

[ element: 1 {
{ name: "1",
"image": "",
element: 2 {
{name: "2",
"image": "",

API submitted with /1 gives:

{ name: "1",
"image": "",

How do I link metadata json files held in arweave the right way?
Hopefully I missing something. Seems like a bad workaround because the interface can be shut down and the NFTs won´t find their metadata.

Thank you for your help!

1 Like

I'm not familiar with Arweave so I can't answer about that. For IPFS there exists the possibility to upload a directory rather than a file, so when you request .../1 you get the file called "1" inside the directory, and this can be used for NFT ids. See:

If there is nothing like this for Arweave then this pattern is not possible and you would have to use ERC721URIStorage to set a different tokenUri for each id.

Hi frangio,
thank you for your help. I worked with IPFS in the past and ipfs://<ipfs_hash_of_the_folder>/1 worked fine. I assumed that I can do the same in arweave - upload a folder here and fill it with the files 1,2,3,..
But I think this is not as easy as expected. ERC721URIStorage needs a token already minted for setting the URI. In my imagination this could be very expensive to set for every token on ethereum.
I opened a ticket at arweave as well... If I get an answer I will update here, too.

Hi all found a solution.

For all others struggling:

You can just upload a folder with:

install it and run:

arkb deploy /path/to/your/folder/

It will upload and give you a hash - you can access all items in given folder with hash/filename.

Additional information here:

1 Like

Hey unforetunately Arweave saves their files to a transaction file hash not a folder hash so there is no file string where you can use a subfolder after a transaction hash.

arkb deploy folder/ = transaction hash which != transaction hash/file.json

But the path manifest [second link you posed] is a json file with each transaction string, you can parse that file for the location of each file inside of the bundle.

1 Like