Metasquad
Journal index
Editorial independence

Metasquad is an independent educational publication operated by VURAL İÇERİK GELİŞTİRME ANONİM ŞİRKETİ. It has no affiliation, partnership, endorsement, sponsorship, or representative relationship with Ethereum, IPFS, The Graph, or the other projects cited here.

Web architecture

Web3 Security Guide for Beginners

Author
SULEYMAN ASLAN
Published
Reading time
10 min

A quartet is preparing for rehearsal. The public catalog lists the score as edition four, but the second violinist’s part says edition three. Which copy needs correcting? This example introduces Web3 security through a question a cataloger can investigate. The register, search result, and file each tell part of the story. Comparing their dates and references helps locate the discrepancy.

Web3 is a broad term for applications that use decentralized systems for some of their functions. In the hypothetical catalog used here, a website presents the scores, a program on Ethereum records the publisher’s edition references, and a separate network distributes files. The catalog is open for reading. A musician trying to identify the score used at a rehearsal can investigate a publication question without having an account or making a network transaction.

Start with the three meanings of “the score”

To a performer, the score is the music on the stand. To a cataloger, it may be the record for a composition. To a file distributor, it is a particular set of bytes. The distinctions become visible when an editor corrects a single note. The composition can retain its catalog number, the register can advance to a new edition, and the corrected PDF can acquire a new file identifier. One stable catalog number is useful for finding the work. It is insufficient for citing the exact music used on a particular evening.

Work
The continuing catalog entry for the quartet. Its title can be translated without changing which work it describes.
Edition
A publisher’s release within that work. Its place in the edition sequence depends on the publisher’s stated rules.
File
A specific digital representation. A full score, a violin part, and a screen-readable transcription may belong to one edition while having distinct contents.

The browser identifies the web origin serving the catalog, ordinarily by scheme, host, and port. Two pages on that origin can show data from different networks. Two different websites can also read the same public register. The familiar design of a catalog tells a musician where the page was viewed. Identifying its underlying edition record requires the network, the register’s address, and the work identifier used there. IETF, The Web Origin Concept.

What does the edition register promise?

In this catalog, a smart contract maintains a current edition reference for each work. Its stored state might say that the quartet’s current edition is four and point to a list of files. Its rules might allow a designated publisher to replace that reference. Another catalog could store a permanent list of releases and let readers choose between them. The general label “smart contract” says little about which editorial policy a particular program implements. Ethereum, Introduction to Smart Contracts.

Reading a current value and asking how it changed are different operations. A program can emit an event, a structured log entry that other software can find after execution. For example, an event might announce that edition four was registered. Whether that action also made four the current performing edition depends on the program. A catalog that treats every newly registered arrangement as the current score could make an error even if it copied the event perfectly. Solidity documentation on events and logs.

Suppose edition four is a study score, while edition three remains the publisher’s performing edition. A list headed “Latest release” can correctly show four, and a link labeled “Performing parts” can correctly open three. In that case the apparent inconsistency is a matter of catalog language. To decide whether there is a genuine discrepancy, first establish which field the listing claims to display.

Which moment does a network response describe?

A request for the current state asks a node for its view at the time it handles the request. A second request moments later can observe a different block. Ethereum’s remote procedure call interface permits certain reads at a specified block, and defines block labels including “latest” and “finalized.” These choices affect the meaning of a result. A response obtained using “latest” is difficult to reconstruct from that word alone after the network advances. Ethereum, JSON-RPC API and block parameters.

For an edition comparison, both the network and the observation point matter. The publisher’s demonstration register can have an edition four long before the public register does. On a single network, the catalog may have recorded a result from before a revision, while a musician opens the register after the revision. A block number places an observation in sequence. A block hash identifies the particular block used for the comparison.

A historical question calls for a historical observation. Asking for today’s current edition does not establish what was current on the rehearsal date. A dated program change, an event from the relevant register, or an earlier state read can narrow that question. Retrieving older state also depends on the information retained and exposed by the node being consulted. An unavailable historical read leaves evidence missing. It does not establish that the work had no edition at that time.

Why might search results lag behind the work page?

A search index makes network records useful for questions such as “Which quartets include a viola part?” An indexer reads selected data and organizes them for retrieval. Its designer chooses which network, contracts, and events to follow, when to begin, and how to turn them into searchable fields. The Graph calls one such definition a subgraph. Its manifest specifies data sources and event handlers, and its mappings determine what the index stores. The Graph, Subgraph Manifest.

Imagine the fourth edition is registered in block 850 in the catalog’s example history. The work page reads the register at block 852. A search index has processed blocks only through 849. A result of three in search and four on the work page is consistent with those observations. Once both are compared at the same position, the timing explanation can be tested. The illustrative block numbers express sequence only.

A second discrepancy can survive that comparison. The index may count files, while the work page counts editions. Adding four instrumental parts alongside a full score creates five file references in a single edition. An index that interprets every file reference as a new release will give a wrong edition count at every subsequent block. Waiting for it to catch up will never correct the definition of the field. The evidence needed here is the mapping from a register entry to the catalog’s unit of count.

Does a file reference identify exactly what the performer opened?

The InterPlanetary File System, or IPFS, uses content identifiers called CIDs. A CID identifies content in a particular representation. For a multi-block file, the identifier can refer to the root of a structure that links the constituent blocks. The same visible document can be packaged or divided into blocks differently and produce different identifiers. A CID should therefore be interpreted with the object and representation it refers to. IPFS, Content Addressing and CIDs.

The register might identify a release directory rather than one PDF. In that case the directory identifier and the path within it together locate the violin part. A reader who records only the directory can identify the release package while leaving open whether the musician viewed the full score, an individual part, or the editorial notes. Conversely, the same unchanged cello part might appear in two releases. A match for that one part would leave both releases possible.

A gateway lets a conventional browser retrieve IPFS content over HTTP. In an ordinary gateway read, the reader relies on the gateway to resolve the request and return the corresponding bytes. Other retrieval arrangements allow the client to verify the returned data against the identifiers. Seeing a CID in a page label and independently verifying bytes against it are different levels of evidence. For the catalog discrepancy, it matters whether the download link actually refers to the recorded release and path or simply displays the release identifier beside a separate link. IPFS, Gateways and retrieval models.

Identification and availability have different lifetimes. A node can pin content so it is retained during local cleanup. Retrieval still needs an accessible copy. If no copy is reachable today, the register may faithfully identify the missing release without being able to reproduce the score. If a copy becomes reachable later, its identity can again be checked against the original reference. IPFS, Persistence and Pinning.

What can change behind a familiar name or address?

A publisher often wants a stable link for “current performing edition” and a fixed reference for “the edition performed in June.” IPNS, the InterPlanetary Name System, provides updatable references. A signed name record can point to one content path and later be updated to point elsewhere. Following the same name on two dates can therefore lead to different content even when both resolutions are valid. A citation for one performance benefits from retaining the resolved content reference. IPFS, InterPlanetary Name System.

A contract address can also remain familiar while behavior changes. Some Ethereum applications use a proxy, a contract that delegates execution to an implementation whose address can be changed under defined rules. Other deployments use fixed code without that mechanism. For the catalog, a historical interpretation may depend on which implementation was active when the publisher selected an edition. Reading only today’s documentation can silently apply a newer meaning of “current” to an older entry. Ethereum documentation on contract upgrades.

The publisher can explain these choices in ordinary editorial terms. Who may designate a performing edition? Can an editor withdraw that designation? If the rules change, where is the effective edition or date recorded? These questions concern governance. A technically valid update identifies an action accepted under the system’s rules. Assigning responsibility for the editorial choice also requires the publisher’s record of roles.

What evidence exists outside the application?

A register can establish which edition the publisher designated. Establishing what the quartet played requires evidence from the rehearsal. An annotated part, a dated rehearsal packet, or a musician’s program note addresses that separate question. Even a complete and internally consistent catalog cannot establish that four performers all had the same edition open.

Consider a correction that affects only the second violin at measure 28. The first violin part is identical in both editions. Finding a copy of that unchanged part in the rehearsal folder narrows the work and instrumentation, but cannot distinguish editions three and four. A dated copy of the second violin part displaying the corrected note is more discriminating evidence. Its relevance comes from knowing what changed between releases. A newer timestamp on an unrelated file would carry less weight.

How would a cataloger resolve the original discrepancy?

First, the cataloger identifies the work and the meaning of the listing. If “four” names the latest study edition while the download offers the performing edition, clearer labeling resolves the issue. If both claim to identify the same performing edition, the cataloger compares the search index and register at the same network position. A difference that disappears there indicates that the two displays observed different stages of publication.

If both agree on edition four, the remaining evidence lies in the release. The directory reference can be correct while the download selects the wrong path. The path can be correct while the publisher has included an older part in the new package. Even the file can be musically correct while its title page still carries the old edition number. Inspecting the changed passage and the edition notes distinguishes a packaging error from a labeling error.

The eventual catalog correction should name the affected object. “The fourth-edition package contained the third-edition second violin part” tells a performer which copy to replace and tells a historian why an older rehearsal packet differs. It also leaves the valid register entry, the unaffected parts, and the record of the rehearsal intelligible on their own terms.