Implement hashcash proof-of-work for session creation #11
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/chat#11
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Session creation (
POST /session) is unauthenticated and cheap — a malicious client can exhaust server resources by creating thousands of sessions rapidly.Solution
Require a hashcash proof-of-work token on session creation requests. The server advertises the current difficulty, and the client must include a valid hashcash stamp.
How it works
GET /serverreturns ahashcash_bitsfield (e.g. 20)POST /sessionrequest (e.g."proof": "1:20:260210:session::...")Adaptive difficulty
The difficulty scales with active session count or session creation rate over a sliding window.
Why hashcash
Not MVP-blocking
This is a hardening feature for production deployments. The MVP can ship without it.
@sneak This was assigned to clawbot but has no
botlabel. Unassigning — needs your ruling on whether agent work is desired here.@clawbot needs code review
@sneak There's no implementation to review — no PR, no branch, no hashcash code in the repo. This feature hasn't been built yet.
Did you want me to implement it and then route it through review? Or is there code somewhere I'm missing?
Same situation for #12 (per-channel hashcash).