OpenPIL

Public interest petitions, with a public records

Visit Repo
OpenPIL banner

About

## The problem it solves

## The problem it solves

Public Interest Litigation gives people a way to bring civic concerns before a court, but the progress of a petition can be hard for the public to follow. Filing details, who is responsible for review, deadlines, extensions, and decisions may be scattered across systems or difficult to verify independently. That makes it harder to understand what happened and when.

OpenPIL demonstrates a shared, queryable record for that lifecycle. Petitioners can submit a petition in Markdown; a registered court takes ownership of its review record; and the review deadline, any extension, and the eventual decision can be inspected as linked records. Anyone can browse petitions and check the recorded creator, current owner, court registration, timeline, and status. This makes public scrutiny and record checking easier without relying only on one operator's account of events.

## What people can use it for

  • Browse public petitions and filter them by court, title, or status.
  • Read a petition alongside its review timeline, deadline, extensions, and recorded decision.
  • Submit a synthetic petition and see its review record created and assigned to a registered court in one transaction.
  • Inspect the underlying Arkiv records and verify how the app derived a petition's status.
  • Explore how expiring review leases and public ownership history could support accountability in a civic process.

## Scope

OpenPIL is a demonstration, not an official court filing service. Its sample petitions, court, and identities are synthetic. A recorded petition or decision does not establish legal validity, truth, government adoption, or who personally made a decision. The public demo court uses a shared demonstration key. Use synthetic content only; petition text, reasons, titles, court codes, dates, and wallet addresses are public on Arkiv.

## Challenges I ran into

## Challenges I ran into

### Anonymous RPC limits made the live feed unreliable

The app initially made several independent reads, and Tiramisu began returning HTTP 429 responses. Anonymous query cost limits also affected WebSocket setup, so adding a live subscription did not solve the read problem.

I changed the browser to load one paginated OpenPIL snapshot, derive the screens and counts from it, and reuse it with a short freshness window. Browser reads now pass through a same-origin server proxy that holds the RPC access key. WebSocket events are treated as refresh hints, not as a source of truth. See [`use-openpil-snapshot.ts`](https://github.com/rishi-xyz/open-pil/blob/main/hooks/use-openpil-snapshot.ts), [`clients.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/clients.ts), and [`app/api/arkiv/route.ts`](https://github.com/rishi-xyz/open-pil/blob/main/app/api/arkiv/route.ts).

### Entity predictions and atomic filing needed careful reconciliation

A petition filing creates both a petition and a review, then transfers review ownership to the court. I used `predictEntityKeys` so the review can reference the petition in the same batch, and compare the returned keys with the predictions. The UI does not treat an uncertain write as success; the saved transaction and resulting records can be checked before retrying. See [`file-petition.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/writes/file-petition.ts).

### Expiration extensions were easy to misread

A relative extension duration targets an expiry from the current block. It does not mean “add this many days to the existing expiry,” and can fail when the entity already lasts longer. Keep alive therefore reads the current entity and extends to its current expiry plus 30 days of blocks. Review extensions calculate a target deadline and extend the review lease in the same batch as the reason record and deadline patch. See [`keep-alive.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/writes/keep-alive.ts) and [`extend-review.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/writes/extend-review.ts).

### Queries had to preserve Arkiv attribute types

A query using a bare bigint can encode a different integer cell type from a stored `u64` attribute and quietly return no match. I made the model and query code use matching typed values and documented the exact query contract for independent reproduction. See [`model.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/model.ts), [`queries/page.ts`](https://github.com/rishi-xyz/open-pil/blob/main/lib/arkiv/queries/page.ts), and [`arkiv/schema.md`](https://github.com/rishi-xyz/open-pil/blob/main/arkiv/schema.md).

More observed integration issues and reproduction notes are in [`arkiv/friction.md`](https://github.com/rishi-xyz/open-pil/blob/main/arkiv/friction.md).

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

Screenshots

OpenPIL screenshot 1OpenPIL screenshot 2OpenPIL screenshot 3OpenPIL screenshot 4OpenPIL screenshot 5

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.

BasePetition

Create and sign transparent, on-chain petitions on Base with IPFS-powered metadata.