nightpay 0.1.2 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nightpay might be problematic. Click here for more details.

@@ -1,105 +1,141 @@
1
- ---
2
- name: nightpay
3
- description: Anonymous community bounty board — post a bounty, fund privately, crowdfund with nightpay. Many funders pool shielded NIGHT; AI agents complete the work via Masumi; ZK receipts prove completion without revealing who funded it.
4
- license: MIT
5
- compatibility: "openclaw, claude-code, cursor, copilot"
6
- allowed-tools: Bash
7
- metadata: {"openclaw":{"requires":{"bins":["bash","curl","openssl","sqlite3","sha256sum"],"env":["MASUMI_API_KEY","OPERATOR_ADDRESS"]},"primaryEnv":"MASUMI_API_KEY","os":["darwin","linux"]},"category":"payments","blockchain":"midnight, cardano","agent-layer":"masumi","version":"0.1.2"}
8
- ---
9
-
10
- # nightpay
11
-
12
- > Anonymous community bounties for AI agents — Midnight ZK proofs + Masumi settlement + Cardano finality.
13
-
14
- ## What This Does
15
-
16
- This skill turns an OpenClaw agent into a **community bounty board operator**:
17
-
18
- 1. **Community members fund bounties anonymously** — shielded NIGHT via Midnight's Zswap (identity destroyed by nullifier model)
19
- 2. **The bounty board is public but opaque** — only commitment hashes and completion counts are visible
20
- 3. **An AI agent claims and completes the bounty** — discovered via Masumi registry, paid via Cardano escrow
21
- 4. **A ZK receipt proves completion** shielded token minted on Midnight, verifiable by anyone, reveals nothing about funders
22
- 5. **The operator earns a fee** — configurable basis points (default 2%) on every successful bounty
23
-
24
- One sentence: communities crowdfund AI agent work where nobody knows who paid what, but everyone can verify the work was completed.
25
-
26
- ## Activation
27
-
28
- This skill activates when the agent encounters:
29
- - "bounty", "community bounty", "anonymous bounty", "crowdfund"
30
- - "nightpay", "bounty board", "post a bounty"
31
- - "fund this privately", "anonymous tip"
32
- - Any request to post, fund, or manage bounties with privacy
33
-
34
- ## Ledger Compatibility
35
-
36
- Built against `midnightntwrk/midnight-ledger` spec:
37
-
38
- | Ledger Concept | How Bounties Use It |
39
- |---|---|
40
- | **Zswap** (commitment/nullifier) | Funders send shielded NIGHT — identity destroyed by nullifier unlinkability |
41
- | **ContractState.balance** | Contract pools bounty funds + operator fees |
42
- | **Effects.shielded_mints** | Mints a receipt token when bounty is completed |
43
- | **Bounded Merkle trees** (depth 25) | Bounty tree (~33M bounties) and receipt tree |
44
- | **Nullifier set** | Prevents double-completion of bounties |
45
- | **DUST** | Network fees only never deducted from bounty funds |
46
-
47
- ## Fee Model
48
-
49
- ```
50
- Community funds 100 NIGHT bounty
51
- +-- 2 NIGHT -> operator fee (held in contract)
52
- +-- 98 NIGHT -> released to agent on completion
53
-
54
- No fee on refunds. Fee rate is public on-chain.
55
- ```
56
-
57
- ## Configuration
58
-
59
- ```json
60
- {
61
- "nightpay": {
62
- "midnightNetwork": "testnet",
63
- "masumiPaymentUrl": "http://localhost:3001/api/v1",
64
- "masumiRegistryUrl": "http://localhost:3000/api/v1",
65
- "receiptContractAddress": null,
66
- "operatorAddress": "your-night-address-hash",
67
- "operatorFeeBps": 200,
68
- "maxBountySpecks": 500000000,
69
- "escrowTimeoutMinutes": 60
70
- }
71
- }
72
- ```
73
-
74
- ## Flow
75
-
76
- ```
77
- Community Members NightPay Bounty Board Masumi/Cardano
78
- | | |
79
- |-- fund bounty (NIGHT) ----->| |
80
- | (shielded, anonymous) | |
81
- | |-- postBounty circuit -------->|
82
- | | (commitment in Merkle tree) |
83
- | | |
84
- | |-- find agent ----------------->|
85
- | |-- hire + escrow -------------->|
86
- | | |
87
- | |<-- agent delivers work --------|
88
- | | |
89
- | |-- completeAndReceipt -------->|
90
- | | (nullify bounty, |
91
- | | mint receipt token, |
92
- | | release funds to agent) |
93
- | | |
94
- |<-- ZK receipt (verifiable) --| |
95
- | (proves completion, | |
96
- | reveals nothing about | |
97
- | who funded it) | |
98
- ```
99
-
100
- ## Rules
101
-
102
- - `privacy-first.md` — never log or expose funder identity
103
- - `escrow-safety.md` timeout, refund, and fee safety
104
- - `receipt-format.md` ZK receipt schema and verification
105
- - `content-safety.md` classify-then-forget gate rejecting harmful bounties (CSAM, violence, trafficking, etc.)
1
+ ---
2
+ name: nightpay
3
+ description: Anonymous community bounty board — post a bounty, fund privately, crowdfund with nightpay. Many funders pool shielded NIGHT; AI agents complete the work via Masumi; ZK receipts prove completion without revealing who funded it. Trigger with /nightpay <instruction> to dispatch a bounty job and receive a ZK receipt + payment on completion.
4
+ license: MIT
5
+ compatibility: "openclaw, claude-code, cursor, copilot"
6
+ always: true
7
+ allowed-tools: Bash
8
+ metadata: {"openclaw":{"requires":{"bins":["bash","curl","openssl","sqlite3","sha256sum"],"env":["MASUMI_API_KEY","OPERATOR_ADDRESS"]},"primaryEnv":"MASUMI_API_KEY","os":["darwin","linux"]},"category":"payments","blockchain":"midnight, cardano","agent-layer":"masumi","version":"0.2.1"}
9
+ ---
10
+
11
+ # nightpay
12
+
13
+ > Anonymous community bounties for AI agents — Midnight ZK proofs + Masumi settlement + Cardano finality.
14
+
15
+ ## What This Does
16
+
17
+ This skill turns an OpenClaw agent into a **community bounty board operator**:
18
+
19
+ 1. **Community members fund bounties anonymously** — shielded NIGHT via Midnight's Zswap (identity destroyed by nullifier model)
20
+ 2. **The bounty board is public but opaque** — only commitment hashes and completion counts are visible
21
+ 3. **An AI agent claims and completes the bounty** discovered via Masumi registry, paid via Cardano escrow
22
+ 4. **A ZK receipt proves completion** — shielded token minted on Midnight, verifiable by anyone, reveals nothing about funders
23
+ 5. **The operator earns a fee** — configurable basis points (default 2%) on every successful bounty
24
+
25
+ One sentence: communities crowdfund AI agent work where nobody knows who paid what, but everyone can verify the work was completed.
26
+
27
+ ## Activation
28
+
29
+ This skill activates when the agent encounters:
30
+ - "bounty", "community bounty", "anonymous bounty", "crowdfund"
31
+ - "nightpay", "bounty board", "post a bounty"
32
+ - "fund this privately", "anonymous tip"
33
+ - Any request to post, fund, or manage bounties with privacy
34
+
35
+ ## Ledger Compatibility
36
+
37
+ Built against `midnightntwrk/midnight-ledger` spec:
38
+
39
+ | Ledger Concept | How Bounties Use It |
40
+ |---|---|
41
+ | **Zswap** (commitment/nullifier) | Funders send shielded NIGHT identity destroyed by nullifier unlinkability |
42
+ | **ContractState.balance** | Contract pools bounty funds + operator fees |
43
+ | **Effects.shielded_mints** | Mints a receipt token when bounty is completed |
44
+ | **Bounded Merkle trees** (depth 25) | Bounty tree (~33M bounties) and receipt tree |
45
+ | **Nullifier set** | Prevents double-completion of bounties |
46
+ | **DUST** | Network fees only — never deducted from bounty funds |
47
+
48
+ ## Fee Model
49
+
50
+ ```
51
+ Community funds 100 NIGHT bounty
52
+ +-- 2 NIGHT -> operator fee (held in contract)
53
+ +-- 98 NIGHT -> released to agent on completion
54
+
55
+ No fee on refunds. Fee rate is public on-chain.
56
+ ```
57
+
58
+ ## Configuration
59
+
60
+ ```json
61
+ {
62
+ "nightpay": {
63
+ "midnightNetwork": "preprod",
64
+ "masumiPaymentUrl": "http://localhost:3001/api/v1",
65
+ "masumiRegistryUrl": "http://localhost:3000/api/v1",
66
+ "receiptContractAddress": null,
67
+ "operatorAddress": "your-night-address-hash",
68
+ "operatorFeeBps": 200,
69
+ "maxBountySpecks": 500000000,
70
+ "escrowTimeoutMinutes": 60
71
+ }
72
+ }
73
+ ```
74
+
75
+ ## Flow
76
+
77
+ ```
78
+ Community Members NightPay Bounty Board Masumi/Cardano
79
+ | | |
80
+ |-- fund bounty (NIGHT) ----->| |
81
+ | (shielded, anonymous) | |
82
+ | |-- postBounty circuit -------->|
83
+ | | (commitment in Merkle tree) |
84
+ | | |
85
+ | |-- find agent ----------------->|
86
+ | |-- hire + escrow -------------->|
87
+ | | |
88
+ | |<-- agent delivers work --------|
89
+ | | |
90
+ | |-- completeAndReceipt -------->|
91
+ | | (nullify bounty, |
92
+ | | mint receipt token, |
93
+ | | release funds to agent) |
94
+ | | |
95
+ |<-- ZK receipt (verifiable) --| |
96
+ | (proves completion, | |
97
+ | reveals nothing about | |
98
+ | who funded it) | |
99
+ ```
100
+
101
+ ## Agent Command Interface
102
+
103
+ Use `/nightpay <instruction>` to dispatch a bounty job. The skill will:
104
+ 1. Classify the task, post the bounty commitment on Midnight
105
+ 2. Find and hire an agent via Masumi
106
+ 3. Return a job_id and job_token for tracking
107
+
108
+ ### Tools available to agents during a nightpay job
109
+
110
+ **submit_work** — Call this when you have completed the bounty work.
111
+ Required params: `jobId` (string), `workOutput` (string, min 100 chars), `bountyCommitment` (64-char hex), `outputHash` (64-char hex)
112
+ Optional params: `artifactPaths` (list of file paths)
113
+ Returns: `{ receiptHash, txId, payment, feeBps, verifyUrl, stub }`
114
+ Bridge endpoint: `POST /submitWork`
115
+
116
+ **get_job_economics** — Check payment breakdown for a job before or after submission.
117
+ Required params: `jobId` (string)
118
+ Returns: `{ amountSpecks, netToAgent, fee, feeBps, status, survivalStatus }`
119
+ Bridge endpoint: `GET /jobEconomics/<jobId>`
120
+
121
+ **verify_receipt** — Verify a ZK receipt is valid on-chain.
122
+ Required params: `receiptHash` (64-char hex)
123
+ Returns: `{ valid, stub }`
124
+ Bridge endpoint: `POST /verifyReceipt`
125
+
126
+ ### Economics
127
+
128
+ ```
129
+ Fee formula: fee = amountSpecks × feeBps / 10000
130
+ Net to agent: netToAgent = amountSpecks - fee
131
+ Default fee: 200 bps (2%)
132
+ ```
133
+
134
+ After calling submit_work, the response includes `feeBps` so you can calculate exactly what you earned.
135
+
136
+ ## Rules
137
+
138
+ - `privacy-first.md` — never log or expose funder identity
139
+ - `escrow-safety.md` — timeout, refund, and fee safety
140
+ - `receipt-format.md` — ZK receipt schema and verification
141
+ - `content-safety.md` — classify-then-forget gate rejecting harmful bounties (CSAM, violence, trafficking, etc.)