{ "cells": [ { "cell_type": "markdown", "id": "d4e5f6a7-0004-0000-0000-000000000001", "metadata": {}, "source": [ "# The Trust Proof\n", "\n", "This notebook reconstructs the entire AnchorRegistry from on-chain events alone.\n", "\n", "> **No AnchorRegistry API. No Supabase. No account.**\n", "> Just an RPC endpoint and the contract address.\n", "> If AnchorRegistry's servers disappeared tomorrow, this notebook would still work.\n", "\n", "> These examples run against Sepolia testnet (`network=\"sepolia\"`).\n", "> To run against Base mainnet: replace `configure(network=\"sepolia\")` with `configure(network=\"base\")`.\n", "> All function calls, record structures, and output shapes are identical across networks." ] }, { "cell_type": "code", "execution_count": 1, "id": "d4e5f6a7-0004-0000-0000-000000000002", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Contract: TBD\n", "Scanning from block: None\n" ] } ], "source": [ "# Cell 1 — what you need\n", "# - An Ethereum RPC endpoint (Infura, Alchemy, or your own node)\n", "# - The contract address (public on Etherscan forever)\n", "# Nothing else.\n", "\n", "from anchorregistry import configure, get_all, to_dataframe, BASE_SEPOLIA_RPC, V1A_BASE_SEPOLIA\n", "from anchorregistry.constants import CONTRACT_ADDRESS, DEPLOY_BLOCK, RPC_URL\n", "\n", "configure(\n", " network=\"base-sepolia\",\n", " contract_address=V1A_BASE_SEPOLIA,\n", " rpc_url=BASE_SEPOLIA_RPC, # swap for Infura / Alchemy URL for faster scans\n", ")\n", "print(f\"Contract: {CONTRACT_ADDRESS}\")\n", "print(f\"Scanning from block: {DEPLOY_BLOCK}\")\n", "print(f\"RPC endpoint: {RPC_URL}\")" ] }, { "cell_type": "code", "execution_count": 2, "id": "d4e5f6a7-0004-0000-0000-000000000003", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Total anchors recovered: 5\n" ] } ], "source": [ "# Cell 2 — reconstruct the full registry\n", "records = get_all()\n", "print(f\"Total anchors recovered: {len(records)}\")" ] }, { "cell_type": "code", "execution_count": 3, "id": "d4e5f6a7-0004-0000-0000-000000000004", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'ar_id': 'AR-2026-dPXazj6',\n", " 'registered': True,\n", " 'artifact_type_index': 1,\n", " 'artifact_type_name': 'RESEARCH',\n", " 'tx': '0x826f623ce984a9cadeb5d72c710d279e7385cd83ee4815d092e393d5d574ec57',\n", " 'block': 40225238,\n", " 'registrant': '0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44',\n", " 'manifest_hash': '981e16e83f1e0068d87a89e04962b9287bb5f024782beca6fec837304e8c308e',\n", " 'parent_ar_id': '',\n", " 'descriptor': '',\n", " 'title': 'test sepolia anchor',\n", " 'author': '',\n", " 'tree_id': '0xf07140ce4deaf3b5dac859091a079f82e9656f173593feda7895d940b8fa5d13',\n", " 'token_commitment': '0xf07140ce4deaf3b5dac859091a079f82e9656f173593feda7895d940b8fa5d13',\n", " 'data': {'doi': '',\n", " 'institution': '',\n", " 'co_authors': '',\n", " 'url': 'https://anchorregistry.com/'}}" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Cell 3 — inspect a single record (raw dict)\n", "records[0]" ] }, { "cell_type": "code", "execution_count": 4, "id": "d4e5f6a7-0004-0000-0000-000000000005", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ar_idregisteredartifact_type_indexartifact_type_nametxblockregistrantmanifest_hashparent_ar_iddescriptor...data_data_versiondata_formatdata_row_countdata_schema_urldata_urlcode_git_hashcode_licensecode_languagecode_versioncode_url
0AR-2026-dPXazj6True1RESEARCH0x826f623ce984a9cadeb5d72c710d279e7385cd83ee48...402252380xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44981e16e83f1e0068d87a89e04962b9287bb5f024782bec......NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
1AR-2026-86pNXz1True2DATA0xb050ffe1e882221230d5d2d7c5f68a2eaab9309c065f...402252770xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44e4fde52cce29d5efc0cd0d4a076d410e568937d7d2007f...AR-2026-dPXazj6...https://anchorregistry.com/NaNNaNNaNNaNNaN
2AR-2026-yPZBgoPTrue0CODE0x4935e22226509ac7bba092a15f01646d252b22ffe242...402539500xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c447befa395c06769bdaf5ddfd3e94a3f79ac6ff67a367dfd......NaNNaNNaNNaNNaN
3AR-2026-A5kgam5True0CODE0x01c336d30186a283a767d1830bdaf2a8ccecd52142db...402545590xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c4440a11cdd88c0df54d1be354dc54e927360376e6080ab76......NaNNaNNaNNaNNaN
4AR-2026-L5RMQQ6True0CODE0x9532d06aaa4d802b09a387531116641436f42743e4dd...402546840xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c4419b09e8ff3e6ae46cfd3c98bc9983ee89d4c319cf4538b......NaNNaNNaNNaNNaN
\n", "

5 rows × 28 columns

\n", "
" ], "text/plain": [ " ar_id registered artifact_type_index artifact_type_name \\\n", "0 AR-2026-dPXazj6 True 1 RESEARCH \n", "1 AR-2026-86pNXz1 True 2 DATA \n", "2 AR-2026-yPZBgoP True 0 CODE \n", "3 AR-2026-A5kgam5 True 0 CODE \n", "4 AR-2026-L5RMQQ6 True 0 CODE \n", "\n", " tx block \\\n", "0 0x826f623ce984a9cadeb5d72c710d279e7385cd83ee48... 40225238 \n", "1 0xb050ffe1e882221230d5d2d7c5f68a2eaab9309c065f... 40225277 \n", "2 0x4935e22226509ac7bba092a15f01646d252b22ffe242... 40253950 \n", "3 0x01c336d30186a283a767d1830bdaf2a8ccecd52142db... 40254559 \n", "4 0x9532d06aaa4d802b09a387531116641436f42743e4dd... 40254684 \n", "\n", " registrant \\\n", "0 0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44 \n", "1 0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44 \n", "2 0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44 \n", "3 0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44 \n", "4 0xc7a7afde1177fbf0bb265ea5a616d1b8d7ed8c44 \n", "\n", " manifest_hash parent_ar_id \\\n", "0 981e16e83f1e0068d87a89e04962b9287bb5f024782bec... \n", "1 e4fde52cce29d5efc0cd0d4a076d410e568937d7d2007f... AR-2026-dPXazj6 \n", "2 7befa395c06769bdaf5ddfd3e94a3f79ac6ff67a367dfd... \n", "3 40a11cdd88c0df54d1be354dc54e927360376e6080ab76... \n", "4 19b09e8ff3e6ae46cfd3c98bc9983ee89d4c319cf4538b... \n", "\n", " descriptor ... data_data_version data_format data_row_count \\\n", "0 ... NaN NaN NaN \n", "1 ... \n", "2 ... NaN NaN NaN \n", "3 ... NaN NaN NaN \n", "4 ... NaN NaN NaN \n", "\n", " data_schema_url data_url code_git_hash code_license \\\n", "0 NaN NaN NaN NaN \n", "1 https://anchorregistry.com/ NaN NaN \n", "2 NaN NaN \n", "3 NaN NaN \n", "4 NaN NaN \n", "\n", " code_language code_version code_url \n", "0 NaN NaN NaN \n", "1 NaN NaN NaN \n", "2 \n", "3 \n", "4 \n", "\n", "[5 rows x 28 columns]" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Cell 4 — load into DataFrame\n", "df = to_dataframe(records)\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 5, "id": "d4e5f6a7-0004-0000-0000-000000000006", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "artifact_type_name\n", "CODE 3\n", "DATA 1\n", "RESEARCH 1\n", "dtype: int64" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Cell 5 — explore the registry by artifact type\n", "df.groupby(\"artifact_type_name\").size().sort_values(ascending=False)" ] }, { "cell_type": "code", "execution_count": 6, "id": "d4e5f6a7-0004-0000-0000-000000000007", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "AR-2026-dPXazj6 — RESEARCH — test sepolia anchor\n" ] } ], "source": [ "# Cell 6 — reconstruct a specific tree\n", "from anchorregistry import get_by_tree\n", "\n", "tree = get_by_tree(\"0xf07140ce4deaf3b5dac859091a079f82e9656f173593feda7895d940b8fa5d13\")\n", "for anchor in tree:\n", " indent = \" \" * (1 if anchor[\"parent_ar_id\"] else 0)\n", " print(f\"{indent}{anchor['ar_id']} — {anchor['artifact_type_name']} — {anchor['title']}\")" ] }, { "cell_type": "code", "execution_count": 7, "id": "d4e5f6a7-0004-0000-0000-000000000008", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Registered: True\n", "Manifest hash: 981e16e83f1e0068d87a89e04962b9287bb5f024782beca6fec837304e8c308e\n" ] } ], "source": [ "# Cell 7 — verify a specific artifact\n", "from anchorregistry import verify\n", "\n", "result = verify(\"AR-2026-dPXazj6\")\n", "print(f\"Registered: {result['registered']}\")\n", "print(f\"Manifest hash: {result['manifest_hash']}\")" ] }, { "cell_type": "markdown", "id": "d4e5f6a7-0004-0000-0000-000000000009", "metadata": {}, "source": [ "---\n", "\n", "The output above was generated entirely from public Base event logs.\n", "\n", "The contract address is permanent. The deploy block is documented.\n", "Any RPC endpoint works. **The registry cannot be suppressed.**" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.15" } }, "nbformat": 4, "nbformat_minor": 5 }