-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapi_openapi.json
More file actions
2268 lines (2268 loc) · 94 KB
/
api_openapi.json
File metadata and controls
2268 lines (2268 loc) · 94 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"openapi": "3.1.0",
"info": {
"title": "Blocknet Daemon API",
"description": "Authenticated JSON API for the Blocknet privacy blockchain daemon. All private endpoints require Bearer token authentication via a cookie file (`<dataDir>/api.cookie`) written on daemon startup. Public routes (GET-only blockchain queries) are also served unauthenticated when using `--explorer` mode.",
"version": "0.7.0",
"license": {
"name": "MIT"
}
},
"servers": [
{
"url": "http://127.0.0.1:8332",
"description": "Local daemon (default --api binding)"
}
],
"security": [
{
"bearerAuth": []
}
],
"paths": {
"/api/status": {
"get": {
"operationId": "getStatus",
"tags": ["Node"],
"summary": "Daemon status",
"description": "Returns node and chain status including peer count, chain height, sync state, and mempool summary.",
"responses": {
"200": {
"description": "Daemon statistics",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DaemonStats"
},
"example": {
"peer_id": "12D3KooWBLUPjZgAoizTkbNJvHxgHkb2tF1saUhmKBzFfo8zZLfj",
"peers": 8,
"chain_height": 14207,
"best_hash": "0000c3a5b7e2d1f4",
"total_work": 14208,
"mempool_size": 3,
"mempool_bytes": 4821,
"syncing": false,
"identity_age": "2h34m12s"
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" }
}
}
},
"/api/block/{id}": {
"get": {
"operationId": "getBlock",
"tags": ["Blockchain"],
"summary": "Get block by height or hash",
"description": "Returns a block by numeric height or 64-character hex hash. Includes transaction summaries and confirmation count.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"description": "Block height (integer) or block hash (64 hex characters)",
"schema": {
"type": "string"
},
"examples": {
"height": {
"summary": "By height",
"value": "14207"
},
"hash": {
"summary": "By hash",
"value": "0000c3a5b7e2d1f489a1bc37e5d204f8c612aa9b33e7f04d12b8a9e6c7f50321"
}
}
}
],
"responses": {
"200": {
"description": "Block data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Block"
},
"example": {
"height": 14207,
"hash": "0000c3a5b7e2d1f489a1bc37e5d204f8c612aa9b33e7f04d12b8a9e6c7f50321",
"prev_hash": "0000a1f38e2bc9d7a436ef21c87b3d4e59a0f1b267e3c9d58a2b41f6e7083c19",
"merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"timestamp": 1738800120,
"difficulty": 100000,
"nonce": 847291,
"tx_count": 2,
"transactions": [
{
"hash": "c7f2e1d3a4b596870123456789abcdef0123456789abcdef0123456789abcdef",
"is_coinbase": true,
"inputs": 0,
"outputs": 1,
"fee": 0
},
{
"hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"is_coinbase": false,
"inputs": 1,
"outputs": 2,
"fee": 15000
}
],
"confirmations": 1,
"reward": 72325093035
}
}
}
},
"400": {
"description": "Invalid block ID format",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "id must be a height or 64-char hex hash" }
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"404": {
"description": "Block not found",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "block not found" }
}
}
}
}
}
},
"/api/tx/{hash}": {
"get": {
"operationId": "getTx",
"tags": ["Blockchain"],
"summary": "Get transaction by hash",
"description": "Searches mempool first (fast), then scans the blockchain from tip backwards. Returns the transaction with confirmation count and mempool status.",
"parameters": [
{
"name": "hash",
"in": "path",
"required": true,
"description": "Transaction hash (64 hex characters)",
"schema": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"example": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"
}
],
"responses": {
"200": {
"description": "Transaction data",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TxLookupResult"
},
"examples": {
"confirmed": {
"summary": "Confirmed transaction (in blockchain)",
"value": {
"tx": {
"version": 1,
"inputs": [
{
"key_image": [206,194,102,91,117,127,68,44,128,196,45,250,102,215,110,191,198,108,77,236,91,173,42,44,240,161,206,21,137,3,217,104],
"ring_members": [
[226,131,206,64,181,243,28,67,77,209,63,49,60,73,151,89,90,209,74,106,163,255,119,131,60,185,95,37,147,5,24,172],
[110,193,204,172,204,197,212,189,47,92,19,190,204,227,117,159,115,159,54,160,111,127,196,151,224,41,224,215,131,35,150,164]
],
"ring_commitments": [
[244,65,131,220,148,209,81,144,194,225,99,194,172,101,176,2,181,151,98,87,133,213,118,209,176,204,1,57,103,0,158,85],
[227,105,135,213,239,147,102,10,53,157,38,16,29,213,153,189,151,99,51,202,204,88,135,235,168,65,66,228,199,214,91,184]
],
"pseudo_output": [185,41,236,101,236,26,183,66,110,82,226,90,90,18,56,11,87,242,214,41,217,44,73,158,2,195,168,69,207,102,28,108],
"ring_signature": "gGqM7cNe9fNWJnrrBzqo/CSrAowGo9OFVEUYyxIYr3WVUeAd1XVgO/hXi426JGVYtSk6QEZMLBDCVbV2Uq4br99gnVs4S/4GdsAxeOMpUlXjv4GgF8sKmVFDBZKXlD/8"
}
],
"outputs": [
{
"commitment": [57,12,140,125,114,71,52,44,216,16,15,47,111,119,13,101,214,112,229,142,3,81,216,174,142,79,110,172,52,47,194,49],
"public_key": [183,176,135,22,235,63,193,40,150,185,98,35,23,116,148,40,119,51,194,142,232,186,83,189,181,107,136,36,87,125,83,236],
"range_proof": "UTfDE/BxZuuznHRyDGLMqI4jjrPMqQ47hVuHEzfesKDfO8VhghbfAGS63COpoD+ZntGnzpdBYtfCWZrPAJuSa9yk7uLibfJWK5GrL3iec2VLDBd98yXp1GPE/cx8SwI22XBa7Rl/PulE7aLi2uRR8+aEfo34eozhJ5J4i6ujKUZNdsRObSDU0Knu1B9p18cKwvQDtJjH1nD5cIvf+A7HrM9U70ENyQ0q20XsXRmFwqds6Keswo7XgSnwCRqzciMUD35mCk56QPI6b+6DvFU6U583DZ/Ay2UmfDSaPRWx270jrgbX+jbduetO3lqK9+7fiaV9LI7mfO3CrA79pl35bLWEro+NBWEre9D6e/P75QgvlnHPfJy88rDZqbToipyAdj1ioT1eYm73jZAzY5d0uFuaB0CMFxuVQPs0BpHw9eGuXhqB9DohzfslG01Mmyt/PNVzwubimNucHjJqbIcpUHpYJlAB0ebwlRB2k5DoJHeHZdk6c0yISCQeVJ2T4D/vm86L/OApFN2lgA0udQqJFFnw4o5c3/su8LLRqqQ1UqjS/ZPNEugtoYGlO84A7NMbYLn/4hpoiEOT4Pg+DnpRnwfQL3M67DxO/5WL1PfxfOlKxGFFI43UrogBkJj6TOT3sKrB6aRgesR30hai8sPFTf0SQKkz4TPpB0nRTybwh63LKajCovkSI3iTdC7eMjPjVZkOF6Yclre/3Ep90lxXWSjDe/5JduyC64IE7pNQJeKwmdmA6ZplxPc2ecO3l5cLyowEGf6SdbRwYYBGMRSe4RG6Qy6Xp9RZZkO7i1SD9petOu8mSHPLuy7KB4c/6LyGw743d/EMp3Eg7ZrRO0cXE5v8OzF4RcbovdZP1DL60I8QvW/j43i5Mry3H8uNYT7o",
"encrypted_amount": [81,216,32,197,195,239,128,5],
"encrypted_memo": [58,136,174,57,150,222,80,232,1,134,91,54,152,101,78,191,82,0,165,250,9,57,185,157,122,29,123,40,43,248,35,64,65,243,84,135,216,108,102,159,204,191,224,231,61,126,115,32,173,10,117,112,3,36,30,117,34,16,169,36,121,142,248,109,67,242,124,242,208,97,48,49,220,181,216,210,239,27,50,31,206,173,55,127,98,97,229,71,216,93,142,236,127,38,226,50,25,7,47,121,85,208,248,246,109,205,30,84,194,1,199,135,232,146,216,249,79,97,151,111,29,31,160,29,25,244,80,29]
}
],
"fee": 15000,
"tx_public_key": [194,138,112,166,28,117,16,161,205,137,33,108,161,108,255,202,234,73,135,71,126,134,219,204,185,112,70,252,46,24,56,78]
},
"block_height": 14205,
"confirmations": 3,
"in_mempool": false
}
},
"mempool": {
"summary": "Unconfirmed transaction (in mempool)",
"value": {
"tx": {
"version": 1,
"inputs": [
{
"key_image": [206,194,102,91,117,127,68,44,128,196,45,250,102,215,110,191,198,108,77,236,91,173,42,44,240,161,206,21,137,3,217,104],
"ring_members": [
[226,131,206,64,181,243,28,67,77,209,63,49,60,73,151,89,90,209,74,106,163,255,119,131,60,185,95,37,147,5,24,172],
[110,193,204,172,204,197,212,189,47,92,19,190,204,227,117,159,115,159,54,160,111,127,196,151,224,41,224,215,131,35,150,164]
],
"ring_commitments": [
[244,65,131,220,148,209,81,144,194,225,99,194,172,101,176,2,181,151,98,87,133,213,118,209,176,204,1,57,103,0,158,85],
[227,105,135,213,239,147,102,10,53,157,38,16,29,213,153,189,151,99,51,202,204,88,135,235,168,65,66,228,199,214,91,184]
],
"pseudo_output": [185,41,236,101,236,26,183,66,110,82,226,90,90,18,56,11,87,242,214,41,217,44,73,158,2,195,168,69,207,102,28,108],
"ring_signature": "gGqM7cNe9fNWJnrrBzqo/CSrAowGo9OFVEUYyxIYr3WVUeAd1XVgO/hXi426JGVYtSk6QEZMLBDCVbV2Uq4br99gnVs4S/4GdsAxeOMpUlXjv4GgF8sKmVFDBZKXlD/8"
}
],
"outputs": [
{
"commitment": [57,12,140,125,114,71,52,44,216,16,15,47,111,119,13,101,214,112,229,142,3,81,216,174,142,79,110,172,52,47,194,49],
"public_key": [183,176,135,22,235,63,193,40,150,185,98,35,23,116,148,40,119,51,194,142,232,186,83,189,181,107,136,36,87,125,83,236],
"range_proof": "UTfDE/BxZuuznHRyDGLMqI4jjrPMqQ47hVuHEzfesKDfO8VhghbfAGS63COpoD+ZntGnzpdBYtfCWZrPAJuSa9yk7uLibfJWK5GrL3iec2VLDBd98yXp1GPE/cx8SwI22XBa7Rl/PulE7aLi2uRR8+aEfo34eozhJ5J4i6ujKUZNdsRObSDU0Knu1B9p18cKwvQDtJjH1nD5cIvf+A7HrM9U70ENyQ0q20XsXRmFwqds6Keswo7XgSnwCRqzciMUD35mCk56QPI6b+6DvFU6U583DZ/Ay2UmfDSaPRWx270jrgbX+jbduetO3lqK9+7fiaV9LI7mfO3CrA79pl35bLWEro+NBWEre9D6e/P75QgvlnHPfJy88rDZqbToipyAdj1ioT1eYm73jZAzY5d0uFuaB0CMFxuVQPs0BpHw9eGuXhqB9DohzfslG01Mmyt/PNVzwubimNucHjJqbIcpUHpYJlAB0ebwlRB2k5DoJHeHZdk6c0yISCQeVJ2T4D/vm86L/OApFN2lgA0udQqJFFnw4o5c3/su8LLRqqQ1UqjS/ZPNEugtoYGlO84A7NMbYLn/4hpoiEOT4Pg+DnpRnwfQL3M67DxO/5WL1PfxfOlKxGFFI43UrogBkJj6TOT3sKrB6aRgesR30hai8sPFTf0SQKkz4TPpB0nRTybwh63LKajCovkSI3iTdC7eMjPjVZkOF6Yclre/3Ep90lxXWSjDe/5JduyC64IE7pNQJeKwmdmA6ZplxPc2ecO3l5cLyowEGf6SdbRwYYBGMRSe4RG6Qy6Xp9RZZkO7i1SD9petOu8mSHPLuy7KB4c/6LyGw743d/EMp3Eg7ZrRO0cXE5v8OzF4RcbovdZP1DL60I8QvW/j43i5Mry3H8uNYT7o",
"encrypted_amount": [81,216,32,197,195,239,128,5],
"encrypted_memo": [58,136,174,57,150,222,80,232,1,134,91,54,152,101,78,191,82,0,165,250,9,57,185,157,122,29,123,40,43,248,35,64,65,243,84,135,216,108,102,159,204,191,224,231,61,126,115,32,173,10,117,112,3,36,30,117,34,16,169,36,121,142,248,109,67,242,124,242,208,97,48,49,220,181,216,210,239,27,50,31,206,173,55,127,98,97,229,71,216,93,142,236,127,38,226,50,25,7,47,121,85,208,248,246,109,205,30,84,194,1,199,135,232,146,216,249,79,97,151,111,29,31,160,29,25,244,80,29]
}
],
"fee": 12000,
"tx_public_key": [194,138,112,166,28,117,16,161,205,137,33,108,161,108,255,202,234,73,135,71,126,134,219,204,185,112,70,252,46,24,56,78]
},
"confirmations": 0,
"in_mempool": true
}
}
}
}
}
},
"400": {
"description": "Invalid hash format",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "hash must be 64 hex characters" }
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"404": {
"description": "Transaction not found in mempool or chain",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "transaction not found" }
}
}
}
}
}
},
"/api/mempool": {
"get": {
"operationId": "getMempool",
"tags": ["Blockchain"],
"summary": "Mempool statistics",
"description": "Returns mempool transaction count, total size in bytes, and fee statistics (min, max, average) in atomic units.",
"responses": {
"200": {
"description": "Mempool stats",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MempoolStats"
},
"example": {
"count": 5,
"size_bytes": 8420,
"min_fee": 10000,
"max_fee": 25000,
"avg_fee": 14600.0
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" }
}
}
},
"/api/mempool/txs": {
"get": {
"operationId": "getMempoolTxs",
"tags": ["Blockchain"],
"summary": "Full mempool transactions",
"description": "Returns all currently unconfirmed mempool transactions as full transaction objects in a JSON array. Each item matches the same `Transaction` schema returned by `GET /api/tx/{hash}`. Returns an empty array when the mempool is empty.",
"responses": {
"200": {
"description": "Array of mempool transactions",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/MempoolTransactions"
},
"examples": {
"non_empty": {
"summary": "Mempool has transactions",
"value": [
{
"version": 1,
"inputs": [
{
"key_image": [206,194,102,91,117,127,68,44,128,196,45,250,102,215,110,191,198,108,77,236,91,173,42,44,240,161,206,21,137,3,217,104],
"ring_members": [
[226,131,206,64,181,243,28,67,77,209,63,49,60,73,151,89,90,209,74,106,163,255,119,131,60,185,95,37,147,5,24,172],
[110,193,204,172,204,197,212,189,47,92,19,190,204,227,117,159,115,159,54,160,111,127,196,151,224,41,224,215,131,35,150,164]
],
"ring_commitments": [
[244,65,131,220,148,209,81,144,194,225,99,194,172,101,176,2,181,151,98,87,133,213,118,209,176,204,1,57,103,0,158,85],
[227,105,135,213,239,147,102,10,53,157,38,16,29,213,153,189,151,99,51,202,204,88,135,235,168,65,66,228,199,214,91,184]
],
"pseudo_output": [185,41,236,101,236,26,183,66,110,82,226,90,90,18,56,11,87,242,214,41,217,44,73,158,2,195,168,69,207,102,28,108],
"ring_signature": "gGqM7cNe9fNWJnrrBzqo/CSrAowGo9OFVEUYyxIYr3WVUeAd1XVgO/hXi426JGVYtSk6QEZMLBDCVbV2Uq4br99gnVs4S/4GdsAxeOMpUlXjv4GgF8sKmVFDBZKXlD/8"
}
],
"outputs": [
{
"commitment": [57,12,140,125,114,71,52,44,216,16,15,47,111,119,13,101,214,112,229,142,3,81,216,174,142,79,110,172,52,47,194,49],
"public_key": [183,176,135,22,235,63,193,40,150,185,98,35,23,116,148,40,119,51,194,142,232,186,83,189,181,107,136,36,87,125,83,236],
"encrypted_amount": [81,216,32,197,195,239,128,5],
"encrypted_memo": [58,136,174,57,150,222,80,232,1,134,91,54,152,101,78,191,82,0,165,250,9,57,185,157,122,29,123,40,43,248,35,64,65,243,84,135,216,108,102,159,204,191,224,231,61,126,115,32,173,10,117,112,3,36,30,117,34,16,169,36,121,142,248,109,67,242,124,242,208,97,48,49,220,181,216,210,239,27,50,31,206,173,55,127,98,97,229,71,216,93,142,236,127,38,226,50,25,7,47,121,85,208,248,246,109,205,30,84,194,1,199,135,232,146,216,249,79,97,151,111,29,31,160,29,25,244,80,29]
}
],
"fee": 12000,
"tx_public_key": [194,138,112,166,28,117,16,161,205,137,33,108,161,108,255,202,234,73,135,71,126,134,219,204,185,112,70,252,46,24,56,78]
}
]
},
"empty": {
"summary": "Mempool is empty",
"value": []
}
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" }
}
}
},
"/api/peers": {
"get": {
"operationId": "getPeers",
"tags": ["Network"],
"summary": "Connected peers",
"description": "Returns the list of currently connected libp2p peers with their peer IDs and remote multiaddrs.",
"responses": {
"200": {
"description": "Peer list",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": { "type": "integer" },
"peers": {
"type": "array",
"items": { "$ref": "#/components/schemas/PeerEntry" }
}
}
},
"example": {
"count": 3,
"peers": [
{
"peer_id": "12D3KooWBLUPjZgAoizTkbNJvHxgHkb2tF1saUhmKBzFfo8zZLfj",
"addrs": ["/ip4/203.0.113.10/tcp/28080"]
},
{
"peer_id": "12D3KooWN7z3vEqr4C8pMk2axGfRbLVJzqPEasiY4L9DMqFjVnGq",
"addrs": ["/ip4/198.51.100.22/tcp/28080"]
},
{
"peer_id": "12D3KooWQe1RkTvGvbFYm6G3bNzdpJRcmAQA4f9bUDkYcFWLdM4P",
"addrs": ["/ip4/192.0.2.5/tcp/28080"]
}
]
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" }
}
}
},
"/api/peers/banned": {
"get": {
"operationId": "getBannedPeers",
"tags": ["Network"],
"summary": "Banned peers",
"description": "Returns the list of banned peers with ban reason, count, permanence, and expiry time.",
"responses": {
"200": {
"description": "Banned peer list",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": { "type": "integer" },
"banned": {
"type": "array",
"items": { "$ref": "#/components/schemas/BanEntry" }
}
}
},
"example": {
"count": 2,
"banned": [
{
"peer_id": "12D3KooWMalicious111111111111111111111111111111111111",
"addrs": ["/ip4/203.0.113.50/tcp/28080"],
"reason": "sent invalid block",
"ban_count": 3,
"permanent": false,
"expires_at": "2026-02-06T19:30:00Z"
},
{
"peer_id": "12D3KooWMalicious222222222222222222222222222222222222",
"addrs": ["/ip4/198.51.100.99/tcp/28080"],
"reason": "excessive invalid transactions",
"ban_count": 5,
"permanent": true
}
]
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" }
}
}
},
"/api/verify": {
"post": {
"operationId": "verifyMessage",
"tags": ["Node"],
"summary": "Verify a signed message",
"description": "Verifies an ed25519 signature against a Blocknet stealth address. Does not require a wallet — uses only stateless cryptographic verification. Useful for 'login with Blocknet' flows where any node can validate a signature produced by `POST /api/wallet/sign`. Rate-limited per IP.",
"security": [],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/VerifyRequest"
},
"example": {
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF",
"message": "blocknet-auth:1:blocknet.id:a1b2c3d4e5f6:1708531200",
"signature": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2"
}
}
}
},
"responses": {
"200": {
"description": "Verification result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"valid": { "type": "boolean", "description": "True if the signature is valid for the given address and message" }
}
},
"examples": {
"valid": {
"summary": "Valid signature",
"value": { "valid": true }
},
"invalid": {
"summary": "Invalid signature",
"value": { "valid": false }
}
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"bad_address": {
"summary": "Unparseable address",
"value": { "error": "invalid address" }
},
"bad_signature": {
"summary": "Malformed signature",
"value": { "error": "invalid signature: must be 64 bytes hex-encoded" }
},
"missing_message": {
"summary": "Missing message",
"value": { "error": "message is required" }
}
}
}
}
},
"429": {
"description": "Rate limit exceeded",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "verify rate limit exceeded" }
}
}
}
}
}
},
"/api/wallet/load": {
"post": {
"operationId": "loadWallet",
"tags": ["Wallet"],
"summary": "Load or create wallet",
"description": "Loads an existing wallet from disk (decrypting with the given password) or creates a new one if no wallet file exists. Primarily used in `--daemon` mode where the app starts without a wallet. After loading, all wallet endpoints become available, miner reward keys are pointed at this wallet, and any blocks that arrived before the wallet was loaded are scanned automatically. Can only be called once — returns 409 if a wallet is already loaded.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["password"],
"properties": {
"password": {
"type": "string",
"minLength": 3,
"description": "Wallet encryption password (min 3 characters). Used to decrypt an existing wallet or encrypt a newly created one."
}
}
},
"example": {
"password": "my-wallet-passphrase"
}
}
}
},
"responses": {
"200": {
"description": "Wallet loaded (or created) successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"loaded": { "type": "boolean" },
"address": {
"type": "string",
"description": "Wallet stealth address (base58-encoded)"
}
}
},
"example": {
"loaded": true,
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"bad_json": {
"summary": "Malformed JSON",
"value": { "error": "invalid JSON body" }
},
"short_password": {
"summary": "Password too short",
"value": { "error": "password must be at least 3 characters" }
}
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"409": {
"description": "Wallet already loaded",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "wallet already loaded" }
}
}
},
"500": {
"description": "Failed to load or create wallet (wrong password, corrupt file, etc.)",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "failed to load wallet: cipher: message authentication failed" }
}
}
}
}
}
},
"/api/wallet/import": {
"post": {
"operationId": "importWallet",
"tags": ["Wallet"],
"summary": "Import wallet from recovery seed",
"description": "Creates a new wallet from a BIP39 12-word recovery seed, encrypts it with the given password, and saves it to disk. The wallet is loaded into the running daemon and the entire blockchain is scanned for outputs belonging to this seed. Can only be called when no wallet is currently loaded (returns 409 otherwise). If `filename` is provided, only the basename is used and the file is placed in the same directory as the configured `--wallet` path; if omitted, the default wallet path is used. Will not overwrite an existing file.",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["mnemonic", "password"],
"properties": {
"mnemonic": {
"type": "string",
"description": "BIP39 12-word recovery phrase"
},
"password": {
"type": "string",
"minLength": 3,
"description": "Encryption password for the wallet file (min 3 characters)"
},
"filename": {
"type": "string",
"description": "Optional wallet filename (basename only, no path separators). Defaults to the configured --wallet path."
}
}
},
"example": {
"mnemonic": "abandon ability able about above absent absorb abstract absurd abuse access accident",
"password": "my-wallet-passphrase",
"filename": "restored.dat"
}
}
}
},
"responses": {
"200": {
"description": "Wallet imported and loaded",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"imported": { "type": "boolean" },
"address": {
"type": "string",
"description": "Wallet stealth address (base58-encoded)"
},
"filename": {
"type": "string",
"description": "Basename of the created wallet file"
}
}
},
"example": {
"imported": true,
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF",
"filename": "restored.dat"
}
}
}
},
"400": {
"description": "Invalid request",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"bad_mnemonic": {
"summary": "Invalid seed phrase",
"value": { "error": "invalid mnemonic phrase" }
},
"short_password": {
"summary": "Password too short",
"value": { "error": "password must be at least 3 characters" }
},
"bad_filename": {
"summary": "Invalid filename",
"value": { "error": "invalid filename" }
}
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"409": {
"description": "Wallet already loaded or file already exists",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"already_loaded": {
"summary": "Wallet already active",
"value": { "error": "wallet already loaded" }
},
"file_exists": {
"summary": "File collision",
"value": { "error": "wallet file already exists: restored.dat" }
}
}
}
}
},
"500": {
"description": "Failed to create wallet",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "failed to create wallet: invalid mnemonic: checksum mismatch" }
}
}
}
}
}
},
"/api/wallet/balance": {
"get": {
"operationId": "getBalance",
"tags": ["Wallet"],
"summary": "Wallet balance",
"description": "Returns spendable, pending, and total confirmed balance in atomic units (1 BNT = 100,000,000 atomic units). Spendable excludes immature coinbase outputs. Also includes an optional UX-only `pending_unconfirmed` amount (typically change from your most recent send) plus an estimated unlock ETA in seconds, assuming ~5 minute blocks. Requires unlocked wallet.",
"responses": {
"200": {
"description": "Balance breakdown",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BalanceResponse"
},
"example": {
"spendable": 1250000000,
"pending": 72325093035,
"pending_unconfirmed": 0,
"pending_unconfirmed_eta": 0,
"total": 73575093035,
"outputs_total": 14,
"outputs_unspent": 9,
"chain_height": 14207
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"403": { "$ref": "#/components/responses/WalletLocked" },
"503": { "$ref": "#/components/responses/NoWallet" }
}
}
},
"/api/wallet/address": {
"get": {
"operationId": "getAddress",
"tags": ["Wallet"],
"summary": "Wallet stealth address",
"description": "Returns the wallet's public stealth address (base58-encoded spend_pub || view_pub, 64 bytes). Senders derive unique one-time addresses from this. Requires unlocked wallet.",
"responses": {
"200": {
"description": "Wallet address",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "Base58-encoded stealth address (spend_pub || view_pub, 64 raw bytes)"
},
"view_only": {
"type": "boolean",
"description": "True if this wallet can only scan for incoming funds, not spend"
}
}
},
"example": {
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF",
"view_only": false
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"403": { "$ref": "#/components/responses/WalletLocked" },
"503": { "$ref": "#/components/responses/NoWallet" }
}
}
},
"/api/wallet/history": {
"get": {
"operationId": "getHistory",
"tags": ["Wallet"],
"summary": "Wallet output history",
"description": "Returns wallet outputs (spendable UTXOs) with amounts, block heights, coinbase flag, and spent status. Requires unlocked wallet.",
"responses": {
"200": {
"description": "Output list",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"count": { "type": "integer" },
"outputs": {
"type": "array",
"items": { "$ref": "#/components/schemas/OutputEntry" }
}
}
},
"example": {
"count": 3,
"outputs": [
{
"txid": "c7f2e1d3a4b596870123456789abcdef0123456789abcdef0123456789abcdef",
"output_index": 0,
"amount": 72325093035,
"block_height": 14200,
"is_coinbase": true,
"spent": false
},
{
"txid": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",
"output_index": 0,
"amount": 500000000,
"block_height": 14100,
"is_coinbase": false,
"spent": false
},
{
"txid": "f0e1d2c3b4a5968778695a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d",
"output_index": 1,
"amount": 750000000,
"block_height": 13990,
"is_coinbase": false,
"spent": true,
"spent_height": 14050
}
]
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"403": { "$ref": "#/components/responses/WalletLocked" },
"503": { "$ref": "#/components/responses/NoWallet" }
}
}
},
"/api/wallet/send": {
"post": {
"operationId": "sendFunds",
"tags": ["Wallet"],
"summary": "Send funds",
"description": "Builds a privacy-preserving transaction using RingCT (Pedersen commitments, Bulletproofs range proofs, CLSAG ring signatures with fixed ring size 16), submits to mempool, and broadcasts via Dandelion++. Fee is calculated as max(min_fee, fee_per_byte * tx_size). Requires unlocked full wallet (not view-only).",
"parameters": [
{
"name": "Idempotency-Key",
"in": "header",
"required": false,
"schema": { "type": "string", "maxLength": 128 },
"description": "Optional idempotency key for retry-safe client behavior. Duplicate requests with the same key and identical JSON payload replay the original response for a bounded window (~10 minutes). Reusing a key with a different payload fails with 409."
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendRequest"
},
"example": {
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF",
"amount": 500000000
}
}
}
},
"responses": {
"200": {
"description": "Transaction built, submitted to mempool, and broadcast via Dandelion++",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendResponse"
},
"example": {
"txid": "b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4",
"fee": 15000,
"change": 734850000
}
}
}
},
"400": {
"description": "Invalid request (bad address, zero amount, insufficient balance)",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"bad_address": {
"summary": "Invalid stealth address",
"value": { "error": "invalid address: checksum mismatch" }
},
"zero_amount": {
"summary": "Zero amount",
"value": { "error": "amount must be greater than 0" }
},
"insufficient": {
"summary": "Insufficient balance",
"value": { "error": "insufficient spendable balance: have 250000000, need 500000000" }
}
}
}
}
},
"401": { "$ref": "#/components/responses/Unauthorized" },
"403": {
"description": "Wallet locked or view-only",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"examples": {
"locked": {
"value": { "error": "wallet is locked" }
},
"view_only": {
"value": { "error": "view-only wallet cannot send" }
}
}
}
}
},
"500": {
"description": "Transaction build or broadcast failed",
"content": {
"application/json": {
"schema": { "$ref": "#/components/schemas/Error" },
"example": { "error": "failed to build transaction: not enough ring members available" }
}
}
},
"503": { "$ref": "#/components/responses/NoWallet" }
}
}
},
"/api/wallet/sign": {
"post": {
"operationId": "signMessage",
"tags": ["Wallet"],
"summary": "Sign a message",
"description": "Signs an arbitrary message with the wallet's spend private key (ed25519). Useful for proving address ownership to external services ('login with Blocknet'). Response includes `Cache-Control: no-store`. Requires unlocked full wallet (not view-only).",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": ["message"],
"properties": {
"message": {
"type": "string",
"maxLength": 1024,
"description": "The message to sign (max 1024 bytes)"
}
}
},
"example": {
"message": "blocknet-auth:1:blocknet.id:a1b2c3d4e5f6:1708531200"
}
}
}
},
"responses": {
"200": {
"description": "Message signed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SignResponse"
},
"example": {
"address": "9PNoFCqUa7K8e5JfV2Hs3TBt7kMzRGkPxJ4xVmn5cFbLd1Qy8W6uXo3Z9pNvRwA2hY7sK4mBjE6gC8dF",