Conversation
dskvr
added a commit
that referenced
this pull request
Jun 16, 2026
README rework and projections/web.md now live on master (committed directly). This branch keeps only naps/NAP-POW.md so PR #39 is the NAP-POW interface spec alone; the NAP-POW registry row is already on master. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rebased onto current master; spec only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Proof-of-work operations, job state, progress, hashrate, result, publish result, queue summary, and error schemas now use operation tables plus CDDL-style records instead of TypeScript declarations. Constraint: Keep this branch scoped to NAP-POW. Confidence: high Scope-risk: narrow Tested: git diff --check Tested: rg found no TypeScript code fences or declarations in naps/NAP-POW.md
The miner state, progress, hash-rate, result, publish, summary, and error shapes now use Markdown tables instead of a CDDL-style block. Job lifecycle semantics and NIP-13 behavior remain unchanged. Constraint: PR #39 owns NAP-POW; keep this change scoped to that spec file. Confidence: high Scope-risk: narrow Tested: rg for cddl/typescript schema fences and type assignment patterns in NAP-POW Tested: git diff --check -- naps/NAP-POW.md
Open NAP proposal branches need reader-visible changelogs that track semantic spec changes without recording formatting-only migrations. Constraint: Changelog entries are one bullet per semantic commit-change. Rejected: Include schema-table or formatting-only commits | they do not change the spec contract or boundary. Confidence: high Scope-risk: narrow Directive: Keep future changelog entries semantic; omit changelog-only and formatting-only commits. Tested: git diff --check Not-tested: Rendered Markdown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: A shell-mediated NIP-13 proof-of-work miner. Napplets submit an event template and a target difficulty; the runtime spreads the nonce search across 1..n web workers (web binding) and returns the mined event. Mining is modeled as an observable, queued, cancellable, pausable job.
Namespace:
window.napplet.pow· discoveryshell.supports("pow")Status:
draftSurface:
mine— submit a job; returns aPowJobhandle immediately. The job is enqueued and may sit atstate: "queued"(with aposition) before mining;job.startedresolves when mining begins,job.completedwith the mined (unsigned) note.mineAndPublish— same lifecycle; on success the shell signs and publishes via outbox-aware fanout (no relay argument; relay selection is shell policy).queue— inspect tracked jobs, withpriorityand queuepositionjob/pow.progress— per-job and per-worker progress (target, best PoW, hashes, hash rate)pow.state— lifecycle push (queued → mining → paused/done/cancelled/error) so queue transitions are observable without pollinghashrate— live miner-wide rate, per-worker and per-job breakdowncancel,pause/resume— per job or whole-minerQueue semantics (refined):
created_atandpubkeyare committed at mining start, not at submit, so a job that waited in the queue never bakes a stale timestamp.PowOptions.timeoutMsbounds mining time only and excludes queue wait.PowOptions.priorityis an ordering hint the shell MAY honor but MUST NOT let one napplet use to starve another's jobs.Notes:
noncetag before searching.minereturns an unsigned event; the shell must sign committed mined events verbatim at publish time or the PoW is invalidated.formatHashRateSDK sugar).Web binding: NIP-5D.
Changelog
f01fb31- Introduced NAP-POW as a runtime-owned NIP-13 proof-of-work miner surface.