Usalama

The Arkiv security & trust auditor.

Visit Repo
Usalama banner

About

## Challenges I ran into

Building **Usalama** on Arkiv presented several interesting engineering challenges involving schema compatibility, real-time event monitoring, and query optimization. Each required investigating the underlying behavior of the SDK or network rather than relying solely on client-side assumptions.

### 1. Client-Side Validation vs. On-Chain Encoding

One of the first challenges emerged when the SDK's client-side name validator accepted **camelCase attribute names**, but the underlying chain encoding rejected capital letters with an `Ident32InvalidByte` revert during a real transaction.

This revealed a mismatch between what the client considered valid and what the network could actually process. Rather than applying a narrow workaround, I refactored the codebase and dashboard schema to use **lowercase `snake_case` identifiers**, including fields such as `repo_url` and `audited_at`.

This made the schema consistent with the encoding constraints enforced by the network and prevented the same class of failure from recurring across the application.

### 2. HTTP Polling and Anonymous Rate Limits

Implementing live updates with `watchEntityEvents` over standard HTTP transport introduced another problem. The client silently performed background polling at one-second intervals, quickly exhausting anonymous request limits and triggering `ANON_COST_LIMITED` errors.

To address this, I redesigned the client architecture around **separate clients for ordinary requests and real-time event monitoring**. I introduced `createWatchClient()` with true WebSocket transport for live data streams, avoiding the unnecessary HTTP polling associated with the original setup.

This improved the monitoring architecture while making live event handling more appropriate for a decentralized application.

### 3. Query Optimization Without Server-Side Sorting

Arkiv's query capabilities did not provide the server-side `orderBy` functionality needed to retrieve audit reports in the desired order. As a result, fetching the latest reports reliably required more than simply issuing a query and trusting the returned sequence.

I implemented **client-side sorting combined with strategic pagination limits** to retrieve, organize, and display reports accurately. This required balancing retrieval efficiency with the need to identify the latest audit records without assuming that the database would sort results automatically.

### What I learned

These challenges reinforced an important engineering principle: **never assume that client-side validation, transport behavior, or database query capabilities perfectly match the underlying infrastructure.** Building reliable decentralized applications requires testing real network behavior, understanding protocol constraints, and designing around the guarantees the system actually provides.

## The problem it solves

Every hackathon submission built on **Arkiv** may make important architectural and security claims in its documentation, such as *“we filter records by `$creator` instead of relying on a writable field”* or *“our entity lifetimes are optimized to follow strict product logic.”*

However, **judges, developers, and ecosystem participants have no automated way to independently verify these claims** without manually inspecting complex source code, schemas, and on-chain records. This makes technical evaluation time-consuming and leaves room for undocumented vulnerabilities and misleading claims.

There is also a critical trust problem: if audit scores and verification badges are stored in a traditional centralized database, a compromised backend could silently change a failing score into a passing one, undermining the credibility of the entire verification process.

### How Usalama solves this

**Usalama introduces decentralized security and trust verification infrastructure for Arkiv**, combining automated analysis, live on-chain checks, and tamper-resistant audit records.

  • **Automated Code Analysis:** Statically analyzes project source code and schema definitions against security, privacy, and data-design rules, helping identify potential weaknesses and verify architectural decisions. The analysis rules are organized in `packages/core/src/rules/`.
  • **Live On-Chain Probing:** Queries disclosed project wallet addresses directly on the **Tiramisu testnet** to check whether actual on-chain records align with documented claims. This helps bridge the gap between what a project says it does and what can be observed on-chain. The implementation lives in `packages/core/src/liveProbe.ts`.
  • **Tamper-Resistant Audit Reports:** Publishes signed, verifiable audit reports as persistent entities on Arkiv. By anchoring audit results to decentralized infrastructure, Usalama makes unauthorized retrospective changes to published verdicts detectable and reduces reliance on a single trusted backend.

**The goal is simple:** make security claims easier to verify, technical evaluations more transparent, and trust in the Arkiv ecosystem more independent of centralized infrastructure.

## Link to a twitter post explaining your project (or post with the video) https://x.com/JamesWasonga8/status/2111944479452348703

Screenshots

Usalama screenshot 1Usalama screenshot 2Usalama screenshot 3Usalama screenshot 4

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.