|
1 | | -# Concepts |
| 1 | +# Challenge Types |
2 | 2 |
|
3 | | -## Challenge families |
| 3 | +`agentproof` currently ships two built-in challenge families. |
4 | 4 |
|
5 | | -`agentproof` currently ships two built-in challenge families: |
| 5 | +## `proof_of_work` |
6 | 6 |
|
7 | | -- `proof_of_work` |
8 | | -- `semantic_math_lock` |
| 7 | +Use this when you want a deterministic compute task with no natural-language component. |
9 | 8 |
|
10 | | -Each family supports: |
| 9 | +What the agent does: |
11 | 10 |
|
12 | | -- generation |
13 | | -- solving with the reference implementation |
14 | | -- verification |
| 11 | +- reads the payload |
| 12 | +- searches for a nonce |
| 13 | +- returns a nonce and hash pair |
15 | 14 |
|
16 | | -## Determinism |
| 15 | +What the server verifies: |
17 | 16 |
|
18 | | -Verification logic should be machine-checkable and stable. The library avoids fuzzy scoring. |
| 17 | +- challenge ID matches |
| 18 | +- response is not expired |
| 19 | +- hash recomputes correctly |
| 20 | +- hash satisfies the required difficulty |
19 | 21 |
|
20 | | -## Extensibility |
| 22 | +Typical use cases: |
21 | 23 |
|
22 | | -Challenge families implement a shared protocol, which keeps custom handlers isolated from the public API. |
| 24 | +- cheap anti-abuse friction |
| 25 | +- deterministic smoke tests |
| 26 | +- baseline challenge-response verification |
| 27 | + |
| 28 | +## `semantic_math_lock` |
| 29 | + |
| 30 | +Use this when you want a readable challenge that still has exact measurable constraints. |
| 31 | + |
| 32 | +What the agent does: |
| 33 | + |
| 34 | +- reads required words and word-count rules |
| 35 | +- produces text that matches all constraints |
| 36 | +- returns the text in structured JSON |
| 37 | + |
| 38 | +What the server verifies: |
| 39 | + |
| 40 | +- challenge ID matches |
| 41 | +- response is not expired |
| 42 | +- exact word count |
| 43 | +- required words appear exactly once |
| 44 | +- initial-letter ASCII sum matches the target |
| 45 | + |
| 46 | +Typical use cases: |
| 47 | + |
| 48 | +- reverse-CAPTCHA experiments |
| 49 | +- structured agent behavior checks |
| 50 | +- demos where human-readable prompts matter |
| 51 | + |
| 52 | +## Determinism matters |
| 53 | + |
| 54 | +`agentproof` intentionally avoids fuzzy verification. |
| 55 | + |
| 56 | +Each built-in challenge is designed so the server can produce a clear yes/no result and, when it |
| 57 | +fails, a concrete failure reason such as: |
| 58 | + |
| 59 | +- `challenge_expired` |
| 60 | +- `hash_mismatch` |
| 61 | +- `wrong_word_count` |
| 62 | +- `required_word_constraint_failed` |
| 63 | +- `initial_sum_mismatch` |
| 64 | + |
| 65 | +## Extending the library |
| 66 | + |
| 67 | +Challenge families implement a shared internal protocol: |
| 68 | + |
| 69 | +- generate |
| 70 | +- solve |
| 71 | +- verify |
| 72 | + |
| 73 | +That keeps custom challenge logic isolated from the public API while preserving a consistent |
| 74 | +library interface. |
23 | 75 |
|
0 commit comments