-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPOW-schema.json
More file actions
208 lines (200 loc) · 6.54 KB
/
POW-schema.json
File metadata and controls
208 lines (200 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
Schema Definition (pow-schema.json)
```json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Proof-of-Contribution Configuration",
"version": "1.0.0",
"description": "Deterministic schema for Proof-of-Contribution milestones and payouts",
"type": "object",
"required": ["version", "project", "milestones"],
"properties": {
"version": {
"type": "string",
"const": "1.0.0",
"description": "Schema version for forward compatibility"
},
"project": {
"type": "object",
"required": ["id", "repository", "license"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$",
"description": "Unique project identifier (lowercase, hyphens)"
},
"repository": {
"type": "string",
"format": "uri",
"description": "Git repository URL"
},
"license": {
"type": "string",
"enum": ["MIT", "Apache-2.0", "GPL-3.0", "BSD-3-Clause"],
"description": "OSI-approved license"
},
"commit_hash": {
"type": "string",
"pattern": "^[a-f0-9]{40}$",
"description": "Specific commit hash this config applies to"
}
}
},
"milestones": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "title", "acceptance_criteria", "payout"],
"properties": {
"id": {
"type": "string",
"pattern": "^[A-Z0-9-]+$",
"description": "Unique milestone ID (uppercase, hyphens)"
},
"title": {
"type": "string",
"maxLength": 100
},
"description": {
"type": "string",
"maxLength": 1000
},
"acceptance_criteria": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["id", "type", "condition"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9-]+$"
},
"type": {
"type": "string",
"enum": ["commit", "pull_request", "test_passing", "release", "code_review", "documentation"]
},
"condition": {
"type": "object",
"oneOf": [
{
"properties": {
"min_count": { "type": "integer", "minimum": 1 },
"author": { "type": "string" }
}
},
{
"properties": {
"pr_number": { "type": "integer" },
"merged": { "type": "boolean" }
}
},
{
"properties": {
"test_suite": { "type": "string" },
"coverage_min": { "type": "number", "minimum": 0, "maximum": 100 }
}
},
{
"properties": {
"tag_pattern": { "type": "string" },
"assets": { "type": "array", "items": { "type": "string" } }
}
}
]
},
"verification_data": {
"type": "object",
"properties": {
"commit_hash": { "type": "string" },
"pr_url": { "type": "string" },
"test_report_url": { "type": "string" },
"release_url": { "type": "string" }
}
}
}
}
},
"required_proofs": {
"type": "array",
"items": {
"type": "string",
"enum": ["git_commit", "signed_pr", "ci_passing", "code_coverage", "binary_artifact"]
}
},
"payout": {
"type": "object",
"required": ["total", "splits"],
"properties": {
"total": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]{1,18})?$",
"description": "Total payout amount in base tokens"
},
"token": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$",
"description": "ERC-20 token address (optional, defaults to native token)"
},
"splits": {
"type": "object",
"required": ["contributor", "treasury", "platform"],
"properties": {
"contributor": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]{1,2})?%$",
"description": "Percentage to contributor (e.g., '70%')"
},
"treasury": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]{1,2})?%$",
"description": "Percentage to project treasury"
},
"platform": {
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]{1,2})?%$",
"description": "Percentage to protocol platform"
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"deadline": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp for milestone completion deadline"
},
"dependencies": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[A-Z0-9-]+$"
},
"description": "IDs of milestones that must be completed first"
}
}
}
},
"attestation_config": {
"type": "object",
"properties": {
"chain_id": {
"type": "integer",
"description": "EIP-155 chain ID for on-chain attestation"
},
"registry_address": {
"type": "string",
"pattern": "^0x[a-fA-F0-9]{40}$"
},
"verification_interval": {
"type": "integer",
"minimum": 1,
"description": "Blocks between verification attempts"
}
}
}
},
"additionalProperties": false
}