-
Notifications
You must be signed in to change notification settings - Fork 88
/
Copy pathapi.yaml
1857 lines (1771 loc) · 56.2 KB
/
api.yaml
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
asyncapi: '2.3.0'
info:
title: Hydra Node API
version: '0.11.0'
description: |
WebSocket/HTTP API for administrating & interacting with Hydra Heads: multi-party isomorphic state-channels for Cardano.
Once started, a Hydra node provides an API in the forms of JSON messages over WebSocket/HTTP endpoints. An Hydra node is an event-driven application where users (a.k.a you) are one possible source of inputs. Other sources can be mainly other Hydra nodes in the network, or transactions observed on the layer 1 (e.g. a closing transaction).
Therefore, once connected, clients receive a stream of outputs as they arrive. Clients get to decide (using query parameters) if they want to observe the history of outputs and the transaction format.
For example if client provides a path that looks like this `/?history=no&tx-output=cbor&snapshot-utxo=no` the server will not serve prior history of server outputs, the transaction fields in the json will be encoded as CBOR (base16 encoded), and the utxo field in the json will be omitted.
They can interact with their node by pushing events to it, some are local, and some will have consequences on the rest of the head.
See [the documentation](https://hydra.family/head-protocol/core-concepts/behavior/) for more details on the overall API behavior.
Users can also use the HTTP endpoint to draft a commit tx using their own utxo.
> By default, a Hydra node listens for TCP WebSocket connections on port `tcp/4001` . This can be changed using `--port`.
license:
name: Apache 2.0
url: https://raw.githubusercontent.com/input-output-hk/hydra/master/LICENSE
defaultContentType: application/json
servers:
localhost-ws:
url: "{host}:{port}"
protocol: ws
description: |
variables:
host:
description: Address the Hydra node is listening for client connections.
default: '127.0.0.1'
port:
description: Port the Hydra node is listening for client connections.
default: "4001"
localhost-http:
url: "{host}:{port}"
protocol: http
description: |
variables:
host:
description: Address at which the Hydra node is accepting the client requests.
default: '127.0.0.1'
port:
description: Port at which the Hydra node is accepting the client requests.
default: "4001"
channels:
/:
description: Main entry point for Websockets server in Hydra service.
servers:
- localhost-ws
bindings:
ws:
query:
history:
required: false
description: Specify weather the client wants to receive the full node history. Default is yes.
schema:
type: string
enum: ["yes", "no"]
tx-output:
description: Specify weather the client wants see transactions encoded as cbor. Default is json.
schema:
type: string
enum: ["json", "cbor"]
snapshot-utxo:
description: Specify weather the client wants see the snapshot utxo. Default is yes.
schema:
type: string
enum: ["yes", "no"]
subscribe:
summary: Events emitted by the Hydra node.
operationId: serverOutput
message:
oneOf:
- $ref: "#/components/messages/Greetings"
- $ref: "#/components/messages/PeerConnected"
- $ref: "#/components/messages/PeerDisconnected"
- $ref: "#/components/messages/HeadIsInitializing"
- $ref: "#/components/messages/Committed"
- $ref: "#/components/messages/HeadIsOpen"
- $ref: "#/components/messages/HeadIsClosed"
- $ref: "#/components/messages/HeadIsContested"
- $ref: "#/components/messages/ReadyToFanout"
- $ref: "#/components/messages/HeadIsAborted"
- $ref: "#/components/messages/HeadIsFinalized"
- $ref: "#/components/messages/TxValid"
- $ref: "#/components/messages/TxInvalid"
- $ref: "#/components/messages/SnapshotConfirmed"
- $ref: "#/components/messages/GetUTxOResponse"
- $ref: "#/components/messages/InvalidInput"
- $ref: "#/components/messages/PostTxOnChainFailed"
- $ref: "#/components/messages/CommandFailed"
publish:
summary: Commands sent to the Hydra node.
operationId: clientInput
message:
oneOf:
- $ref: "#/components/messages/Init"
- $ref: "#/components/messages/Abort"
- $ref: "#/components/messages/Commit"
- $ref: "#/components/messages/NewTx"
- $ref: "#/components/messages/GetUTxO"
- $ref: "#/components/messages/Close"
- $ref: "#/components/messages/Contest"
- $ref: "#/components/messages/Fanout"
/commit:
description: Main entry point to draft commit transaction in Hydra service.
servers:
- localhost-http
subscribe:
summary: Draft commit tx response
operationId: draftCommitTxResponse
description: |
Possible responses of commit endpoint are:
* DraftCommitTxResponse - 200 ok
* CannotCommitReferenceScript - 400 bad request
* CommittedTooMuchADAForMainnet - 400 bad request
* UnsupportedLegacyOutput - 400 bad request
* SpendingNodeUtxoForbidden - 400 bad request
message:
$ref: "api.yaml#/components/messages/DraftCommitTxResponse"
bindings:
http:
type: response
method: POST
bindingVersion: '0.1.0'
publish:
summary: Draft commit tx request
operationId: draftCommitTxRequest
message:
$ref: "#/components/messages/DraftCommitTxRequest"
bindings:
http:
type: request
method: POST
bindingVersion: '0.1.0'
components:
messages:
########
#
# Client Inputs
#
#######
Init:
title: Init
description: |
Initializes a new Head. This command is a no-op when a Head is already open and the server will output an `CommandFailed` message should this happen.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["Init"]
Abort:
title: Abort
description: |
Aborts a head before it is opened. This can only be done before all participants have committed. Once opened, the head can't be aborted anymore but it can be closed using: `Close`.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["Abort"]
Commit:
title: Commit
description: |
DEPRECATED: use the /commit endpoint instead to create a commit transaction and have it submitted to the node
Join an initialized head. This is how parties get to inject funds inside a head. Note however that the utxo is an object and can be empty should a participant wants to join a head without locking any funds.
payload:
type: object
required:
- tag
- utxo
properties:
tag:
type: string
enum: ["Commit"]
utxo:
$ref: "#/components/schemas/UTxO"
NewTx:
title: NewTx
description: |
Submit a transaction through the head. Note that the transaction is only broadcast if well-formed and valid.
payload:
type: object
required:
- tag
- transaction
properties:
tag:
type: string
enum: ["NewTx"]
transaction:
oneOf:
- $ref: "#/components/schemas/RawTransaction"
- $ref: "#/components/schemas/TextEnvelopeTransaction"
- $ref: "#/components/schemas/Transaction"
Close:
title: Close
description: |
Terminate a head with the latest known snapshot. This effectively moves the head from the Open state to the Close state where the contestation phase begin. As a result of closing a head, no more transactions can be submitted via NewTx.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["Close"]
Contest:
title: Contest
description: |
Challenge the latest snapshot announced as a result of a head closure from another participant. Note that this necessarily contest with the latest snapshot known of your local Hydra node. Participants can only contest once.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["Contest"]
Fanout:
title: Fanout
description: |
Finalize a head after the contestation period passed. This will distribute the final (as closed and maybe contested) head state back on the layer 1.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["Fanout"]
GetUTxO:
title: GetUTxO
description: |
Asynchronously access the current UTxO set of the Hydra node. This eventually triggers a UTxO event from the server.
payload:
type: object
required:
- tag
properties:
tag:
type: string
enum: ["GetUTxO"]
########
#
# Server Outputs
#
#######
Greetings:
title: Greetings
description: |
A friendly welcome message which tells a client something about the node. Currently used for knowing what Party the server embodies. This message produced whenever the hydra-node starts and clients should take consequence of seeing this. For example, we can assume no peers connected when we see 'Greetings'.
payload:
type: object
required:
- tag
- me
- headStatus
- seq
- timestamp
properties:
tag:
type: string
enum: ["Greetings"]
me:
$ref: "#/components/schemas/Party"
headStatus:
$ref: "#/components/schemas/HeadStatus"
snapshotUtxo:
$ref: "#/components/schemas/UTxO"
timestamp:
$ref: "#/components/schemas/UTCTime"
PeerConnected:
title: PeerConnected
description: |
A peer is now connected to the head network.
payload:
type: object
required:
- tag
- peer
- seq
- timestamp
properties:
tag:
type: string
enum: ["PeerConnected"]
peer:
$ref: "#/components/schemas/NodeId"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
PeerDisconnected:
title: PeerDisconnected
description: |
A peer has disconnected from the head network.
payload:
type: object
required:
- tag
- peer
- seq
- timestamp
properties:
tag:
type: string
enum: ["PeerDisconnected"]
peer:
$ref: "#/components/schemas/NodeId"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsInitializing:
title: HeadIsInitializing
description: |
A `Init` transaction has been observed on-chain, with the given HeadId
payload:
type: object
required:
- tag
- headId
- parties
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsInitializing"]
headId:
$ref: "#/components/schemas/HeadId"
parties:
type: array
items:
$ref: "#/components/schemas/Party"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
Committed:
title: Committed
description: |
A `Commit` from a head participant has been observed on-chain.
payload:
type: object
required:
- tag
- party
- utxo
- seq
- timestamp
properties:
tag:
type: string
enum: ["Committed"]
party:
$ref: "#/components/schemas/Party"
utxo:
$ref: "#/components/schemas/UTxO"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsOpen:
title: HeadIsOpen
description: |
All parties have committed, and a successful `CollectCom` transaction was observed on-chain. The head is now open; transactions can flow.
payload:
type: object
required:
- tag
- headId
- utxo
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsOpen"]
headId:
$ref: "#/components/schemas/HeadId"
utxo:
$ref: "#/components/schemas/UTxO"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsClosed:
title: HeadIsClosed
description: |
A `Close` transaction has been observed on-chain, the head is now closed and the contestation phase begins.
payload:
type: object
required:
- tag
- headId
- snapshotNumber
- contestationDeadline
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsClosed"]
headId:
$ref: "#/components/schemas/HeadId"
snapshotNumber:
$ref: "#/components/schemas/SnapshotNumber"
contestationDeadline:
$ref: "#/components/schemas/UTCTime"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsContested:
title: HeadIsContested
description: |
A `Contest` transaction has been observed on-chain, that means the head
state has been successfully contested and given snapshot number is now
the latest accepted snapshot.
payload:
type: object
required:
- tag
- headId
- snapshotNumber
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsContested"]
headId:
$ref: "#/components/schemas/HeadId"
snapshotNumber:
$ref: "#/components/schemas/SnapshotNumber"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
ReadyToFanout:
title: ReadyToFanout
description: |
The contestation period has passed and the head can now be finalized by
a fanout transaction.
payload:
type: object
required:
- tag
- headId
- seq
- timestamp
properties:
tag:
type: string
enum: ["ReadyToFanout"]
headId:
$ref: "#/components/schemas/HeadId"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsAborted:
title: HeadIsAborted
description: |
One of the participant did `Abort` the head before all commits were done or collected.
payload:
type: object
required:
- tag
- headId
- utxo
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsAborted"]
headId:
$ref: "#/components/schemas/HeadId"
utxo:
$ref: "#/components/schemas/UTxO"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
HeadIsFinalized:
title: HeadIsFinalized
description: |
The head was already closed and the contestation period is now over.
payload:
type: object
required:
- tag
- headId
- utxo
- seq
- timestamp
properties:
tag:
type: string
enum: ["HeadIsFinalized"]
headId:
$ref: "#/components/schemas/HeadId"
utxo:
$ref: "#/components/schemas/UTxO"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
TxValid:
title: TxValid
description: |
Observed a valid transaction inside the head. Note that a node observes
its own transactions and it may still happen that this transaction is
not included in a snapshot.
payload:
type: object
required:
- tag
- headId
- transaction
- seq
- timestamp
properties:
tag:
type: string
enum: ["TxValid"]
headId:
$ref: "#/components/schemas/HeadId"
transaction:
description: Choose between output formats using the `tx-output` query parameter.
oneOf:
- $ref: "#/components/schemas/Transaction"
- $ref: "#/components/schemas/RawTransaction"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
TxInvalid:
title: TxInvalid
description: |
Observed an invalid transaction inside the head. Either it is not yet
valid (because some other transactions need to be seen first), or it is
no longer valid (because of conflicting transactions observed
in-between. The included validation error should give an indication why
it was not applicable to the given UTxO (the local, seen ledger state).
payload:
type: object
required:
- tag
- headId
- utxo
- transaction
- validationError
- seq
- timestamp
properties:
tag:
type: string
enum: ["TxInvalid"]
headId:
$ref: "#/components/schemas/HeadId"
utxo:
$ref: "#/components/schemas/UTxO"
transaction:
description: Choose between output formats using the `tx-output` query parameter.
oneOf:
- $ref: "#/components/schemas/Transaction"
- $ref: "#/components/schemas/RawTransaction"
validationError:
type: object
properties:
reason:
type: string
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
SnapshotConfirmed:
title: SnapshotConfirmed
description: |
The given snapshot has been multi-signed by all head participants and is now confirmed.
payload:
type: object
required:
- tag
- headId
- snapshot
- seq
- timestamp
properties:
tag:
type: string
enum: ["SnapshotConfirmed"]
headId:
$ref: "#/components/schemas/HeadId"
snapshot:
$ref: "#/components/schemas/Snapshot"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
GetUTxOResponse:
title: GetUTxOResponse
description: |
Emitted as a result of a `GetUTxO` to reflect the current UTxO of the underlying node.
payload:
type: object
required:
- tag
- headId
- utxo
- seq
- timestamp
properties:
tag:
type: string
enum: ["GetUTxOResponse"]
headId:
$ref: "#/components/schemas/HeadId"
utxo:
$ref: "#/components/schemas/UTxO"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
InvalidInput:
title: InvalidInput
description: |
Emitted by the server when it has failed to parse some client input. It returns the malformed input as well as some hint about what went wrong.
payload:
type: object
required:
- tag
- reason
- input
- seq
- timestamp
properties:
tag:
type: string
enum: ["InvalidInput"]
reason:
type: string
input:
type: string
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
PostTxOnChainFailed:
title: PostTxOnChainFailed
description: |
Something wrong happened when trying to post a transaction on-chain. Provides information about what kind of transaction was tentatively posted, and the reason for failure.
payload:
type: object
additionalProperties: false
required:
- tag
- postChainTx
- postTxError
- seq
- timestamp
properties:
tag:
type: string
enum: ["PostTxOnChainFailed"]
postChainTx:
$ref: "#/components/schemas/PostChainTx"
postTxError:
$ref: "#/components/schemas/PostTxError"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
CommandFailed:
title: CommandFailed
description: |
Emitted by the server when a well-formed client input was not processable. For example, if trying to close a non opened head or, when trying to commit after having already committed.
payload:
type: object
required:
- tag
- clientInput
- seq
- timestamp
properties:
tag:
type: string
enum: ["CommandFailed"]
clientInput:
oneOf:
- $ref: "#/components/messages/Init/payload"
- $ref: "#/components/messages/Abort/payload"
- $ref: "#/components/messages/Commit/payload"
- $ref: "#/components/messages/NewTx/payload"
- $ref: "#/components/messages/GetUTxO/payload"
- $ref: "#/components/messages/Close/payload"
- $ref: "#/components/messages/Contest/payload"
- $ref: "#/components/messages/Fanout/payload"
seq:
$ref: "#/components/schemas/SequenceNumber"
timestamp:
$ref: "#/components/schemas/UTCTime"
DraftCommitTxRequest:
title: DraftCommitTxRequest
description: |
Provide utxos that will be used to draft a commit transaction that will be sent back to the user.
Script utxos must provide a witness, regulars can omit this.
payload:
$ref: "api.yaml#/components/schemas/UTxOWithWitness"
example:
{
"0406060506030602040508060506060306050406020207000508040704040203#89": {
"address": "addr_test1vz66ue36465w2qq40005h2hadad6pnjht8mu6sgplsfj74q9pm4f4",
"value": {
"lovelace": 7620669
}
},
"09d34606abdcd0b10ebc89307cbfa0b469f9144194137b45b7a04b273961add8#687": {
"address": "addr1w9htvds89a78ex2uls5y969ttry9s3k9etww0staxzndwlgmzuul5",
"value": {
"lovelace": 7620669
},
"witness": {
"datum": "02",
"plutusV2Script": {
"cborHex": "420606",
"description": "",
"type": "PlutusScriptV2"
},
"redeemer": "21"
}
}
}
DraftCommitTxResponse:
title: DraftCommitTxResponse
description: |
Emitted by the server after drafting a commit transaction with the user provided utxos. Transaction returned to the user is in it's cbor representation encoded as Base16.
payload:
$ref: "api.yaml#/components/schemas/TextEnvelopeTransaction"
########
#
# Schemas
#
#######
schemas:
Address:
type: string
description: |
A bech-32 encoded Cardano address, see
https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#Bech32s and
https://github.com/cardano-foundation/CIPs/blob/master/CIP-0005/CIP-0005.md
examples:
- "addr1w9htvds89a78ex2uls5y969ttry9s3k9etww0staxzndwlgmzuul5"
- "addr_test1gpr87kyn9d2fzpvy5r5w5fdzyhsx59znpvhfd6fcc5ar7g5yl33cdg0cq24ewdshsutgm"
ByronAddress:
type: string
description: |
A legacy Byron address.
examples:
- "DdzFFzCqrht2KG1vWt5WGhVC9Ezyu32RgB5M2DocdZ6BQU6zj69LSqksDmdM"
Cbor:
type: string
description: |
The base16-encoding of the CBOR encoding of some binary data
contentEncoding: base16
example:
"820082582089ff4f3ff4a6052ec9d073b3be68b5e7596bd74a04e7b74504a8302fb2278cd95840f66eb3cd160372d617411408792c0ebd9791968e9948112894e2706697a55c10296b04019ed2f146f4d81e8ab17b9d14cf99569a2f85cbfa32320127831db202"
ConfirmedSnapshot:
oneOf:
- title: "InitialSnapshot"
type: object
additionalProperties: false
required:
- initialUTxO
- tag
properties:
initialUTxO:
$ref: "#/components/schemas/UTxO"
tag:
type: string
enum: ["InitialSnapshot"]
- title: "ConfirmedSnapshot"
type: object
additionalProperties: false
required:
- snapshot
- signatures
properties:
snapshot:
$ref: "#/components/schemas/Snapshot"
signatures:
$ref: "#/components/schemas/MultiSignature"
tag:
type: string
enum: ["ConfirmedSnapshot"]
ContestationPeriod:
type: number
description: |
A contestation duration in seconds.
example: 60
HeadId:
type: string
description: |
A unique identifier for a Head, represented by a hex-encoded 16 bytes string.
contentEncoding: base16
example:
"820082582089ff4f3ff4a6052ec9d073"
HeadParameters:
type: object
additionalProperties: false
required:
- contestationPeriod
- parties
properties:
contestationPeriod:
$ref: "#/components/schemas/ContestationPeriod"
parties:
type: array
items:
$ref: "#/components/schemas/Party"
HeadStatus:
type: string
enum:
- Idle
- Initializing
- Open
- Closed
- FanoutPossible
- Final
MultiSignature:
type: object
description: |
Aggregated signature produced by Head protocol when a Snapshot is confirmed by all parties.
additionalProperties: false
required:
- multiSignature
properties:
multiSignature:
type: array
items:
$ref: "#/components/schemas/Signature"
Party:
type: object
description: |
The verification key for some Party in the Head protocol, uniquely identifying it.
additionalProperties: false
required:
- vkey
properties:
vkey:
type: string
contentEncoding: base16
example:
{
"vkey": "d0b8f28427aa7b640c636075905cbd6574a431aeaca5b3dbafd47cfe66c35043"
}
Peer:
type: object
description: |
Information identifying a network peer.
properties:
hostname:
type: string
format: hostname
port:
type: number
example:
{
"hostname": "10.0.0.10",
"port": 5001
}
NodeId:
type: string
description: Hydra Node identifier
example: "some hydra-node id"
PostChainTx:
description: |
Description of outgoing On-Chain transactions for the Head protocol. As is
the case for OnChainTx, these data structures completely abstract away the
actual details of the transaction and only represent data relevant for the
protocol to make some progress.
oneOf:
- title: InitTx
type: object
additionalProperties: false
required:
- tag
- headParameters
description: |
The initial transaction of the Head defining its parameters.
properties:
tag:
type: string
enum: ["InitTx"]
headParameters:
$ref: "#/components/schemas/HeadParameters"
- title: CommitTx
type: object
additionalProperties: false
required:
- tag
- party
- committed
description: |
Commit some UTxO set to the opening Head, signed by this party.
properties:
tag:
type: string
enum: ["CommitTx"]
party:
$ref: "#/components/schemas/Party"
committed:
$ref: "#/components/schemas/UTxO"
- title: AbortTx
type: object
additionalProperties: false
required:
- tag
- utxo
description: |
Abort the opening of the Head process.
properties:
tag:
type: string
enum: ["AbortTx"]
utxo:
$ref: "#/components/schemas/UTxO"
- title: CollectComTx
type: object
additionalProperties: false
required:
- tag
- utxo
description: |
Confirm the opening of the Head collecting the committed UTxO set
combined from all individual commits.
properties:
tag:
type: string