# Technical architecture

Relic is built entirely on [Load Network](https://load.network), a storage-focused EVM chain.

## Data storage

Relic data is sent to Load Network via a bundle, which is an easy way to post data onchain as EVM calldata.

### Bundles

Relics are stored via a custom bundling service built with the Load Bundler Rust library.&#x20;

* [Load Network Bundler library](https://github.com/weaveVM/bundler)
* [More about bundles](https://blog.wvm.dev/bundler/)

## Smart contracts

User accounts, identity, ownership and tokens are handled by a suite of smart contracts.

### Reliquary

A central registry contract managing user identity, social connections, and content organization:

* Maps user addresses to their Sanctum vaults via `sanctums` mapping
* Maintains unique usernames (max 32 chars, alphanumeric + hyphens) with two-way mappings
* Implements social verification through vouch system:
  * Verified users can vouch for others (once per day cooldown)
  * Users need at least one vouch to claim verification
  * Initial verified user set in constructor has special privileges
* Profile system with customizable profile pictures and metadata
* ENS subdomain management:
  * Verified users can claim subdomains matching their username
  * Prevents duplicate claims and maintains subdomain registry
* Comprehensive getter functions for user data and relationships
* Event emissions for all major state changes

### Sanctum

An ERC721 contract handling content preservation and tokenization with economic incentives.

* Relic struct stores content metadata:
  * Basic info: id, name, description, mediaType, contentUrl
  * Timestamps and block height for preservation tracking
  * Economics: likeCost, likeCount, creator address
  * Social: array of liker addresses with has-liked mapping
  * State machine: Unearthed -> Collectable -> Minted
* Content preservation:
  * Owner can preserve content as "relics" with metadata
  * Each relic has configurable like cost in RelicTokens
* Like system:
  * Users spend RelicTokens to like content
  * Tokens transfer directly to content creator
  * Tracking of likes per user and per relic
* NFT minting:
  * Automatic state progression based on like count
  * Bulk mints NFTs to all likers when collectable
  * Token IDs based on relic index (relicIndex \* 1000 + i)
  * Creator receives last token in mint sequence
* Comprehensive getters for relics, tokens, and relationships
* Access controls via owner and reliquary admin roles


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.relic.bot/technical-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
