GL1X · GenesisL1 explorer

GL1X docs · Science

MolNFT on GenesisL1

MolNFT records are scientific molecular records published as ERC-721 tokens on GenesisL1: a protein or nucleic acid structure with its identifiers, its experimental metadata, its sequences and its 3D coordinates. GL1X discovers the MolNFT collections, reads every record from the chain and from IPFS, indexes its sequences and structures, and makes them searchable, comparable, describable and provable. This page explains the records, how GL1X finds, reads, indexes and proves them, and what "verified" means precisely.

The two storage models give two kinds of guarantee. A MolNFT v2 record is contract state: the chain itself answers for every byte of it, at any block. A MolNFT v1 record keeps its content on IPFS, and its contract keeps only a content identifier (CID), a name computed from the content's SHA-256 hash. The bytes of a v1 record may come from any server; anyone can check them by hashing them again. GL1X reads both kinds the same way for search, and proves both on request.

The collections #

CollectionContractStorageContent
MolNFT v2 / PDB Bank0xd58b01f6c18086e5202cdc5d7ad3e41790360102on chainPDB entries: metadata, sequences and the BinaryCIF structure in contract state
MolNFT v1 / PDB0xde3723766bc32dcacd03c17baa400a7b36837ebaIPFS, anchored on chainPDB entries: metadata JSON and the PDB file on IPFS, the CID committed by the contract
MolNFT v1 / AlphaFold0xbf7491af3407816dfa88a5ea4c82e8a2b1d721edIPFS, anchored on chainpredicted models (AlphaFold DB) of UniProt accessions

Other ERC-721 collections are examined as candidates (molecular_candidates): a contract whose tokens prove to hold MolNFT content is added and indexed like the official ones (see Discovery of collections). On the public explorer on 20 October 2026 the index held 1,035,581 records in nine collections (769,729 v1, 265,852 v2) with 2,069,579 sequences.

Anatomy of a record #

MolNFT v2 (on chain) #

getMetadata(uint256) returns eleven strings: idcode (the PDB ID), header, accession_date, compound, source (organism), authors, resolution, experiment_type, sequence (FASTA, one record per chain as the PDB writes it, with mol: and length: tags), a JPEG image (base64) and the structure file (gzip-compressed BinaryCIF, base64). GL1X keeps at most 131,072 characters of each text field and 1,048,576 of the sequence field. A sequence field of a two-chain entry reads:

>1mnj_A mol:protein length:153  MYOGLOBIN
GLSDGEWQLVLNVWGKVEADVAGHGQEVLIRLFKGHPETLEKFDKFKHLKSEDEMKASEDLKKVGN…
>1mnj_B mol:protein length:153  MYOGLOBIN
GLSDGEWQLVLNVWGKVEADVAGHGQEVLIRLFKGHPETLEKFDKFKHLKSEDEMKASEDLKKVGN…

A structure too large for one token is split across child tokens (getChildren, getCombinedData), read and joined in order. GL1X reads each child's getMetadata and joins their structure fields in the order getChildren lists them, whitespace removed: two children at a time for pages and tools, one at a time in the indexer, and one by one in order for a proof, so that its list of calls is the same every time. The contract's own join, getCombinedData, makes the node read every child in a single call and join them in the EVM, the slowest way there is (and, for the largest records, more gas than a node allows one call), so GL1X asks it only when a child has no chunk to give (it reverts or answers nothing) or the joined fields do not inflate. A record may have 512 children at most; the joined text must decode to at most 16 MiB of gzip data, which must inflate to at most 64 MiB of BinaryCIF. tokenExists says whether the contract still holds the token. Everything is contract state: no external service is needed to read a v2 record, and every byte can be read again at any block.

MolNFT v1 (IPFS) #

tokenURI points to a metadata document on IPFS (ipfs://ROOT/metadata.json) that describes the entry and links its structure file (a PDB file, sometimes gzip-compressed, in a directory of its own). The contract commits to the CID; the content is addressed by its hash, so any copy of it can be checked against the chain.

A token is a MolNFT v1 record when its URI is an IPFS reference and its metadata links a structure file on IPFS. GL1X looks for that link in the metadata fields structure, structure_url, structureUrl, structure_uri, structureUri, pdb, pdb_url, model, model_url, file, content_url, properties.structure and properties.files[] (uri or url), then in image and animation_url, and takes the first whose file name names a structure: .pdb or .ent (PDB), .cif, .mmcif or .mcif (mmCIF), .bcif (BinaryCIF), each possibly followed by .gz (gzip). A structure linked by a plain https:// address is not fetched: GL1X proxies no arbitrary web content, and only IPFS content can be checked against a hash.

The metadata document may hold 1 MiB; a structure file 64 MiB, or 16 MiB compressed (64 MiB once inflated). An IPFS reference is ipfs://CID/path or a gateway address …/ipfs/CID/path; its CID must be a CIDv0 (Qm…) or a CIDv1 in base32 (b…), and its path at most 32 segments, none of them empty, . or ...

Metadata rarely states everything. When a v1 record's metadata lacks its PDB ID, its UniProt accession, its sequence or a title, GL1X reads the PDB file it links and takes HEADER (the header, its date and the PDB ID), TITLE, DBREF, DBREF1 and DBREF2 (the UniProt accession) and SEQRES (one sequence per chain). What the metadata states is never overwritten, and every field taken from the file is listed in the record's provenance as a locally parsed IPFS PDB record.

Content addressing #

A MolNFT v1 contract stores a short identifier, not the data. Content addressing is what makes that enough.

What a CID is #

A CID names a block of bytes by a cryptographic hash of those bytes. It has three parts: a version, a codec that says how the bytes are to be read, and a multihash (the hash function's code, the digest's length and the digest).

CIDv0CIDv1
Written asbase58btc, 46 characters, always Qm…a multibase prefix and its encoding: b for base32, the form GL1X accepts in references
Versionimplied (0)1
Codecalways dag-pb (a UnixFS node)raw (0x55: the bytes themselves) or dag-pb (0x70)
HashSHA-256SHA-256 (code 0x12, 32 bytes); identity (0x00) embeds a tiny block in the CID itself

GL1X verifies SHA-256 and identity CIDs. A block named with any other hash function is refused (ipfs_hash_unsupported): GL1X will not report as verified what it cannot recompute.

Why recomputing the CID proves the bytes #

SHA-256 is built so that finding two different inputs with the same digest is computationally infeasible. Bytes that hash to the digest inside a CID are therefore the bytes that CID names, whoever handed them over: a gateway is a courier, not a witness. The chain closes the loop. The contract's tokenURI names a root CID; that block lists the CIDs of what it contains; and so on down to the bytes of the file. Hashing every block on the way and comparing it with the CID that pointed to it proves the file is the one the token committed to. One changed byte changes that block's digest, hence its CID, hence the block that links to it, all the way up, and the check fails.

Files, directories and the hash tree #

IPFS stores a file as one or more blocks. A small file is a single block: either a raw block holding the bytes, or a dag-pb node whose UnixFS data holds them. A larger file is cut into chunks (the leaves) under parent nodes, each parent listing its children's CIDs and sizes; the root's CID thus commits to every byte (a Merkle tree). A directory is a dag-pb node with named links. A very large directory is sharded as a hash array mapped trie (HAMT): an entry's place is read from the hash of its name (the first 64 bits of MurmurHash3 x64 128, the UnixFS HAMT hash type 0x22), a few bits per level, the number of bits set by the shard's fanout. GL1X resolves plain and sharded directories, and rebuilds files from their chunks.

A worked example #

Twelve bytes, hello world and a newline, computed for this page (the last CID is also one of the vectors GL1X's tests check):

bytes             68 65 6c 6c 6f 20 77 6f 72 6c 64 0a
SHA-256           a948904f2f0f479b8f8197694b30184b0d2ed1c1cd2a1ec0fb85d299a192a447
as a raw block    01 55 12 20 + digest → base32 →
                  bafkreifjjcie6lypi6ny7amxnfftagclbuxndqonfipmb64f2km2devei4
as a UnixFS file  0a 12 08 02 12 0c 68 65 6c 6c 6f 20 77 6f 72 6c 64 0a 18 0c
                  (20 bytes: Data{Type = file, Data = the 12 bytes, filesize = 12})
its CIDv0         12 20 + SHA-256 of those 20 bytes → base58btc →
                  QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o

The same content has two CIDs because it was encoded two ways; each CID proves the encoding it names. A real MolNFT v1 record (2d60, token 34126) shows the whole chain of custody:

metadata.json     921 bytes, stored as a raw block:
                  bafkreienxkav67wqs4ipvoxtioerucvl3m7q7pnrm2prxwelwvq3votige
directory block   62 bytes: Link{Hash = that CID, Name = "metadata.json",
                  Tsize = 921}, then Data{Type = directory}
its CIDv1         bafybeifdfio2p2eoa67mu4ko7lf2jrdat3u63hqmz5fyutolcla5xnequu

The token's URI names the second CID. A gateway that hands out metadata.json with any byte changed produces a different file CID, a different directory block and a CID that no longer matches the one on chain.

How GL1X indexes MolNFT #

The molecular indexer (internal/bio) runs in the indexing process:

  1. Inventory. Each collection's current tokens are enumerated through ERC-721 (totalSupply, tokenByIndex), 40 tokens a page while fewer than 5,000 records wait, and walked again daily; records that leave the inventory are kept as retained (current_inventory false) so links and proofs keep working.
  2. Records. A pool of workers (GL1X_MOLECULAR_WORKERS, one per CPU from 6 to 16) reads each record: on chain for v2, through the configured IPFS gateways for v1 (proofs, below, check IPFS content against its CIDs). A worker takes the next record as soon as its own is stored, so a slow record holds nobody up. Records are read again weekly.
  3. Sequences. Every sequence of a record is stored, one row per chain (molecular_sequences): each chain of a v1 record's PDB file (SEQRES), each chain of a v2 record's sequence field (FASTA with one record per chain, typed by its mol: tag and checked against its length:; keys pdb-chain:A or sequence:N; a field of one record gives the key primary). Sequences are normalized the same way everywhere (the browser's own check uses the same rules) and hashed with SHA-256. The longest is the record's primary sequence.
  4. Structures. A second queue reads each record's structure file once (GL1X_STRUCTURE_WORKERS; a v1 record's file straight from IPFS through the metadata kept in step 2), keeps every polymer chain's CA trace, sequence, GSA string, confidence and UniProt accessions (molecular_chains3d), and a third queue compares the chains with the index (see Structures).
  5. Searchable in seconds. The BLAST databases and the structure index of every web process follow the tables within seconds: BLAST looks for new rows every 5 seconds, the structure index every 10 seconds, and both are rebuilt from scratch every six hours.

Discovery of collections #

The three official MolNFT contracts are known by address. Any other contract can become a collection. The chain indexer records every token contract whose Transfer events carry a token id as their fourth topic (the ERC-721 form) and every token id it has moved. Every minute the molecular indexer takes up to three of these contracts that are not yet collections, those whose name or symbol contains molnft, molecular, pdb or alphafold first. It reads the lowest token id it knows of each (or else the first one transferred) as if it were a MolNFT, and keeps the contract as a collection when that token proves to be a MolNFT v1 or v2 record by the rules above. A contract whose token proves nothing is examined again a day later; a contract with no token indexed yet is tried again after a delay that grows with each attempt; a recognized collection is checked again after 30 days.

Reading a record #

For each token GL1X asks the contract ownerOf, tokenURI, getMetadata and tokenExists at once:

  • v2. A contract that answers getMetadata with eleven strings and says the token exists holds a MolNFT v2 record. Its children are listed with getChildren; the structure is assembled later, by the structure queue.
  • v1. Otherwise the token URI is followed: a data: URI or inline JSON is read in place, an IPFS reference is fetched through the gateways (GL1X_IPFS_GATEWAYS, tried in order). The token is a v1 record when its metadata links a structure file on IPFS, as described above.
  • Neither. A token that is neither is not a MolNFT, and the job retries later; during discovery the contract is set aside.

Gateways must be public HTTPS origins (GL1X_IPFS_ALLOW_PRIVATE admits others for a gateway on the same machine or tests); redirects are not followed; each request may take 15 seconds and a whole read 120 seconds. For the index and the pages, IPFS content is fetched as files through the gateways, without checking each block against its CID; that check is the proof's job (below), and the record's provenance says so.

Sequences: normalization, keys and digests #

A sequence is hashed only after it is written one way, so that the same letters always give the same digest, on the indexer, in a proof and in the browser. The rules, in the order they apply:

StepRule
TextASCII only; at most one FASTA header line (>), dropped; blank lines ignored
Cleaningspaces, digits, . and - removed; letters upper-cased
Stopone * at the very end is removed; a * anywhere else refuses the sequence
Lettersonly A to Z may remain
Lengthat most 5,000 residues for the index (longer chains are listed as omitted)
Typethe declared type (mol: tag, or the residue names of SEQRES); otherwise nucleotide when every letter is an IUPAC nucleotide code (ACGTURYSWKMBDHVN), else protein
Uin a nucleotide sequence U becomes T, so RNA and DNA share one alphabet
DigestSHA-256 of the remaining letters as ASCII, written in hexadecimal

SEQRES residue names become one-letter codes: the twenty amino acids, SEC (U), PYL (O), ASX (B), GLX (Z), XLE (J) and UNK (X); A, C, G, U, T and their deoxy forms (DA, DC, DG, DT, DU); inosine (I, DI) as N; any other name as X. A v1 chain is typed nucleotide when every residue is a nucleotide.

Each sequence has a key, and a proof compares sequences key by key:

KeyWhere it comes from
pdb-chain:Aa v1 record's SEQRES chain A (pdb-chain:_ for a blank chain identifier); a v2 FASTA record named 1mnj_A
sequence:Nthe Nth record of a v2 sequence field whose name gives no chain
primarya v2 sequence field of one record (single-chain entries such as 1CRN), or a sequence the metadata states that matches no chain

The primary sequence is the longest chain that could be indexed (ties go to the lower chain identifier or key). A chain that cannot be indexed is listed in the record's omitted_sequences with the reason: for v1, sequence_limit_exceeded, inconsistent_declared_length, declared_length_missing or incomplete_seqres (fewer or more residues than SEQRES declares); for v2, invalid_sequence, sequence_limit_exceeded, empty_sequence or declared_length_mismatch. GL1X reads at most 1,024 chain records of one field.

Worked example (computed for this page). A single-chain field such as that of 1CRN (crambin), written in this form, gives one sequence under the key primary:

field     >1crn_A mol:protein length:46  CRAMBIN
          TTCCPSIVAR SNFNVCRLPG TPEAICATYT GCIIIPGATC PGDYAN
letters   TTCCPSIVARSNFNVCRLPGTPEAICATYTGCIIIPGATCPGDYAN   (46, protein)
SHA-256   6f284e8edba221b51718d8f6864cb976e35f7708dd5bccd0c144b6ebe307be6d

The spaces, the header and any line numbers vanish in normalization, so the same letters pasted with or without them give the same digest. A field of two or more records would instead give one key per chain (pdb-chain:A, pdb-chain:B…), each checked against its length:.

Structure files #

The structure queue reads a record's file once: a v1 file from IPFS through the metadata the indexer already kept (or, when that metadata links nothing, after reading the contract again), a v2 file assembled from the contract and inflated from gzip. The file is read by GL1X's own readers (PDB, mmCIF and BinaryCIF): the first model, the first alternate location of each residue, at most 2,000,000 atoms. Up to 1,000 polymer chains are kept with their CA (C3′ for nucleotides) trace, sequence of the residues with coordinates, mean B-factor or pLDDT, UniProt accessions (DBREF, struct_ref: those of the parts its coordinates hold, with every accession the file declares beside them), the biological assemblies holding it and, for protein chains of three residues or more, a GSA string; a chain of fewer than ten residues is kept but not searched, and identical chains (same kind, same sequence) point to the first. The file's SHA-256 and size, its entry ID, title, method, number of models, whether it is a predicted model and its biological assemblies are recorded in molecular_structures, with the outcome: complete, retry, failed (too large, or not a readable structure) or none (the record links no file). Neither failed nor none is final: the cause may have been a node or a gateway (before 3.4.0 a node that could not run a call within its gas cap or return-data limit was taken for the contract's answer), so such a structure is read again after 6 hours, then after twice as long each time, a week at most, while its record still links a structure, going back to the queue only while it is short (fewer than 100 records waiting). A node that cannot run a call is now a passing failure: retried two minutes later, then after twice as long each time, about 17 hours at most. The ligands, interfaces and pockets of the structure are written in the same transaction (see Ligand index and Structure analysis). Details of the readers: Reading structures.

Serving structure files #

The viewers of the pages, the research tools and the MCP tool get_molecule_structure read a record's file through GET /api/tokens/{contract}/instances/{id}/structure. A node returns the structure field of a v2 record only by reading it out of contract state one 32-byte slot at a time, so a large on-chain structure (a cryo-EM complex, a ribosome: hundreds of kilobytes to megabytes of base64 across several child tokens) can take a node tens of seconds per child, and minutes in all. Four things make that cost paid once, and keep it from crowding out the rest of the explorer:

  • The structure cache. Each file read is kept compressed on disk in GL1X_DATA_DIR/structure-cache, up to GL1X_STRUCTURE_CACHE_MB (2048 MB; 0 turns the cache off), the least recently used leaving first, and the latest 128 MB of files in memory too. An entry is read again from the chain after a week, so a record rewritten in its contract is followed. Each entry is written whole under a temporary name and renamed, and carries its key, size and SHA-256; its body is gzip, whose checksum covers every byte, so a damaged or foreign entry is a miss (and is removed), never wrong content; an entry that cannot be read for another reason (no file descriptor left, an I/O error) is left alone. Requests for one entry on disk share one read of it, and four entries are read at once. The web processes of a machine share the directory: a process reading a file from the chain marks it (a .loading file next to it, renewed every 10 seconds while the read lasts), and the others wait for that file instead of asking the node for the same megabytes; a mark nobody renews for 45 seconds, left by a process that stopped, is taken over. nginx keeps each file five minutes too. Proofs never use the cache: they read the chain.
  • Reads that finish, a few at a time. Whoever asks first — a viewer, a tool, an analysis, a preview image — one read of a file runs at a time in a process, detached from the request that started it, so no request's deadline cancels a read that others wait for or that the next request would find cached. At most three files are read from their source at once in each web process, and at most one of them for previews, ligands and analyses alone; a read that a viewer or a tool joins moves up. A read may take five minutes, each of its contract calls 90 seconds. A read still waiting for its turn that nobody has waited for in 10 seconds is dropped.
  • A lane of its own. Requests for structure files do not queue behind NFT images and metadata, nor hold their places: three at once in each web process and 24 more waiting (beyond that 503 nft_content_busy), requests for the same file sharing one, and the route passes by the API response cache and its admission gate (whose computations stop after 45 seconds). A file the cache holds needs no place at all.
  • An answer that says so. A request waits up to 90 seconds (below the 120 seconds the installed nginx waits); a structure still being read after that is answered 503 structure_loading with Retry-After: 3, and the read goes on. The viewers ask again by themselves, for up to six minutes, saying that the structure is still being read and how long they have waited, and show the server's own message when a file cannot be had.

The research tools that need the whole file on the server (the pH tool and crosslinks) read it through the same lane and cache, wait until a few seconds before their own deadline and then answer 503 structure_loading (or structure_busy when the lane is full); a record's analysis made on request answers loading: true with a note while the file is being read, and is not counted as a failure. The interface asks again by itself, and its spinners say why. When the file read is not the one the index holds (the record changed on chain), a cached copy older than the index is read again once; otherwise the record goes back to the structure queue, which reads it again, and the tools answer 409 structure_changed meanwhile. A file is answered with an ETag (If-None-Match gives 304), gzipped as the cache stores it when the client takes gzip, and with X-Structure-Format and X-Structure-Binary headers. GET /api/bio/status reports the cache of the web process that answers (structure_cache: files served from it and from memory, files read from the chain, files, bytes, evictions).

Schedule, retries and refresh #

Each token has a job. The workers take retries first, then records waiting in the order they were queued; a job may run 270 seconds. A failed job is tried again two minutes later, then after twice as long each time, up to about 17 hours. When a v1 record's metadata reads but its PDB file does not, the record is stored from its metadata (searchable at once) and the job retries the file later (enrichment_retry). A job cut short because the indexer is stopping goes back to the queue as it was. The indexer pauses while the node is slow to serve new blocks. A collection reads scanning while its inventory is walked, indexing while its records wait to be read, complete when every current record is read, degraded while some of them wait for a retry, and retry when its inventory could not be read.

The tables:

TableHolds
molecular_collectionseach collection: version, storage, supply, scan progress, status, last error
molecular_candidatesERC-721 contracts waiting to be proven MolNFT or not
molecular_jobsone job per token of each collection's inventory: status, attempts, next attempt, last error
molecular_recordsone row per record: identifiers, title, primary sequence, owner, metadata URI, provenance, full-text search document
molecular_sequencesevery sequence of every record: key, chain, type, letters, length, SHA-256, primary flag, source, provenance
molecular_bandsMinHash bands of the sequences (shortlisting for the sequence search when BLAST is off): 16 bands of 4 values from a 64-slot signature over 5-letter words of proteins and 9-letter words of nucleotides
molecular_structuresone row per record's structure file: status, next attempt, format, source, size, entry ID, method, predicted flag, chains, biological assemblies
molecular_chains3done row per polymer chain: packed CA trace, sequence, GSA, mean B-factor or pLDDT, observed and declared accessions, assemblies, identical-chain link
molecular_comparisonsprecomputed TM-align comparisons: same entry across collections, experimental against predicted

Proofs #

Every sequence GL1X serves can be proven: derived again from the chain and from content-addressed IPFS data, independently of the index, and compared with what the index holds. A proof answers one question: are the letters the index serves for this record exactly those its token holds at a given block?

GET /api/bio/records/{contract}/{token_id}/proof?key=…&block=… (the Verify on chain button of BLAST hits and search results, MCP molecule_sequence_proof).

How a proof runs #

  1. The indexed side. The record's current sequences are read from the index (all of them, or the one key names), each with its SHA-256.
  2. The block. The proof pins one block: the one asked for, or two below the head by default, so every node behind a load-balanced address has it. The block's number, hash, state root and time go into the answer.
  3. The chain side. The record is read with contract calls pinned to that block, and the answer lists every call (eth_call replay list: contract, data, block) so anyone can replay it on their own node. Each call is kept with the size and SHA-256 of its result, whether the EVM reverted it, and the node's error, if any. A call the node fails to run at that block (not a revert) is asked again; if the node still will not answer there, the record is derived at its latest block and the answer says so (pinned_attempt). Proofs read the node with 60 seconds of patience and two retries, since a v2 record can be megabytes.
  4. The IPFS side (v1). The metadata, and the PDB file when the record's sequences or identifiers come from it, are read with every block checked against its CID (below).
  5. The derivation. The record is derived exactly as the indexer derives it: the same classification, the same enrichment from the PDB file, the same keys, the same normalization.
  6. The comparison. The derived sequences are normalized exactly as the indexer normalizes them and their SHA-256 compared with the index's: verified is true when every one matches. Every call carries the node's error, if any; ipfs_failures lists content that could not be verified with what each gateway did; derivation.reason explains a proof that derived nothing.

Calls and IPFS reads run side by side but are listed in a fixed order, so the same proof at the same block gives the same answer.

How IPFS content is verified #

For MolNFT v1, every IPFS block is checked against the hash its CID commits to: UnixFS files, directories and HAMT shards, raw blocks asked of the configured gateways and of gateways that serve raw blocks only, all at once. Two ways run side by side, and the first that verifies is used:

  • Raw blocks (method: raw). Each block is requested as …/ipfs/CID?format=raw with Accept: application/vnd.ipld.raw (the IPFS Trustless Gateway form) from every gateway at once; the first answer whose SHA-256 equals the CID's digest is used, and a gateway that answers other bytes is noted and ignored. The path is resolved one directory at a time (plain or HAMT-sharded), the file is rebuilt from its blocks, children read eight at a time. A block may be 2 MiB; a file tree and a HAMT may be 32 levels deep.
  • Rebuilt blocks (method: rebuilt). A gateway that serves files but not raw blocks still proves a file kept in directories of one entry each (as MolNFT v1 records are): the file is read through its path, its blocks are rebuilt from its bytes as the usual tools cut files (Kubo, js-ipfs/Helia and w3up defaults) and each directory's block from its entry, and the rebuilt blocks must hash to the CIDs up to the one the contract commits to.

The layouts GL1X rebuilds, each a balanced tree of fixed-size chunks:

ChunkLinks per nodeLeavesCID versionWhose default
256 KiB174raw blocks1Kubo and js-ipfs/Helia with CIDv1
256 KiB174UnixFS file nodes0Kubo and js-ipfs/Helia with CIDv0
256 KiB174UnixFS nodes, those after the first written as raw0the same, a variant
256 KiB174UnixFS file nodes1CIDv1 without raw leaves
1 MiB1,024raw blocks1w3up and ipfs-car

A directory holding other entries, or a file added with other settings, cannot be rebuilt from the file alone; the proof then says so, and only a gateway serving raw blocks can verify it. Either way nothing a gateway says is trusted: only bytes that hash to the expected CIDs are used.

What "verified" means #

In a proof, verified: true states three things, and only these:

  1. A MolNFT record was derived from the chain at the block the answer names (number, hash, state root): every contract call ran at that block on GL1X's node, or at its latest block when pinned_attempt says so.
  2. For a MolNFT v1 record, every IPFS byte the derivation read hashed, block by block, to the CIDs that lead down from the CID the token's URI names (ipfs[].verified).
  3. Every sequence checked (each current sequence of the record, or the one key names) came out of that derivation under the same key, with the same SHA-256 as the index holds.

Each check has a status: verified; mismatch (the sequence derived at this block differs from the indexed one, for instance because the record changed after it was indexed); or not_derived (the chain and IPFS data at this block do not yield that key).

What verified does not state:

  • That GL1X's node told the truth. The chain side rests on the node that answered. That is why every call is listed with the SHA-256 of its result and as a ready eth_call request: anyone can ask their own node at the same block and compare, and the block hash and state root pin the chain state described. The IPFS side needs no such trust.
  • That the coordinates were checked. A proof is about sequences. It reads a v1 structure file only when the record's sequences or identifiers come from it, and then that file is CID-verified like the metadata.
  • That the science is right. A proof ties the indexed letters to what the token holds. Whether the deposited structure is correct is a question for the structure's own validation.
  • That unreadable content is false. IPFS content that no node serves gives verified: false, with ipfs_failures saying what each gateway did: unproven, not disproven.

Reading a proof #

FieldMeaning
verifiedthe verdict above
blocknumber, hexadecimal number, hash, state root and time of the block; tag: "latest" and approximate after a fallback
checksper indexed sequence: status, indexed and derived SHA-256 and lengths, type, source, when it was indexed, a note
derived_sequencesevery sequence the derivation produced: key, chain, type, length, SHA-256, primary flag, source
derivationcomplete (a record was derived) and reason (why not)
chain_callseach call: contract, function signature, call data, block, result size and SHA-256, reverted, error
replaythe same calls as JSON-RPC eth_call requests
ipfseach verified file: URI, root CID, path, file CID, size, SHA-256, method (raw or rebuilt) and every block with its CID, codec, size, gateway and rebuilt flag
ipfs_failuresIPFS reads that could not be verified, with what each gateway did
recordthe storage and classification the index holds
pinned_attemptafter a fallback: the pinned block, the refused call and the node's error
methodthe method, in words

An illustrative excerpt (the block is made up; the digest is crambin's, from the example above):

{"verified": true, "classification": "molnft_v2_onchain",
 "block": {"number": 12345678, "number_hex": "0xbc614e", "hash": "0x…", "state_root": "0x…"},
 "checks": [{"sequence_key": "primary", "status": "verified", "indexed_length": 46,
             "indexed_sha256": "6f284e8e…07be6d", "derived_sha256": "6f284e8e…07be6d"}],
 "chain_calls": [{"function": "getMetadata(uint256)", "block": "0xbc614e", "result_sha256": "…"}]}

To check it yourself, send each replay request to your own node, hash the bytes of each result (the hexadecimal answer decoded) with SHA-256 and compare them with result_sha256, and compare the block hash. For a v1 record, fetch each listed block raw from any gateway that serves it and hash it.

Check with your own node #

On MolNFT v2 records, the visitor's browser reads the record from their own RPC endpoint (Settings), at a block a few seconds old (or the latest when the node refuses it), takes the sequence of the chain that was hit, normalizes it with the same rules and compares the SHA-256 with the index, without trusting anything the explorer read; a proof's calls can be replayed there too. The browser's normalization was checked against the indexer's own code on 627 inputs, and its reading of sequence fields on 304 fields (76 of them with several chains).

How proofs are tested #

The tests of internal/nft and internal/bio check: CID vectors (the hello world node above, the empty directory, text round trips of CIDs); MurmurHash3 against reference values; a directory, plain and HAMT-sharded, holding a chunked file served by fake gateways, where a lying gateway is skipped, the honest one used, and forged content refused when no gateway is honest; rebuilt files against the CIDs that the reference importer (ipfs-unixfs-importer 15) gives in four of the layouts, alone and in a directory, for files from empty to 46 MB (more than 174 chunks, so two levels of tree); the real record's directory above; and proofs end to end: a v2 record at one block, a v1 record with a forged structure block refused and a changed index entry reported, a node refusing the pinned block, and a gateway serving files only.

Record addresses #

Every MolNFT record has a page at an address made of what the record is, /molnft/{id}:

RecordAddressExample
An experimental structureits PDB ID, in capitals/molnft/100D (MolNFT v2 / PDB Bank #1)
A predicted modelits UniProt accession, in capitals; the fragments of a long protein after the first add -F and their number/molnft/X6R8D5 (MolNFT v1 / AlphaFold #1), /molnft/Q8WZ42-F2
A record named by a titleits name in words: letters and digits in lower case, words joined by hyphens, the punctuation inside a word left out/molnft/hla00001-a01010101 (MolNFT HLA #1, HLA00001 A*01:01:01:01)

The PDB ID comes first, also for a PDB entry whose file names its UniProt protein (7NIP, not Q8WZ42); a record whose MolNFT identifier is a PDB ID or an accession is addressed by it. A name in words has its Greek letters written out (β-lactamase is beta-lactamase), leaves out other letters outside ASCII and is at most 80 characters, cut between words.

Records that share an identifier are told apart by a number: the first holds the plain address, the next ones -2, -3…, the lowest number no record has (on gl1x.com the PDB entry 100D is in four collections: /molnft/100D is the PDB Bank's, /molnft/100D-2 MolNFT v1's). When addresses came (GL1X 3.5.0), the records already indexed were given theirs collection by collection, the largest first, and within a collection by token id. A new explorer, which has no record yet when it starts, gives them the same way once the molecular indexer has read its collections through, so its plain identifiers too go to the records of the main collections (records that could not be read the first time and collections found later are numbered as they come; a collection whose contract cannot be read holds nothing back, and the explorer waits a week at most). After that a record is given its address when the indexer first writes it, so the numbers of records indexed since follow each explorer's own history. An address, once given, stays the record's: it does not move when another record of the same identifier comes, and a record whose reading changes keeps it. Addresses are one in any case: /molnft/100d is sent (301) to /molnft/100D, as it was given.

The record's token page, /token/{contract}/instance/{id}, is sent (301) to its address, the query kept (?ligand=HEM:A:154, ?find=QEEY&chain=A). The address is the page's canonical address, and the one the sitemaps, the feed, IndexNow, the preview image (/og/molnft/100D.png), the structured data and the HTML for crawlers give, as do the links of every page and the answers of the API (path, url and links.record of records and hits, page_path of an NFT and of a collection's items, and molnft_paths, the addresses of the records an answer names, by contract:token). GET /api/molnft/{id} is the record an address names, in any case: id (the address as given), contract_address, token_id, path, token_path and record (its API); 404 molnft_not_found when no record has it. The search box, MCP search and the structure pickers open a pasted address of this explorer (https://gl1x.com/molnft/100D-2, or /molnft/100D-2); a link to another explorer's record page is searched by the record's identifier (100D), as that explorer may number its records otherwise.

curl -s 'https://YOUR-DOMAIN/api/molnft/100d'
curl -sI 'https://YOUR-DOMAIN/token/0xd58B01f6C18086e5202cdC5D7Ad3E41790360102/instance/1'   # 301, Location: /molnft/100D

A record that has none of a PDB ID, an accession, an identifier or a title keeps its token page as its address. On the upgrade to 3.5.0 the first process to start (gl1x run, gl1x index or gl1x serve) gives the archive its addresses in the background, in under a minute for a million records; until it is done, pages link records at their token pages, which are sent to the addresses once they exist. A record's own write never fails for its address: when the address cannot be written with it, the record is written without one, and every five minutes the process looks at the records written lately for one still without an address (and at every record when it starts and once a day: half a second for a million), and gives it its address. Search engines are told of the new addresses: the sitemaps list them with the date the address came, IndexNow sends the archive once more at them, and the token pages they know answer 301 (a token page of a record still without an address is read again within a minute, so it is sent on as soon as the address comes).

Collections and pictures #

The collections. /molnft shows every MolNFT collection the molecular indexer has found as a card, the largest first: its name, MolNFT version and storage, how many records it holds and its contract, its first five records (by token id) with their pictures, identifiers and titles, each linked at its address, and View all, the collection's whole inventory. Above them the page counts the records, the collections and the records of each MolNFT version. A paused collection, and one that holds no current record, is left out. The list is read once and kept ten minutes (refreshed in the background); for crawlers the page's HTML lists every collection with its first records, their pictures described. GET /api/molnft is the same list:

FieldMeaning
collections[]contract_address, name, symbol, version (v1, v2), storage (ipfs, onchain), records, path (the collection's page), inventory_path, items
items[]contract_address, token_id, id (the PDB ID, accession or identifier), title, path (the record's page), picture (its address, null for a record without one), structure, sequence_type, sequence_length
recordsthe records of every collection listed

limit (1 to 12, 5 by default) is how many records each card shows.

curl -s 'https://YOUR-DOMAIN/api/molnft?limit=5'

Pictures. Every MolNFT record that has a picture to show has one picture, the same everywhere: on its page, on the collections' cards, in its collection's inventory and in molecular search hits.

  • A MolNFT v2 record keeps a picture on chain beside its structure (the JPEG among the strings getMetadata returns, see MolNFT v2): its picture is that one, as it was saved.
  • A MolNFT v1 record links only its structure file: its picture is its molecule drawn from the structure (the backbone of each chain as a tube, coloured along the chain, a chain to a colour for a complex; 512×512 JPEG, 30–50 KB), by the server, the first time anyone asks for it — from the structure index, or from the record's own structure file when the index has not read it yet. It is kept, in memory for the requests that follow and on disk (GL1X_DATA_DIR/picture-cache) for every web process and restart, half a year, so every later visitor, whoever it is, gets it at once. The disk the pictures may take is a quarter of the disk free when the process starts, at most 40 GB, enough for the whole archive's (about 30 GB for a million records; GL1X_PICTURE_CACHE_MB sets it, 0 keeps them in memory only). Drawing one takes 0.1–0.2 s once the structure is read; requests for a picture being made wait for that one making, a few are made at once (with drawing slots of their own), and at most 256 more wait their turn. Opening /molnft starts drawing the pictures of the records its cards show.
  • Made before anyone asks. From two minutes after a web process starts, the pictures not kept yet are made in the background, one at a time and out of visitors' way (a picture a visitor asks for goes first), by one web process of a layout at a time (a Postgres advisory lock), every half hour again for records minted since, so the first visitor of a record's page and the image crawler reading the sitemaps find its picture made. It fills at most nine tenths of the picture cache: pictures visitors look at are never pushed out for it. GL1X_PICTURE_WARM=off leaves each picture to be made when first asked for.

A record has a picture when it keeps one on chain or has a structure to draw that is not one found to have none or that could not be read (its structure reading none or failed): its cards, its page, the collections page and the sitemaps show one only then.

A picture is at its record's page address, /molnft/{id}/picture.jpg (/molnft/100D/picture.jpg; an address written in another case is sent, 301, to the address as given), and by the record's contract and token, GET /api/bio/records/{contract}/{tokenId}/picture, for a record without an address. Browsers and a cache in front keep it a day (Cache-Control: public, max-age=86400, with an ETag); X-Picture-Source says what it is: onchain (the record's own, served as it was saved: its size and format are the record's), drawn, or fallback, a drawing that stands in for a v2 record's own picture while the chain cannot be read (browsers keep it ten minutes; the server does not keep it, and reads the chain again at the next request). A record with neither a picture of its own nor a structure that can be drawn answers 404 picture_unavailable, and is not looked at again for ten minutes. A request still waiting after 25 seconds (a large structure being read from the chain) answers 503 picture_loading with Retry-After: 3, and the drawing goes on for the next request; one that comes while 256 pictures already wait answers 503 picture_busy (Retry-After: 5) and starts nothing; a record whose structure could not be read just now (the node, a gateway) answers 503 structure_unavailable (Retry-After: 60) for a minute. Pictures are for anyone to show and index: they answer X-Robots-Tag: all and Cross-Origin-Resource-Policy: cross-origin (image search's own viewer and other sites may load them), and the sitemaps list them.

Record pages for search engines. A record's page is the canonical page of everything it is known by:

  • its title names it as people search for it: its identifier and its own title first, then what it is — 1AKI: The structure of the orthorhombic form of hen egg-white… · PDB 3D structure | GL1X, X6R8D5: … · AlphaFold model; its description starts the same way and goes on with the molecule's kind and size, its UniProt accession and what the page offers;
  • its HTML (what crawlers read before any script runs, and readers without scripts get) has the identifier and title as its heading, the picture with words that describe it ("3D structure of 1AKI: The structure of … (MolNFT v2 / PDB Bank)"), the facts — identifier, kind, length, chains, method, authors, deposition date, collection, contract —, the analysis, the trail MolNFT collections › collection › record, and the other records of the same identifier ("Other records of 100D": 100D-2, 100D-3…; records whose own identifier it is, so interleukin-2, the address of "Interleukin 2", is no other record of "Interleukin"), each linked;
  • its structured data is a schema.org Dataset with the picture as its first image (an ImageObject with its caption, and its size and format when the explorer drew it), the authors as its creator (each a Person, a surname with its initials, or an Organization such as a structural genomics consortium), the identifier as its alternateName, and its subject (about) linked to the PDB and UniProt pages (sameAs);
  • the MolNFT sitemaps list each record with its picture first, then its preview card.

A record's page also starts fast. The page the explorer sends names the record (its contract and token, its heading and picture, in <script type="application/json" id="gl1x-boot">), so the interface does not ask for the address first; it asks the browser to fetch the picture and the first answers the interface reads — the token, its collection, the record's features — with the page, while the interface's script loads; and while those are read the page shows the record's heading and picture where they stay once it is read.

The MolNFT card #

The page of a MolNFT record (/molnft/{id}, see record addresses) is a small laboratory:

  • The record's picture at the top, beside its kind, identifier and title, with the header actions; the picture in full is under Molecular image (see pictures).

  • Header actions: Search similar structures (runs a structure search from the record's first protein chain), BLAST the sequence (opens BLAST with the record's sequence and runs it), Molecular analysis (opens the analysis below).

  • Three-dimensional structure: Mol*, bundled in the explorer, renders the structure read from the chain or IPFS, with Search similar structures and Download structure; residues a find points at are shown as ball-and-stick, selected, with the camera on them (Clear takes them away), and so is a ligand with its binding site.

  • Ligands: under the 3D view, every non-polymer group of the structure (cofactors, drugs, metal ions, sugars, additives; waters left out) with its component's name and formula, its chain and number, its heavy atoms and the residues of its binding site (within 4.5 Å), by class; Show in 3D shows it in the structure with its site, the viewer's focus drawing their interactions, and the address keeps it (?ligand=HEM:A:154). See ligand index.

  • Molecular record: the PDB-style fields (ID code, header, accession date, compound, source, authors, resolution, experiment, child records) and the record's picture, with where it comes from.

  • Find in the sequences: a bar over the sequences takes a fragment (MKTAYIAK; spaces, dashes and the numbers of a pasted block are ignored) or a motif (C-x(2)-C, [QR]EEY, <KVF), marks every occurrence in every sequence, brings one at a time into view (Enter, Shift+Enter or the arrows, with its rank: 3 of 8) and shows it in the 3D structure when the residues have coordinates there (never across a chain break). The bar stays in view while the sequences scroll; the address keeps the find (?find=QEEY&chain=A), so a shared link opens the record with it, as motif hits of the molecular and structure searches do.

  • Sequences: every distinct sequence of the record (identical chains once, with their chain names), each with Copy FASTA, a FASTA download, Align here (BLAST against every MolNFT sequence, the ten best hits shown under the sequence: record, chains, identity, coverage, E-value, bits, the record itself marked; under them, Dataset of every hit downloads every hit of that search, not only the ten, as CSV, TSV, JSON or GL1F inputs, and More choices opens Dataset creation with the sequence as its query) and BLAST (the full report on the BLAST page).

  • Molecular analysis and machine-learning features (closed until opened): for the chosen sequence, its properties as tiles (mass, pI, charge, extinction coefficients, A280, instability with its verdict, aliphatic index, GRAVY, aromaticity, low complexity, entropy, cysteines), the notes, its composition; for its structure chain, size and shape, secondary structure as a track along the chain, contacts and contact order, confidence, the GSA composition; and the feature vector: every feature as a dataset column with its value, unit, GL1F integer and meaning, the GL1F features text and packed inputs to copy, and CSV, JSON and GL1F exports. See features.

  • Structure index: the chains of the first model with their kind, residues, mean B-factor or pLDDT, UniProt accessions and GSA string, a Similar search per chain, Align with…, and the record's comparisons with a link that runs each alignment.

  • Provenance: where each part was read (contract calls, IPFS CIDs, the structure encoding and size, the on-chain chunks), the NFT record (owner, standard), attributes and the raw metadata (as inert text).

  • Send NFT: a wallet panel that checks on chain that the connected account may move the token, then lets the wallet sign the transfer.

Link previews. A record's page, and its research workbench page, give link previews (/og/{page}.png) that draw the record's molecule from its structure: from the structure index, or, when the index has not read it, from the record's own structure file, read when the preview is first asked (the page itself starts the read, and a record waiting for its first reading goes ahead of every other record waiting for its first reading). That covers a structure still waiting in the queue, one tried again soon after a passing failure, one whose contract call failed before 3.4.0 (which took a node's failure for the contract's answer) and has not ended so since, and, where the molecular indexer runs, a record of a MolNFT collection it has not reached yet, read from its contract. A structure that failed keeps its wait in the queue however often its page is previewed; one that failed in its content (not a structure GL1X reads, too large, not valid data), or whose contract did not answer 3.4.0, is not read for a preview. A card drawn before the file arrives shows the sequence and is kept two minutes only.

In the provenance, verified: true marks a field read from contract state (the fields of a v2 record). A v1 field read from IPFS is marked content_addressed: true and content_verified_locally: false: the page read it through a gateway as a file, and the proof is what checks it against its CID.

Through the API and MCP #

NeedAPIMCP
Find records (PDB ID, accession, title, NFT id, sequence, motif)GET/POST /api/bio/searchmolecule_search
One record with its sequencesGET /api/bio/records/{contract}/{tokenId}get_molecule
The record a page address names (/molnft/100D)GET /api/molnft/{id}api_request
Every collection with its first records (/molnft)GET /api/molnftapi_request
A record's pictureGET /molnft/{id}/picture.jpg, GET /api/bio/records/{contract}/{tokenId}/picture—
The records of a list of identifiersPOST /api/bio/records/resolveapi_request
Its structure fileGET /api/tokens/{contract}/instances/{id}/structureget_molecule_structure
Its indexed structure and comparisonsGET /api/bio/records/{contract}/{tokenId}/structurestructure_comparisons
Its featuresGET /api/bio/records/{contract}/{tokenId}/featuresmolecule_features
Prove its sequencesGET /api/bio/records/{contract}/{tokenId}/proofmolecule_sequence_proof
The collections and the indexerGET /api/bio/collections, GET /api/bio/statusmolecule_collections
The structures that hold a motifGET /api/bio/structure/motifstructure_motif
Its ligands and their binding sitesGET /api/bio/records/{contract}/{tokenId}/ligandsmolecule_ligands
Ligands by component, name, formula or protein; a component's binding sitesGET /api/bio/ligands, GET /api/bio/ligands/{comp}ligand_search, ligand_sites
BLAST, structure search, datasetssee BLAST, structures, datasetsblast_search, structure_search, bio_dataset

The proof route takes key (one sequence key, at most 128 characters; every current sequence of the record when absent; MCP sequence_key) and block (a decimal or 0x block number, or latest; two below the head when absent). Each client may ask three proofs at once and one more every ten seconds (429 proof_rate_limited); answers are cached for 15 seconds. Errors: invalid_molecular_record and invalid_sequence_key (400), molecular_sequence_not_found (404: the index holds no current sequence for this reference or key), invalid_block (400), block_not_found (404), chain_unavailable (502), proof_unavailable (503: no node configured).

curl -s 'https://YOUR-DOMAIN/api/bio/records/0xd58b01f6c18086e5202cdc5d7ad3e41790360102/1/proof'
curl -s 'https://YOUR-DOMAIN/api/bio/records/0xde3723766bc32dcacd03c17baa400a7b36837eba/7/proof?key=pdb-chain:A&block=latest'

Settings #

SettingDefaultWhat it does
GL1X_MOLECULAR_INDEXonthe molecular indexer
GL1X_MOLECULAR_WORKERSautotune: one per CPU, 6–16 (6 below 4 GB)records read at once
GL1X_STRUCTURE_WORKERSautotune: one per CPU, 4–16 (4 below 4 GB)structure files read at once (0: none)
GL1X_HEADER_RATE120experimental structures read before 3.4.0 read again a minute, about, for their biological assemblies and observed accessions (off or 0: not read again)
GL1X_STRUCTURE_CACHE_MB2048structure files kept once read, on disk in GL1X_DATA_DIR/structure-cache (0: no cache), Serving structure files
GL1X_PICTURE_CACHE_MBautorecords' pictures kept once made, on disk in GL1X_DATA_DIR/picture-cache: auto, a quarter of the free disk at start, at most 40 GB; a number of MB; 0: in memory only (Collections and pictures)
GL1X_PICTURE_WARMonrecords' pictures made in the background before anyone asks, one at a time, by one web process at a time; off: each is made when first asked for (Collections and pictures)
GL1X_IPFS_GATEWAYShttps://ipfs.genesisl1.io/ipfs/,https://ipfs.io/ipfs/IPFS gateways for content
GL1X_IPFS_TRUSTLESS_GATEWAYShttps://trustless-gateway.link/ipfs/gateways that serve raw blocks, for proofs
GL1X_IPFS_ALLOW_PRIVATEoffadmits http:// and private-network gateways (a gateway on the same machine, tests)

Limits #

  • Sequences longer than 5,000 residues are not indexed; they are listed among the record's omitted sequences with the reason.
  • A v1 chain needs a complete SEQRES. A chain whose residues do not match the count SEQRES declares is omitted rather than guessed; a v2 chain must match its length: tag.
  • Unlisted residue names read as X. A SEQRES residue name outside the table above, such as a modified nucleotide of a tRNA (PSU), becomes X, and a nucleic-acid chain holding one is typed protein, since not every residue is a plain nucleotide.
  • Type from letters alone is a guess. A sequence without a declared type made only of nucleotide codes (ACGT…) is read as nucleotide, even if it is a short peptide. Records declare their types (mol: tags, SEQRES residue names); pasted queries may not.
  • The index reads IPFS through gateways. Index reads are not checked block by block; proofs are. IPFS content that no reachable node serves cannot be read, indexed or proven until some node serves it.
  • Only the first model of a structure file is read; an NMR ensemble is its first conformer.
  • Records leave inventories. A token that leaves its collection's inventory keeps its record as retained, so links keep working, and a proof can be pinned (block) to a block where the token still existed, on a node that keeps that block's state. A record rewritten in its contract is read again at the weekly refresh.

References #

  • Benet J (2014) IPFS — content addressed, versioned, P2P file system. arXiv:1407.3561.
  • Berman HM, Westbrook J, Feng Z, et al. (2000) The Protein Data Bank. Nucleic Acids Res 28:235–242.
  • Entriken W, Shirley D, Evans J, Sachs N (2018) EIP-721: Non-Fungible Token Standard. Ethereum Improvement Proposals 721.
  • Merkle RC (1988) A digital signature based on a conventional encryption function. In: Advances in Cryptology — CRYPTO '87. Lecture Notes in Computer Science 293:369–378.
  • National Institute of Standards and Technology (2015) Secure Hash Standard (SHS). FIPS PUB 180-4.
  • Sehnal D, Bittrich S, Velankar S, et al. (2020) BinaryCIF and CIFTools — lightweight, efficient and extensible macromolecular data management. PLoS Comput Biol 16:e1008247.
  • Varadi M, Anyango S, Deshpande M, et al. (2022) AlphaFold Protein Structure Database: massively expanding the structural coverage of protein-sequence space with high-accuracy models. Nucleic Acids Res 50:D439–D444.

GL1X is a live explorer of the GenesisL1 blockchain. Turn on JavaScript for search, charts and interactive views.