
Subscribe to Bharatharaj Babu

Subscribe to Bharatharaj Babu
Share Dialog
Share Dialog
<100 subscribers
<100 subscribers
Hey, so this is going to be a continuation of part 1, so if you haven’t checked that out yet, do check it out. Here’s a link to part 1.
This post is going to be more of a technical overview as to how Mirror works under the hood.
Firstly, if you look at any post in Mirror - you can see that the URL field looks like this - this is a link to my previous post : https://mirror.xyz/bharatharaj.eth/QvilRuMhb9qdFsZWntoK85hU_U9HRGlABk2G3av6HlA
Here, the part after mirror.xyz represents my wallet address, in this case it is a ENS domain, which can also be linked to mirror, but a wallet address can also be used here.
The part after the wallet address is called a content digest, something that lets us identify our post.
Now, with a content digest , let us try to view our data in Arweave. Now for this, we need to use Arweave's Graph QL playground. This playground lets you execute GraphQL queries on the Arweave data. Here’s a link to the playground.
Now I’m not that familiar with GraphQL, but its basically a way of making requests to a backend for a piece of data. Now, if we want to see our data in the the Arewave explorer, we need the transaction ID of the arweave transaction. And for this, we will be using the playground to run a query that returns us the transaction ID associated with a given content digest.
Now, the query for returning the Arweave transaction ID given the content digest looks like this:

Now, from the right side, we can see the response which is a list of transaction IDs generally as we can update a Mirror post multiple times, and each update is sent as a separate transaction in Arweave.
Now if we take this transaction ID, and put in an Arweave explorer, we get the following: here’s a link to the Areweave explorer that I’m using

From this, by clicking on the link, you can view the JSON data that was put into Arweave. I’ve attached the JSON data from my previous post below.

So the above JSON data also contains the ECDSA signature of the author which is signed with the author’s private key indicating that the data was not tampered with. In the bottom part of the above JSON data, you can see this JSON: so this represents the NFT meta-data that is used while minting the NFT.
"wnft":{"chainId":10,"description":"Hey, so today I decided to do a deep dive into the Mirror.xyz platform, to understand how it works, and why it’s really cool to use this as a publishing platform.\n","fee":250,"fundingRecipient":"0xE6D5514b8De7ef9E5F5c4cc2E8cA0207129DEB65","imageURI":"bafkreiat37fikuqqip5olemxruk3b37gldfgnj4uwthw66xgz3auevbqh4","mediaAssetId":196422,"name":"Day 8: Deep Dive into the Mirror Platform - Part 1","nonce":1210240,"owner":"0xE6D5514b8De7ef9E5F5c4cc2E8cA0207129DEB65","price":0.01,"proxyAddress":"0x3C1A02D4E81F833BBd710E31d3011Bda1cB87354","renderer":"0x0000000000000000000000000000000000000000","supply":50,"symbol":"DAY8DEEPDIVEINTOTHEMIRRORPLATFORM-PART1"}
Now, I tried to see if I could find this NFT contract on the Optimism Explorer, but was unable to find it since the contract was not deployed yet.
So, the ERC-721 contract is only deployed after the first collector agrees to purchase the post as an NFT. The smart contract called Mirror Writing Editions Factory is what deploys the smart contract when the first collector decides to buy it. So, the first collector will have higher gas fees compared to the rest of the collectors.
I went through the optimism etherscan of some posts that had NFTs minted. So in the above piece of code, there is a field called proxyAddress that represents the address at which the NFT contract will be deployed at when there is a buyer. Every post on Mirror gets its own proxy address where the NFT contract will be deployed at.
Also, this got me wondering: how do you deploy a smart contract straight to a specific address - so this is what I found - so the address at which a contract is deployed at is determined based on the address of the deployer and the deployer’s total number of transactions (nonce). So, we will be able to work out the address before it is deployed. But I’m still not clear as to how its able to be done but would love to know if anyone has an idea.
Also, the imageURI of the NFT is uploaded to IPFS, and from its CID bafkreiat37fikuqqip5olemxruk3b37gldfgnj4uwthw66xgz3auevbqh4 we can see how it looks by using an IPFS gateway:

You can also see the details of every post at the bottom which shows the Arweave transaction ID, my account address, and the content digest which is present in the URL.

So, that ends it here, hope you found it interesting. will make a separate post for the remaining stuff - if I’m doing anything further today.
Hey, so this is going to be a continuation of part 1, so if you haven’t checked that out yet, do check it out. Here’s a link to part 1.
This post is going to be more of a technical overview as to how Mirror works under the hood.
Firstly, if you look at any post in Mirror - you can see that the URL field looks like this - this is a link to my previous post : https://mirror.xyz/bharatharaj.eth/QvilRuMhb9qdFsZWntoK85hU_U9HRGlABk2G3av6HlA
Here, the part after mirror.xyz represents my wallet address, in this case it is a ENS domain, which can also be linked to mirror, but a wallet address can also be used here.
The part after the wallet address is called a content digest, something that lets us identify our post.
Now, with a content digest , let us try to view our data in Arweave. Now for this, we need to use Arweave's Graph QL playground. This playground lets you execute GraphQL queries on the Arweave data. Here’s a link to the playground.
Now I’m not that familiar with GraphQL, but its basically a way of making requests to a backend for a piece of data. Now, if we want to see our data in the the Arewave explorer, we need the transaction ID of the arweave transaction. And for this, we will be using the playground to run a query that returns us the transaction ID associated with a given content digest.
Now, the query for returning the Arweave transaction ID given the content digest looks like this:

Now, from the right side, we can see the response which is a list of transaction IDs generally as we can update a Mirror post multiple times, and each update is sent as a separate transaction in Arweave.
Now if we take this transaction ID, and put in an Arweave explorer, we get the following: here’s a link to the Areweave explorer that I’m using

From this, by clicking on the link, you can view the JSON data that was put into Arweave. I’ve attached the JSON data from my previous post below.

So the above JSON data also contains the ECDSA signature of the author which is signed with the author’s private key indicating that the data was not tampered with. In the bottom part of the above JSON data, you can see this JSON: so this represents the NFT meta-data that is used while minting the NFT.
"wnft":{"chainId":10,"description":"Hey, so today I decided to do a deep dive into the Mirror.xyz platform, to understand how it works, and why it’s really cool to use this as a publishing platform.\n","fee":250,"fundingRecipient":"0xE6D5514b8De7ef9E5F5c4cc2E8cA0207129DEB65","imageURI":"bafkreiat37fikuqqip5olemxruk3b37gldfgnj4uwthw66xgz3auevbqh4","mediaAssetId":196422,"name":"Day 8: Deep Dive into the Mirror Platform - Part 1","nonce":1210240,"owner":"0xE6D5514b8De7ef9E5F5c4cc2E8cA0207129DEB65","price":0.01,"proxyAddress":"0x3C1A02D4E81F833BBd710E31d3011Bda1cB87354","renderer":"0x0000000000000000000000000000000000000000","supply":50,"symbol":"DAY8DEEPDIVEINTOTHEMIRRORPLATFORM-PART1"}
Now, I tried to see if I could find this NFT contract on the Optimism Explorer, but was unable to find it since the contract was not deployed yet.
So, the ERC-721 contract is only deployed after the first collector agrees to purchase the post as an NFT. The smart contract called Mirror Writing Editions Factory is what deploys the smart contract when the first collector decides to buy it. So, the first collector will have higher gas fees compared to the rest of the collectors.
I went through the optimism etherscan of some posts that had NFTs minted. So in the above piece of code, there is a field called proxyAddress that represents the address at which the NFT contract will be deployed at when there is a buyer. Every post on Mirror gets its own proxy address where the NFT contract will be deployed at.
Also, this got me wondering: how do you deploy a smart contract straight to a specific address - so this is what I found - so the address at which a contract is deployed at is determined based on the address of the deployer and the deployer’s total number of transactions (nonce). So, we will be able to work out the address before it is deployed. But I’m still not clear as to how its able to be done but would love to know if anyone has an idea.
Also, the imageURI of the NFT is uploaded to IPFS, and from its CID bafkreiat37fikuqqip5olemxruk3b37gldfgnj4uwthw66xgz3auevbqh4 we can see how it looks by using an IPFS gateway:

You can also see the details of every post at the bottom which shows the Arweave transaction ID, my account address, and the content digest which is present in the URL.

So, that ends it here, hope you found it interesting. will make a separate post for the remaining stuff - if I’m doing anything further today.
No activity yet