Skip to content

Instantly share code, notes, and snippets.

@rencryptofish
Created June 10, 2022 12:18
Show Gist options
  • Save rencryptofish/6ba1f8f68db52a152cecfac3c7b4267e to your computer and use it in GitHub Desktop.
Save rencryptofish/6ba1f8f68db52a152cecfac3c7b4267e to your computer and use it in GitHub Desktop.
finding deleted mirror posts

Mirror - Arweave Explained

Mirror posts look like https://mirror.xyz/0x58E3a8Bc8CBFC10AC2972Fb9d0cF359E21eae56b/ZIO--5ywx1z-aKs0KCQ2PeTNutVKune7zhA1D09R0q0

0x58E3a8Bc8CBFC10AC2972Fb9d0cF359E21eae56b is the ETH address

ZIO--5ywx1z-aKs0KCQ2PeTNutVKune7zhA1D09R0q0 is the Original-Content-Digest, a unique id mirror uses to store posts on Arweave

The easiest way to retrieve the arweave transaction associated with a mirror post is to use arweave's graphql endpoint: https://arweave.net/graphql

So for the above query for Original-Content-Digest

query {
transactions(tags: {name: "Original-Content-Digest", values: "ZIO--5ywx1z-aKs0KCQ2PeTNutVKune7zhA1D09R0q0"}, first: 2) {
    edges {
    node {
        id
        tags {
        name
        value
        }
    }
    }
}
}    

You'll get the following response

{
  "data": {
    "transactions": {
      "edges": [
        {
          "node": {
            "id": "HpcUE9Jigd0pvyYmNF6DjTljUSqn6Vecuf1hs50pdxk",
            "tags": [
              {
                "name": "Content-Type",
                "value": "application/json"
              },
              {
                "name": "App-Name",
                "value": "MirrorXYZ"
              },
              {
                "name": "Contributor",
                "value": "0x58E3a8Bc8CBFC10AC2972Fb9d0cF359E21eae56b"
              },
              {
                "name": "Content-Digest",
                "value": "810DD5o2elU0gX_opGJS8kIANVvZJUIyHW31tV5lPyk"
              },
              {
                "name": "Original-Content-Digest",
                "value": "ZIO--5ywx1z-aKs0KCQ2PeTNutVKune7zhA1D09R0q0"
              }
            ]
          }
        }
      ]
    }
  }
}

Pull out the transaction id: HpcUE9Jigd0pvyYmNF6DjTljUSqn6Vecuf1hs50pdxk

Arweave hosts on an endpoint to pull tx info: https://arweave.net/HpcUE9Jigd0pvyYmNF6DjTljUSqn6Vecuf1hs50pdxk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment