Skip to content

Commit 5f9e358

Browse files
committed
Add x402 payments for sherlock
1 parent 279ca57 commit 5f9e358

File tree

10 files changed

+351
-99
lines changed

10 files changed

+351
-99
lines changed

nbs/00_core.ipynb

Lines changed: 128 additions & 41 deletions
Large diffs are not rendered by default.

nbs/01_crypto.ipynb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5+
"id": "20c64935",
56
"metadata": {},
67
"source": [
78
"# crypto\n",
@@ -12,6 +13,7 @@
1213
{
1314
"cell_type": "code",
1415
"execution_count": null,
16+
"id": "13df2d76",
1517
"metadata": {},
1618
"outputs": [],
1719
"source": [
@@ -21,6 +23,7 @@
2123
{
2224
"cell_type": "code",
2325
"execution_count": null,
26+
"id": "b49deaff",
2427
"metadata": {},
2528
"outputs": [],
2629
"source": [
@@ -31,6 +34,7 @@
3134
{
3235
"cell_type": "code",
3336
"execution_count": null,
37+
"id": "394cf179",
3438
"metadata": {},
3539
"outputs": [
3640
{
@@ -52,6 +56,7 @@
5256
},
5357
{
5458
"cell_type": "markdown",
59+
"id": "d6c0b6de",
5560
"metadata": {},
5661
"source": [
5762
"Generating a private & public key pair from scratch."
@@ -60,6 +65,7 @@
6065
{
6166
"cell_type": "code",
6267
"execution_count": null,
68+
"id": "70704956",
6369
"metadata": {},
6470
"outputs": [
6571
{
@@ -81,6 +87,7 @@
8187
{
8288
"cell_type": "code",
8389
"execution_count": null,
90+
"id": "a3f507fa",
8491
"metadata": {},
8592
"outputs": [
8693
{
@@ -103,6 +110,7 @@
103110
{
104111
"cell_type": "code",
105112
"execution_count": null,
113+
"id": "d6a41091",
106114
"metadata": {},
107115
"outputs": [],
108116
"source": [
@@ -116,6 +124,7 @@
116124
{
117125
"cell_type": "code",
118126
"execution_count": null,
127+
"id": "ce63c4f3",
119128
"metadata": {},
120129
"outputs": [
121130
{
@@ -136,6 +145,7 @@
136145
},
137146
{
138147
"cell_type": "markdown",
148+
"id": "ad92b030",
139149
"metadata": {},
140150
"source": [
141151
"Generating a `pk` instance and a public key from a private key in hex.\n"
@@ -144,6 +154,7 @@
144154
{
145155
"cell_type": "code",
146156
"execution_count": null,
157+
"id": "df7cc7b3",
147158
"metadata": {},
148159
"outputs": [
149160
{
@@ -166,6 +177,7 @@
166177
{
167178
"cell_type": "code",
168179
"execution_count": null,
180+
"id": "e6146c91",
169181
"metadata": {},
170182
"outputs": [],
171183
"source": [
@@ -182,6 +194,7 @@
182194
{
183195
"cell_type": "code",
184196
"execution_count": null,
197+
"id": "9abd3af2",
185198
"metadata": {},
186199
"outputs": [
187200
{
@@ -202,12 +215,14 @@
202215
},
203216
{
204217
"cell_type": "markdown",
218+
"id": "e4df2fbe",
205219
"metadata": {},
206220
"source": []
207221
},
208222
{
209223
"cell_type": "code",
210224
"execution_count": null,
225+
"id": "f5df6b3e",
211226
"metadata": {},
212227
"outputs": [],
213228
"source": [
@@ -224,5 +239,5 @@
224239
}
225240
},
226241
"nbformat": 4,
227-
"nbformat_minor": 4
242+
"nbformat_minor": 5
228243
}

nbs/02_auth.ipynb

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5+
"id": "f9a84312",
56
"metadata": {},
67
"source": [
78
"# auth\n",
@@ -12,6 +13,7 @@
1213
{
1314
"cell_type": "code",
1415
"execution_count": null,
16+
"id": "8c4385be",
1517
"metadata": {},
1618
"outputs": [],
1719
"source": [
@@ -21,6 +23,7 @@
2123
{
2224
"cell_type": "code",
2325
"execution_count": null,
26+
"id": "1b012888",
2427
"metadata": {},
2528
"outputs": [],
2629
"source": [
@@ -31,6 +34,7 @@
3134
{
3235
"cell_type": "code",
3336
"execution_count": null,
37+
"id": "92558fbd",
3438
"metadata": {},
3539
"outputs": [],
3640
"source": [
@@ -44,6 +48,7 @@
4448
{
4549
"cell_type": "code",
4650
"execution_count": null,
51+
"id": "5461f789",
4752
"metadata": {},
4853
"outputs": [],
4954
"source": [
@@ -60,6 +65,7 @@
6065
},
6166
{
6267
"cell_type": "markdown",
68+
"id": "008c47bc",
6369
"metadata": {},
6470
"source": [
6571
"## Authentication flow\n",
@@ -78,6 +84,7 @@
7884
},
7985
{
8086
"cell_type": "markdown",
87+
"id": "ae04b799",
8188
"metadata": {},
8289
"source": [
8390
"### Get challenge"
@@ -86,6 +93,7 @@
8693
{
8794
"cell_type": "code",
8895
"execution_count": null,
96+
"id": "e4fc78dc",
8997
"metadata": {},
9098
"outputs": [],
9199
"source": [
@@ -95,6 +103,7 @@
95103
{
96104
"cell_type": "code",
97105
"execution_count": null,
106+
"id": "299c3b8c",
98107
"metadata": {},
99108
"outputs": [
100109
{
@@ -118,6 +127,7 @@
118127
{
119128
"cell_type": "code",
120129
"execution_count": null,
130+
"id": "232356bd",
121131
"metadata": {},
122132
"outputs": [],
123133
"source": [
@@ -139,6 +149,7 @@
139149
{
140150
"cell_type": "code",
141151
"execution_count": null,
152+
"id": "24fd507f",
142153
"metadata": {},
143154
"outputs": [
144155
{
@@ -160,6 +171,7 @@
160171
},
161172
{
162173
"cell_type": "markdown",
174+
"id": "7ef1e0f9",
163175
"metadata": {},
164176
"source": [
165177
"### Sign challenge\n",
@@ -170,6 +182,7 @@
170182
{
171183
"cell_type": "code",
172184
"execution_count": null,
185+
"id": "4ebdc30e",
173186
"metadata": {},
174187
"outputs": [
175188
{
@@ -191,6 +204,7 @@
191204
{
192205
"cell_type": "code",
193206
"execution_count": null,
207+
"id": "fb59ba1b",
194208
"metadata": {},
195209
"outputs": [],
196210
"source": [
@@ -204,6 +218,7 @@
204218
},
205219
{
206220
"cell_type": "markdown",
221+
"id": "c6154a48",
207222
"metadata": {},
208223
"source": [
209224
"### Submit challenge"
@@ -212,6 +227,7 @@
212227
{
213228
"cell_type": "code",
214229
"execution_count": null,
230+
"id": "eb524ebf",
215231
"metadata": {},
216232
"outputs": [
217233
{
@@ -239,6 +255,7 @@
239255
{
240256
"cell_type": "code",
241257
"execution_count": null,
258+
"id": "e5f6db60",
242259
"metadata": {},
243260
"outputs": [],
244261
"source": [
@@ -260,13 +277,15 @@
260277
},
261278
{
262279
"cell_type": "markdown",
280+
"id": "9c2170a3",
263281
"metadata": {},
264282
"source": [
265283
"Challenges can be used only once."
266284
]
267285
},
268286
{
269287
"cell_type": "markdown",
288+
"id": "2ddd174e",
270289
"metadata": {},
271290
"source": [
272291
"### Authenticate\n",
@@ -277,6 +296,7 @@
277296
{
278297
"cell_type": "code",
279298
"execution_count": null,
299+
"id": "61136fdb",
280300
"metadata": {},
281301
"outputs": [],
282302
"source": [
@@ -294,6 +314,7 @@
294314
{
295315
"cell_type": "code",
296316
"execution_count": null,
317+
"id": "0ceb6709",
297318
"metadata": {},
298319
"outputs": [
299320
{
@@ -315,6 +336,7 @@
315336
},
316337
{
317338
"cell_type": "markdown",
339+
"id": "691d3a73",
318340
"metadata": {},
319341
"source": [
320342
"### Linking an email to an Agent\n",
@@ -327,6 +349,7 @@
327349
{
328350
"cell_type": "code",
329351
"execution_count": null,
352+
"id": "a2e21cde",
330353
"metadata": {},
331354
"outputs": [],
332355
"source": [
@@ -350,5 +373,5 @@
350373
}
351374
},
352375
"nbformat": 4,
353-
"nbformat_minor": 2
376+
"nbformat_minor": 5
354377
}

0 commit comments

Comments
 (0)