Skip to main content

Read chain state

The best first PressChain feature is a read-only one. It proves your network configuration, ABI handling and identifier discipline without involving user signing. A typical product starts by resolving a Capsule ID from a route and reading the corresponding contract state.

Preserve bytes32 IDs

Capsule IDs are canonical bytes32 values in V3.
Do not convert these values into JavaScript numbers. Preserve them as hex strings through routing, API serialization and storage.

Read through a contract library

With an EVM library, a read-only provider can call contract view functions without a signer. The exact deployment address must come from the active V3 deployment manifest.
The functions above are present in the active V3 evidence registry. The address placeholder is intentional. Use the approved deployment manifest rather than copying an address from an old client.

Build a useful read model

Do not force your UI to understand raw tuple positions. Normalize contract output into an application model while preserving source coordinates.
For high-volume applications, this direct pattern eventually becomes too chatty. That is where an indexer is useful. The chain remains authoritative, while the projection packages common queries efficiently.

Verify referenced artifacts

An evidence item contains both a URI and a content hash. Fetching the URI is only half the job. A serious application should hash the retrieved bytes and compare them with the commitment before displaying a “verified artifact” state. That distinction lets the interface say something precise:
  • available and hash-matched
  • available but hash-mismatched
  • temporarily unavailable
  • intentionally inactive in protocol state
Those states are more informative than a single green check mark.

Use events for discovery

Contract calls are good for a known Capsule. Events are better when an indexer needs to discover all changes over time. Store block number, block hash, transaction hash and log index beside each projected record. If replaying the same block range creates duplicates, the indexer is not ready for production. Use deterministic event identity and upsert behavior.

Next step

Once reads are stable, add a user-authorized flow with Build with PressKey. Keep the read provider independent so your application can still display public state when PressKey is locked or not installed.