diff --git a/CIP-0116/README.md b/CIP-0116/README.md new file mode 100644 index 0000000000..8aa3aec317 --- /dev/null +++ b/CIP-0116/README.md @@ -0,0 +1,302 @@ +--- +CIP: 116 +Title: Standard JSON encoding for Domain Types +Category: Tools +Status: Proposed +Authors: + - Vladimir Kalnitsky +Implementors: + - Vladimir Kalnitsky +Discussions: + - https://github.com/cardano-foundation/CIPs/pull/742 + - https://github.com/cardano-foundation/CIPs/pull/766 +Created: 2024-02-22 +License: CC-BY-4.0 +--- + +## Abstract + +Canonical JSON encoding for Cardano domain types lets the ecosystem converge on a single way of serializing data to JSON, thus freeing the developers from repeating roughly the same, but slightly different encoding/decoding logic over and over. + +## Motivation: why is this CIP necessary? + +Cardano domain types have canonical CDDL definitions (for every era), but when it comes to use in web apps, where JSON is the universally accepted format, there is no definite standard. This CIP aims to change that. + +The full motivation text is provided in [CPS-11 | Universal JSON Encoding for Domain Types](https://github.com/cardano-foundation/CIPs/tree/master/CPS-0011). + +## Specification + +This CIP is expected to contain multiple json-schema definitions for Cardano Eras and breaking intra-era hardforks starting from Babbage. + +| Ledger era | Hardfork | Ledger Commit | Schema | Changelog Entry | +| --- | --- | --- | --- |--- | +| Babbage | Vasil | [12dc779](https://github.com/IntersectMBO/cardano-ledger/blob/12dc779d7975cbeb69c7c18c1565964a90f50920/eras/babbage/impl/cddl-files/babbage.cddl) | [cardano-babbage.json](./cardano-babbage.json) | N/A | + +### Tests & utilities for JSON validation + +[`cip-0116-tests`](https://github.com/mlabs-haskell/cip-0116-tests) repo contains utility functions and a test suite for the schema. In particular, there's a `mkValidatorForType` function that builds a validator function for any type defined in the schema. + +### Scope of the Schema + +The schemas should cover `Block` type and all of its structural components, which corresponds to the scope of CDDL files located in [the ledger repo](https://github.com/IntersectMBO/cardano-ledger/). + +### Schema Design Principles + +Below you can find some principles outlining the process of schema creation / modification. They are intended to be applied when there is a need to create a schema for a new Cardano era. + +#### Uniqueness of encoding + +Every transaction (i.e. CBOR-encoded binary) must have exactly one valid JSON encoding, up to entry ordering in mappings (that are represented as key-value pairs). + +For a single JSON fixture, however, there are multiple variants of encoding it as CBOR. + +#### Consistency with the previous versions + +To simplify transitions of dApps between eras, the scope of changes introduced to the schemas SHOULD be limited to the scope of CDDL changes. + +### Schema Conventions + +These conventions help to keep the schema uniform in style. + +#### Encoding of binary types + +Binary data MUST be encoded as lower-case hexademical strings. Restricting the character set to lower-case letters (`a-f`) allows for comparisons and equality checks without the need to normalize the values to a uniform case. + +#### Encoding of mapping types + +`Map`-like container types MUST be encoded as arrays of key-value pairs. + +```json +"Map": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": ..., + "value": ... + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } +} +``` + +Uniqueness of `"key"` objects in a map MUST be preserved (but this property is not expressible via a schema). + +Implementations MUST consider mappings with conflicting keys invalid. + +Some mapping-like types, specifically `Mint`, allow for duplicate keys. Types like these should not be encoded as maps, instead, `key` and `value` properties should be named differently. + +#### Encoding of variant types + +Encoding types with variable payloads MUST be done with the use of `oneOf` and an explicit discriminator property: `tag`: + +```json +{ + "Credential": { + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "pubkey_hash" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/Ed25519KeyHash" + } + }, + "required": ["tag", "value"], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "script_hash" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/ScriptHash" + } + }, + "required": ["tag", "value"], + "additionalProperties": false + } + ] + } +} +``` + +Other properties of a tagged object MUST be specified in lower-case snake-case. + +#### Encoding of enum types + +Enums are a special kind of variant types that carry no payloads. These MUST be encoded as string `enum`s. + +Lowercase snake case identifiers MUST be used for the options, e.g.: + +```json +{ + "Language": { + "title": "Language", + "type": "string", + "enum": [ + "plutus_v1", + "plutus_v2" + ] + } +} +``` + +#### Encoding of record types + +All record types MUST be encoded as objects with explicit list of `required` properties, and `additionalProperties` set to `false` (see "absence of extensibility" chapter for the motivation behind this suggestion). + +#### Encoding of nominal type synonyms + +Some of the types have identical representations, differing only by nominal name. For example, `Slot` domain type is expressed as `uint` in CDDL. + +For these types, their nominal name SHOULD NOT have a separate definition in the json-schema, and the "representation type" should be used via a `$ref` instead. The domain type name SHOULD be included as `title` string at the point of usage. + +### Additional format types + +Some non-standard `format` types are used: + +- `hex` - lower-case hex-encoded byte string +- `bech32` - [bech32](https://en.bitcoin.it/wiki/Bech32) string +- `base58` - [base58](https://bitcoinwiki.org/wiki/base58) string +- `uint64` - 64-bit unsigned integer +- `int128` - 128-bit signed integer +- `string64` - a unicode string that must not exceed 64 bytes when utf8-encoded. +- `posint64` - a positive (0 excluded) 64-bit integer. `1 .. 2^64-1` + +### Limitations + +JSON-schema does not allow to express certain properties of some of the types. + +#### Uniqueness of mapping keys + +See the chapter on encoding of mapping types. + +#### Bech32 and Base58 formats + +Validity of values of these types can't be expressed as a regular expression, so the implementations MAY validate them separately. + +#### Address types + +Bech32 strings are not always valid addresses: even if the prefixes are correct, the [binary layout of the payload](https://github.com/IntersectMBO/cardano-ledger/blob/f754084675a1decceed4f309814b09605f443dd5/libs/cardano-ledger-core/src/Cardano/Ledger/Address.hs#L603) must also be valid. + +The implementations MAY validate it separately. + +#### Byte length limits for strings + +In CDDL, the length of a `tstr` value gives the number of bytes, but in `json-schema` there is no way to specify restrictions on byte lengths. So, `maxLength` is not the correct way of specifying the limits, but it is still useful, because no string longer than 64 *characters* satisfies the 64-byte limit. + +#### Auxiliary Data encoding + +`auxiliary_data` CDDL type is handled specially. + +```cddl +auxiliary_data = + metadata ; Shelley + / [ transaction_metadata: metadata ; Shelley-ma + , auxiliary_scripts: [ * native_script ] + ] + / #6.259({ ? 0 => metadata ; Alonzo and beyond + , ? 1 => [ * native_script ] + , ? 2 => [ * plutus_v1_script ] + , ? 3 => [ * plutus_v2_script ] + }) +``` + +Instead of providing all three variants of encoding, we base the schema on the one that is the most general (the last one): + +```json +{ + "AuxiliaryData": { + "properties": { + "metadata": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadata" + }, + "native_scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + }, + "plutus_scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusScript" + } + } + }, + } +} +``` + +It is up to implementors to decide how to serialize the values into CBOR. The property we want to maintain is preserved regardless of the choice: for every block binary there is exactly one JSON encoding. + +### Versioning + +This CIP should not follow a conventional versioning scheme, rather it should be altered via pull request before a hardforks to add new a JSON schema to align with new ledger ers. Each schema must be standalone and not reuse definitions between eras. Authors MUST follow the [Schema Scope](#scope-of-the-schema), [Schema Design Principles](#schema-design-principles) and [Schema Conventions](#schema-conventions). + +Furthermore, for each subsequent schema, the [changelog](./changelog.md) must be updated. Authors must clearly articulate the deltas between schemas. + +## Rationale: how does this CIP achieve its goals? + +### Scope + +We keep the scope of this standard to the data types within Cardano blocks. The rationale for this is that block data is by far the most useful for the majority of Cardano actors. There is also one nice benefit that the definitions can map directly from the provided CDDL file from ledger team. + +### Strictness + +This CIP lays out strong conventions that future schema authors must follow, along with a large set of design principles. The aim is to minimize the potential for unavoidable deltas between schemas. + +By setting sometimes arbitrary conventions we hope to create a single possible interpretation from CBOR to JSON, alleviating any ambiguity. + +### Absence of extensibility + +The schemas MUST NOT be extensible with additional properties. This may sound counter-intuitive and against the spirit of json-schema, but there are some motivations behind that: + +- More safety from typos: object fields that are optional may be specified with slightly incorrect names in dApps' code, leading to inability of the decoders to pick up the values, which may go unnoticed. +- Clear delineation between Cardano domain types and user dApp domain types: forcing the developers to store their dApp domain data separately from Cardano data, or close to it (as opposed to mixing these together in a single object) will indirectly motivate better structured dApp code. + +### JSON + +JSON was chosen as there is no viable alternative. The majority of Cardano's web tooling is built with Javascript where JSON is the primary object representation format. + +Furthermore, even across non-Javascript based stacks, JSON enjoys wide tooling support, this improves the potential for builders to adopt this standard. + +### Bech32 for addresses + +We choose to use Bech32 as the representation for Cardano addresses. When compared to the alternative of hexademical encoding, Bech32 gives the advantages of an included checksum and a human readable prefix. + +## Path to Active + +### Acceptance Criteria + +- [ ] One future ledger era schema is added +- [ ] This standard is implemented within three separate tools, libraries, etc. + +### Implementation Plan + +- [x] Complete the specification for the current Babbage era +- [ ] Provide a test suite validating JSON fixtures for all the types against the schema +- [x] Provide an implementation of validating functions that uses this json-schema + - [mlabs-haskell/cip-0116-tests](https://github.com/mlabs-haskell/cip-0116-tests) +- [ ] Collect a list of cardano domain types implementations and negotiate transition to the specified formats with maintainers (if it makes sense and is possible) + +## Copyright + +This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode). diff --git a/CIP-0116/cardano-babbage.json b/CIP-0116/cardano-babbage.json new file mode 100644 index 0000000000..edc6bbdf15 --- /dev/null +++ b/CIP-0116/cardano-babbage.json @@ -0,0 +1,1952 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "cardano-babbage.json", + "title": "Cardano Domain Types", + "definitions": { + "BigInt": { + "title": "BigInt", + "type": "string", + "description": "A long integer domain type", + "pattern": "^(0|-?[1-9][0-9]*)$", + "examples": [ + "0", + "-123", + "123" + ] + }, + "ByteString": { + "title": "ByteString", + "description": "Arbitrary-length byte array", + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f])*$" + }, + "UInt64": { + "title": "UInt64", + "description": "64-bit unsigned integer", + "type": "string", + "pattern": "^(0|[1-9][0-9]*)$", + "format": "uint64" + }, + "PosInt64": { + "title": "PosInt64", + "description": "64-bit unsigned integer, zero-excluded. 1-18446744073709551615", + "type": "string", + "pattern": "^([1-9][0-9]*)$", + "format": "posint64" + }, + "Int128": { + "title": "Int128", + "description": "128-bit signed integer", + "type": "string", + "pattern": "^-?(0|[1-9][0-9]*)$", + "format": "int128" + }, + "NonZeroInt64": { + "title": "NonZeroInt64", + "description": "64-bit signed integer, zero excluded. Ranges: -9223372036854775808..-1 and 1..9223372036854775807", + "type": "string", + "pattern": "^-?([1-9][0-9]*)$" + }, + "UInt32": { + "title": "UInt32", + "description": "32-bit unsigned integer", + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + "RewardAddress": { + "title": "RewardAddress", + "type": "string", + "format": "bech32", + "pattern": "^(stake1|stake_test1)[02-9ac-hj-np-z]*$" + }, + "ByronAddress": { + "title": "ByronAddress", + "type": "string", + "format": "base58", + "pattern": "^[1-9A-HJ-NP-Za-km-z]+$" + }, + "PointerAddress": { + "title": "PointerAddress", + "type": "string", + "format": "bech32", + "pattern": "^(addr1|addr_test1)[02-9ac-hj-np-z]*$" + }, + "EnterpriseAddress": { + "title": "EnterpriseAddress", + "type": "string", + "format": "bech32", + "pattern": "^(addr1|addr_test1)[02-9ac-hj-np-z]*$" + }, + "BaseAddress": { + "title": "BaseAddress", + "type": "string", + "format": "bech32", + "pattern": "^(addr1|addr_test1)[02-9ac-hj-np-z]*$" + }, + "Address": { + "title": "Address", + "anyOf": [ + { + "$ref": "cardano-babbage.json#/definitions/RewardAddress" + }, + { + "$ref": "cardano-babbage.json#/definitions/BaseAddress" + }, + { + "$ref": "cardano-babbage.json#/definitions/PointerAddress" + }, + { + "$ref": "cardano-babbage.json#/definitions/EnterpriseAddress" + }, + { + "$ref": "cardano-babbage.json#/definitions/ByronAddress" + } + ] + }, + "Ed25519KeyHash": { + "title": "Ed25519KeyHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{56}$" + }, + "ScriptHash": { + "title": "ScriptHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{56}$" + }, + "AssetName": { + "title": "AssetName", + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){0,32}$" + }, + "Credential": { + "title": "Credential", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "pubkey_hash" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/Ed25519KeyHash" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "script_hash" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/ScriptHash" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + } + ] + }, + "MultiAsset": { + "title": "MultiAsset", + "description": "A mapping from policy IDs (script hashes) to mappings from asset names to amounts", + "type": "object", + "patternProperties": { + "^[0-9a-f]{56}$": { + "type": "object", + "patternProperties": { + "^([0-9a-f][0-9a-f]){0,32}$": { + "$ref": "cardano-babbage.json#/definitions/PosInt64" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "Value": { + "title": "Value", + "type": "object", + "properties": { + "coin": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "assets": { + "$ref": "cardano-babbage.json#/definitions/MultiAsset" + } + }, + "required": [ + "coin" + ], + "additionalProperties": false + }, + "TransactionHash": { + "title": "TransactionHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$", + "maxLength": 64, + "minLength": 64 + }, + "TransactionInput": { + "title": "TransactionInput", + "type": "object", + "properties": { + "transaction_id": { + "$ref": "cardano-babbage.json#/definitions/TransactionHash" + }, + "index": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + } + }, + "required": [ + "transaction_id", + "index" + ], + "additionalProperties": false + }, + "PlutusScript": { + "title": "PlutusScript", + "type": "object", + "properties": { + "language": { + "$ref": "cardano-babbage.json#/definitions/Language" + }, + "bytes": { + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f])+$" + } + }, + "required": [ + "language", + "bytes" + ], + "additionalProperties": false + }, + "NativeScript": { + "title": "NativeScript", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "title": "ScriptPubkey", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "pubkey" + ] + }, + "pubkey": { + "$ref": "cardano-babbage.json#/definitions/Ed25519KeyHash" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "pubkey" + ] + }, + { + "title": "ScriptAll", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "all" + ] + }, + "scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + } + }, + "additionalProperties": false, + "required": [ + "tag", + "scripts" + ] + }, + { + "title": "ScriptAny", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "any" + ] + }, + "scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + } + }, + "additionalProperties": false, + "required": [ + "tag", + "scripts" + ] + }, + { + "title": "ScriptNOfK", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "n_of_k" + ] + }, + "scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + }, + "n": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "scripts", + "n" + ] + }, + { + "title": "TimelockStart", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "timelock_start" + ] + }, + "slot": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "slot" + ] + }, + { + "title": "TimelockExpiry", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "timelock_expiry" + ] + }, + "slot": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "slot" + ] + } + ] + }, + "ScriptRef": { + "title": "ScriptRef", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "title": "PlutusScript", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "plutus_script" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/PlutusScript" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + }, + { + "title": "NativeScript", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "native_script" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + } + ] + }, + "DataHash": { + "title": "DataHash", + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){32}$" + }, + "TransactionOutput": { + "title": "TransactionOutput", + "type": "object", + "properties": { + "address": { + "$ref": "cardano-babbage.json#/definitions/Address" + }, + "amount": { + "$ref": "cardano-babbage.json#/definitions/Value" + }, + "plutus_data": { + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "datum" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + } + } + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "datum_hash" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/DataHash" + } + } + } + ] + }, + "script_ref": { + "$ref": "cardano-babbage.json#/definitions/ScriptRef" + } + }, + "required": [ + "address", + "amount" + ] + }, + "TransactionUnspentOutput": { + "title": "TransactionUnspentOutput", + "type": "object", + "properties": { + "input": { + "$ref": "cardano-babbage.json#/definitions/TransactionInput" + }, + "output": { + "$ref": "cardano-babbage.json#/definitions/TransactionOutput" + } + }, + "required": [ + "input", + "output" + ], + "additionalProperties": false + }, + "TransactionMetadatum": { + "title": "TransactionMetadatum", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "map" + ] + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadatum" + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadatum" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "required": [ + "tag", + "contents" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "list" + ] + }, + "contents": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadatum" + } + } + }, + "required": [ + "tag", + "contents" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "int" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/Int128" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + }, + { + "type": "object", + "properties": { + "tag": { + "enum": [ + "bytes" + ] + }, + "value": { + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){0,64}$" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + }, + { + "title": "Metadata String", + "description": "UTF-8 string. Maximum size is 64 bytes, but there is no way to express byte length limit in a json-schema (maxLength limits the number of characters)", + "type": "object", + "properties": { + "tag": { + "enum": [ + "string" + ] + }, + "value": { + "type": "string", + "maxLength": 64, + "format": "string64" + } + }, + "required": [ + "tag", + "value" + ], + "additionalProperties": false + } + ] + }, + "PlutusV1CostModel": { + "title": "PlutusV1CostModel", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Int128" + }, + "maxItems": 166, + "minItems": 166 + }, + "PlutusV2CostModel": { + "title": "PlutusV2CostModel", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Int128" + }, + "maxItems": 175, + "minItems": 175 + }, + "CostModels": { + "title": "CostModels", + "type": "object", + "properties": { + "plutus_v1": { + "$ref": "cardano-babbage.json#/definitions/PlutusV1CostModel" + }, + "plutus_v2": { + "$ref": "cardano-babbage.json#/definitions/PlutusV2CostModel" + } + }, + "required": [], + "additionalProperties": false + }, + "ExUnitPrices": { + "title": "ExUnitPrices", + "type": "object", + "properties": { + "mem_price": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + }, + "step_price": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + } + }, + "additionalProperties": false, + "required": [ + "mem_price", + "step_price" + ] + }, + "ExUnits": { + "title": "ExUnits", + "type": "object", + "properties": { + "mem": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "steps": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "required": [ + "mem", + "steps" + ], + "additionalProperties": false + }, + "ProtocolVersion": { + "title": "ProtocolVersion", + "type": "object", + "properties": { + "major": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "minor": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + } + }, + "required": [ + "major", + "minor" + ], + "additionalProperties": false + }, + "ProtocolParamUpdate": { + "title": "ProtocolParamUpdate", + "type": "object", + "properties": { + "ada_per_utxo_byte": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "collateral_percentage": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "cost_models": { + "$ref": "cardano-babbage.json#/definitions/CostModels" + }, + "d": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + }, + "execution_costs": { + "$ref": "cardano-babbage.json#/definitions/ExUnitPrices" + }, + "expansion_rate": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + }, + "key_deposit": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "max_block_body_size": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "max_block_ex_units": { + "$ref": "cardano-babbage.json#/definitions/ExUnits" + }, + "max_block_header_size": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "max_collateral_inputs": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "max_epoch": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "max_tx_ex_units": { + "$ref": "cardano-babbage.json#/definitions/ExUnits" + }, + "max_tx_size": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "max_value_size": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "min_pool_cost": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "minfee_a": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "minfee_b": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "n_opt": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "pool_deposit": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "pool_pledge_influence": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + }, + "protocol_version": { + "$ref": "cardano-babbage.json#/definitions/ProtocolVersion" + }, + "treasury_growth_rate": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + } + }, + "additionalProperties": false, + "required": [] + }, + "Update": { + "title": "Update", + "type": "object", + "properties": { + "epoch": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "proposed_protocol_parameter_updates": { + "type": "object", + "title": "ProposedProtocolParameterUpdates", + "description": "A mapping from GenesisHash to ProtocolParamUpdate", + "patternProperties": { + "^[0-9a-f]{56}$": { + "title": "ProtocolParamUpdate for a given GenesisHash", + "$ref": "cardano-babbage.json#/definitions/ProtocolParamUpdate" + } + }, + "additionalProperties": false + } + }, + "required": [ + "epoch", + "proposed_protocol_parameter_updates" + ], + "additionalProperties": false + }, + "ScriptDataHash": { + "title": "ScriptDataHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$" + }, + "TransactionMetadata": { + "title": "TransactionMetadata", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadatum" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + }, + "AuxiliaryDataHash": { + "title": "AuxiliaryDataHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$" + }, + "AuxiliaryData": { + "title": "AuxiliaryData", + "type": "object", + "properties": { + "metadata": { + "$ref": "cardano-babbage.json#/definitions/TransactionMetadata" + }, + "native_scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + }, + "plutus_scripts": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusScript" + } + } + }, + "required": [], + "additionalProperties": false + }, + "TransactionBody": { + "title": "TransactionBody", + "type": "object", + "properties": { + "auxiliary_data_hash": { + "$ref": "cardano-babbage.json#/definitions/AuxiliaryDataHash" + }, + "inputs": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionInput" + } + }, + "outputs": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionOutput" + } + }, + "fee": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "certs": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Certificate" + } + }, + "collateral": { + "title": "Collateral Inputs", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionInput" + } + }, + "collateral_return": { + "allOf": [ + { + "$ref": "cardano-babbage.json#/definitions/TransactionOutput" + }, + { + "title": "Collateral Return", + "description": "Collateral return, introduced in CIP-40" + } + ] + }, + "mint": { + "$ref": "cardano-babbage.json#/definitions/Mint" + }, + "network_id": { + "$ref": "cardano-babbage.json#/definitions/NetworkId" + }, + "reference_inputs": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionInput" + } + }, + "required_signers": { + "title": "Required signers", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Ed25519KeyHash" + } + }, + "script_data_hash": { + "$ref": "cardano-babbage.json#/definitions/ScriptDataHash" + }, + "total_collateral": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "ttl": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "update": { + "$ref": "cardano-babbage.json#/definitions/Update" + }, + "validity_start_interval": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "withdrawals": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "$ref": "cardano-babbage.json#/definitions/RewardAddress" + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "additionalProperties": false + } + } + }, + "required": [ + "inputs", + "outputs", + "fee" + ], + "additionalProperties": false + }, + "NetworkId": { + "title": "NetworkId", + "type": "string", + "enum": [ + "testnet", + "mainnet" + ] + }, + "PlutusData": { + "title": "PlutusData", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "title": "PlutusDataList", + "type": "object", + "properties": { + "tag": { + "enum": [ + "list" + ] + }, + "contents": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + } + } + } + }, + { + "title": "PlutusDataConstr", + "type": "object", + "properties": { + "tag": { + "enum": [ + "constr" + ] + }, + "alternative": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "data": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + } + } + } + }, + { + "title": "PlutusDataMap", + "type": "object", + "properties": { + "tag": { + "enum": [ + "map" + ] + }, + "contents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + } + } + } + } + } + }, + { + "title": "PlutusDataInteger", + "type": "object", + "properties": { + "tag": { + "type": "string", + "enum": [ + "integer" + ] + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/BigInt" + } + } + }, + { + "title": "PlutusDataBytes", + "type": "object", + "properties": { + "tag": { + "enum": [ + "bytes" + ] + }, + "value": { + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f])*$" + } + } + } + ] + }, + "UnitInterval": { + "title": "UnitInterval", + "type": "object", + "properties": { + "numerator": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "denominator": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "additionalProperties": false + }, + "Ipv4": { + "title": "Ipv4", + "description": "IPv4 Address", + "type": "string", + "pattern": "^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.){3}(25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)$" + }, + "Ipv6": { + "title": "Ipv6", + "description": "IPv6 address", + "type": "string", + "format": "ipv6" + }, + "DNSName": { + "title": "DNSName", + "type": "string", + "maxLength": 64, + "format": "string64" + }, + "Relay": { + "title": "Relay", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "title": "SingleHostAddr", + "properties": { + "tag": { + "enum": [ + "single_host_addr" + ] + }, + "port": { + "type": "integer", + "maximum": 65535 + }, + "ipv4": { + "$ref": "cardano-babbage.json#/definitions/Ipv4" + }, + "ipv6": { + "$ref": "cardano-babbage.json#/definitions/Ipv6" + } + }, + "required": [ + "tag" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "SingleHostName", + "properties": { + "tag": { + "enum": [ + "single_host_name" + ] + }, + "port": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "dns_name": { + "$ref": "cardano-babbage.json#/definitions/DNSName" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "dns_name" + ] + }, + { + "type": "object", + "title": "MultiHostName", + "properties": { + "tag": { + "enum": [ + "multi_host_name" + ] + }, + "dns_name": { + "$ref": "cardano-babbage.json#/definitions/DNSName" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "dns_name" + ] + } + ] + }, + "VRFKeyHash": { + "title": "VRFKeyHash", + "type": "string", + "description": "blake2b_256 digest of a VRF verification key, encoded as bech32", + "pattern": "^vrf_vkh[02-9ac-hj-np-z]*", + "format": "bech32" + }, + "URL": { + "title": "URL", + "description": "UTF-8 URL string. Maximum size is 64 bytes, but there is no way to express byte length limit in a json-schema (maxLength limits the number of characters)", + "type": "string", + "maxLength": 64, + "format": "string64" + }, + "PoolMetadataHash": { + "title": "PoolMetadataHash", + "description": "Pool Metadata Hash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$" + }, + "PoolMetadata": { + "title": "PoolMetadata", + "type": "object", + "properties": { + "url": { + "$ref": "cardano-babbage.json#/definitions/URL" + }, + "hash": { + "$ref": "cardano-babbage.json#/definitions/PoolMetadataHash" + } + }, + "additionalProperties": false, + "required": [ + "url", + "hash" + ] + }, + "PoolPubKeyHash": { + "title": "PoolPubKeyHash", + "type": "string", + "format": "bech32", + "pattern": "^(pool1)[02-9ac-hj-np-z]*$" + }, + "PoolParams": { + "title": "PoolParams", + "type": "object", + "properties": { + "operator": { + "$ref": "cardano-babbage.json#/definitions/PoolPubKeyHash" + }, + "vrf_keyhash": { + "$ref": "cardano-babbage.json#/definitions/VRFKeyHash" + }, + "pledge": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "cost": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "margin": { + "$ref": "cardano-babbage.json#/definitions/UnitInterval" + }, + "reward_account": { + "$ref": "cardano-babbage.json#/definitions/RewardAddress" + }, + "pool_owners": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Ed25519KeyHash" + } + }, + "relays": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/Relay" + } + }, + "pool_metadata": { + "$ref": "cardano-babbage.json#/definitions/PoolMetadata" + } + }, + "required": [ + "cost", + "margin", + "operator", + "pledge", + "pool_owners", + "relays", + "reward_account", + "vrf_keyhash" + ], + "additionalProperties": false + }, + "GenesisHash": { + "title": "GenesisHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{56}$" + }, + "GenesisDelegateHash": { + "title": "GenesisDelegateHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{56}$" + }, + "MIRPot": { + "title": "MIRPot", + "enum": [ + "reserves", + "treasury" + ] + }, + "MoveInstantaneousRewards": { + "title": "MoveInstantaneousRewards", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "title": "Move Instantaneous Rewards to stake credentials", + "properties": { + "tag": { + "enum": [ + "to_stake_creds" + ] + }, + "pot": { + "$ref": "cardano-babbage.json#/definitions/MIRPot" + }, + "rewards": { + "title": "MIRToStakeCredentials", + "description": "Distribution of rewards", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "$ref": "cardano-babbage.json#/definitions/Credential" + }, + "value": { + "$ref": "cardano-babbage.json#/definitions/Int128" + } + }, + "required": [ + "key", + "value" + ], + "additionalProperties": false + } + } + }, + "additionalProperties": false, + "required": [ + "pot", + "rewards" + ] + }, + { + "type": "object", + "title": "Move Instantaneous Rewards to other Pot (reserves or treasury)", + "properties": { + "tag": { + "enum": [ + "to_other_pot" + ] + }, + "pot": { + "$ref": "cardano-babbage.json#/definitions/MIRPot" + }, + "amount": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + } + }, + "additionalProperties": false, + "required": [ + "pot", + "amount" + ] + } + ] + }, + "Certificate": { + "title": "Certificate", + "type": "object", + "discriminator": { + "propertyName": "tag" + }, + "oneOf": [ + { + "type": "object", + "title": "Stake Registration Certificate", + "properties": { + "tag": { + "enum": [ + "stake_registration" + ] + }, + "credential": { + "$ref": "cardano-babbage.json#/definitions/Credential" + } + }, + "required": [ + "tag", + "credential" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Stake Deregistration Certificate", + "properties": { + "tag": { + "enum": [ + "stake_deregistration" + ] + }, + "credential": { + "$ref": "cardano-babbage.json#/definitions/Credential" + } + }, + "required": [ + "tag", + "credential" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Stake Delegation Certificate", + "properties": { + "tag": { + "enum": [ + "stake_delegation" + ] + }, + "credential": { + "$ref": "cardano-babbage.json#/definitions/Credential" + }, + "pool_keyhash": { + "$ref": "cardano-babbage.json#/definitions/PoolPubKeyHash" + } + }, + "required": [ + "tag", + "credential", + "pool_keyhash" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Pool Registration Certificate", + "properties": { + "tag": { + "enum": [ + "pool_registration" + ] + }, + "pool_params": { + "$ref": "cardano-babbage.json#/definitions/PoolParams" + } + }, + "required": [ + "tag", + "pool_params" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Pool Retirement Certificate", + "properties": { + "tag": { + "type": "string", + "enum": [ + "pool_retirement" + ] + }, + "pool_keyhash": { + "$ref": "cardano-babbage.json#/definitions/PoolPubKeyHash" + }, + "epoch": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + } + }, + "required": [ + "tag", + "pool_keyhash", + "epoch" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Genesis Key Delegation Certificate", + "properties": { + "tag": { + "type": "string", + "enum": [ + "genesis_key_delegation" + ] + }, + "genesis_hash": { + "$ref": "cardano-babbage.json#/definitions/GenesisHash" + }, + "genesis_delegate_hash": { + "$ref": "cardano-babbage.json#/definitions/GenesisDelegateHash" + }, + "vrf_keyhash": { + "$ref": "cardano-babbage.json#/definitions/VRFKeyHash" + } + }, + "required": [ + "tag", + "genesis_hash", + "genesis_delegate_hash", + "vrf_keyhash" + ], + "additionalProperties": false + }, + { + "type": "object", + "title": "Move Instantaneous Rewards Certificate", + "properties": { + "tag": { + "enum": [ + "move_instantaneous_rewards" + ] + }, + "move_instantaneous_rewards": { + "$ref": "cardano-babbage.json#/definitions/MoveInstantaneousRewards" + } + }, + "required": [ + "tag", + "move_instantaneous_rewards" + ], + "additionalProperties": false + } + ] + }, + "Language": { + "title": "Language", + "type": "string", + "enum": [ + "plutus_v1", + "plutus_v2" + ] + }, + "Mint": { + "title": "Mint", + "description": "Minting or burning of assets. A mapping from policy IDs (script hashes) to mappings from asset names to amounts (that can be negative). Allows for duplicate script hash keys.", + "type": "array", + "items": { + "type": "object", + "properties": { + "script_hash": { + "$ref": "cardano-babbage.json#/definitions/ScriptHash" + }, + "assets": { + "type": "array", + "items": { + "title": "Assets", + "type": "object", + "properties": { + "asset_name": { + "$ref": "cardano-babbage.json#/definitions/AssetName" + }, + "amount": { + "$ref": "cardano-babbage.json#/definitions/NonZeroInt64" + } + }, + "required": [ + "asset_name", + "amount" + ], + "additionalProperties": false + } + } + }, + "required": [ + "script_hash", + "assets" + ], + "additionalProperties": false + } + }, + "Ed25519Signature": { + "title": "Ed25519Signature", + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){64}$" + }, + "Ed25519PublicKey": { + "title": "Ed25519PublicKey", + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){32}$" + }, + "BootstrapWitness": { + "title": "BootstrapWitness", + "type": "object", + "properties": { + "attributes": { + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f])*$" + }, + "chain_code": { + "type": "string", + "format": "hex", + "pattern": "^([0-9a-f][0-9a-f]){32}$" + }, + "signature": { + "$ref": "cardano-babbage.json#/definitions/Ed25519Signature" + }, + "vkey": { + "$ref": "cardano-babbage.json#/definitions/Ed25519PublicKey" + } + }, + "required": [ + "attributes", + "chain_code", + "signature", + "vkey" + ], + "additionalProperties": false + }, + "RedeemerTag": { + "title": "RedeemerTag", + "type": "string", + "enum": [ + "spend", + "mint", + "cert", + "reward" + ] + }, + "Redeemer": { + "title": "Redeemer", + "type": "object", + "properties": { + "data": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + }, + "tag": { + "$ref": "cardano-babbage.json#/definitions/RedeemerTag" + }, + "index": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "ex_units": { + "$ref": "cardano-babbage.json#/definitions/ExUnits" + } + }, + "required": [ + "data", + "tag", + "index", + "ex_units" + ], + "additionalProperties": false + }, + "Vkeywitness": { + "title": "Vkeywitness", + "type": "object", + "properties": { + "vkey": { + "$ref": "cardano-babbage.json#/definitions/Ed25519PublicKey" + }, + "signature": { + "$ref": "cardano-babbage.json#/definitions/Ed25519Signature" + } + }, + "required": [ + "vkey", + "signature" + ], + "additionalProperties": false + }, + "TransactionWitnessSet": { + "title": "TransactionWitnessSet", + "type": "object", + "properties": { + "bootstraps": { + "title": "BootstrapWitnesses", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/BootstrapWitness" + } + }, + "native_scripts": { + "title": "NativeScripts", + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/NativeScript" + } + }, + "plutus_data": { + "type": "array", + "title": "PlutusList", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusData" + } + }, + "plutus_scripts": { + "type": "array", + "title": "PlutusScripts", + "items": { + "$ref": "cardano-babbage.json#/definitions/PlutusScript" + } + }, + "redeemers": { + "type": "array", + "title": "Redeemers", + "items": { + "$ref": "cardano-babbage.json#/definitions/Redeemer" + } + }, + "vkeywitnesses": { + "type": "array", + "title": "VkeyWitnesses", + "items": { + "$ref": "cardano-babbage.json#/definitions/Vkeywitness" + } + } + }, + "required": [] + }, + "Transaction": { + "type": "object", + "title": "Transaction", + "properties": { + "auxiliary_data": { + "$ref": "cardano-babbage.json#/definitions/AuxiliaryData" + }, + "body": { + "$ref": "cardano-babbage.json#/definitions/TransactionBody" + }, + "is_valid": { + "type": "boolean" + }, + "witness_set": { + "$ref": "cardano-babbage.json#/definitions/TransactionWitnessSet" + } + }, + "required": [ + "body", + "is_valid", + "witness_set" + ], + "additionalProperties": false + }, + "VRFCert": { + "title": "VRFCert", + "type": "object", + "properties": { + "output": { + "$ref": "cardano-babbage.json#/definitions/ByteString" + }, + "proof": { + "$ref": "cardano-babbage.json#/definitions/ByteString", + "type": "string", + "pattern": "^[0-9a-f]{160}$" + } + }, + "required": [ + "output", + "proof" + ], + "additionalProperties": false + }, + "KESVKey": { + "title": "KESVKey", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$", + "maxLength": 64, + "minLength": 64 + }, + "BlockHash": { + "title": "BlockHash", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$", + "maxLength": 64, + "minLength": 64 + }, + "VRFVKey": { + "title": "VRFVKey", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{64}$", + "maxLength": 64, + "minLength": 64 + }, + "KESSignature": { + "title": "KESSignature", + "type": "string", + "format": "hex", + "pattern": "^[0-9a-f]{896}$", + "maxLength": 896, + "minLength": 896 + }, + "OperationalCert": { + "title": "OperationalCert", + "type": "object", + "properties": { + "hot_vkey": { + "$ref": "cardano-babbage.json#/definitions/KESVKey" + }, + "kes_period": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "sequence_number": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "sigma": { + "$ref": "cardano-babbage.json#/definitions/Ed25519Signature" + } + }, + "required": [ + "hot_vkey", + "kes_period", + "sequence_number", + "sigma" + ], + "additionalProperties": false + }, + "HeaderBody": { + "title": "HeaderBody", + "type": "object", + "properties": { + "block_number": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "slot": { + "$ref": "cardano-babbage.json#/definitions/UInt64" + }, + "prev_hash": { + "$ref": "cardano-babbage.json#/definitions/BlockHash" + }, + "issuer_vkey": { + "$ref": "cardano-babbage.json#/definitions/Ed25519PublicKey" + }, + "vrf_vkey": { + "$ref": "cardano-babbage.json#/definitions/VRFVKey" + }, + "vrf_result": { + "$ref": "cardano-babbage.json#/definitions/VRFCert" + }, + "block_body_size": { + "$ref": "cardano-babbage.json#/definitions/UInt32" + }, + "block_body_hash": { + "$ref": "cardano-babbage.json#/definitions/BlockHash" + }, + "operational_cert": { + "$ref": "cardano-babbage.json#/definitions/OperationalCert" + }, + "protocol_version": { + "$ref": "cardano-babbage.json#/definitions/ProtocolVersion" + } + }, + "additionalProperties": false, + "required": [ + "block_number", + "slot", + "issuer_vkey", + "vrf_vkey", + "vrf_result", + "block_body_size", + "block_body_hash", + "operational_cert", + "protocol_version" + ] + }, + "Header": { + "title": "Header", + "type": "object", + "properties": { + "body_signature": { + "$ref": "cardano-babbage.json#/definitions/KESSignature" + }, + "header_body": { + "$ref": "cardano-babbage.json#/definitions/HeaderBody" + } + }, + "required": [ + "body_signature", + "header_body" + ], + "additionalProperties": false + }, + "Block": { + "title": "Block", + "type": "object", + "properties": { + "auxiliary_data_set": { + "type": "object", + "title": "AuxiliaryDataSet", + "description": "A mapping from transaction indices to AuxiliaryData values", + "patternProperties": { + "^(0|[1-9][0-9]*)$": { + "$ref": "cardano-babbage.json#/definitions/AuxiliaryData" + } + }, + "additionalProperties": false + }, + "header": { + "$ref": "cardano-babbage.json#/definitions/Header" + }, + "invalid_transactions": { + "type": "array", + "items": { + "allOf": [ + { + "title": "TransactionIndex" + }, + { + "$ref": "cardano-babbage.json#/definitions/UInt32" + } + ] + } + }, + "transaction_bodies": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionBody" + } + }, + "transaction_witness_sets": { + "type": "array", + "items": { + "$ref": "cardano-babbage.json#/definitions/TransactionWitnessSet" + } + } + }, + "additionalProperties": false, + "required": [ + "auxiliary_data_set", + "header", + "invalid_transactions", + "transaction_bodies", + "transaction_witness_sets" + ] + } + } +} diff --git a/CIP-0116/changelog.md b/CIP-0116/changelog.md new file mode 100644 index 0000000000..4d8de75a91 --- /dev/null +++ b/CIP-0116/changelog.md @@ -0,0 +1,30 @@ + +# CIP-0116 JSON Schema Changelog + +This document aims to catalog the changes between JSON schemas, to be updated as new eras are added. + +## Chang Hardfork [Babbage](./cardano-babbage.json) -> [Conway](./cardano-conway.json) (2024-xx-xx) + +- [Babbage CDDL (12dc779)](https://github.com/IntersectMBO/cardano-ledger/blob/12dc779d7975cbeb69c7c18c1565964a90f50920/eras/babbage/impl/cddl-files/babbage.cddl) +- [Conway CDDL (xxxxxxx)]() + +### Added + +### Changed + +### Removed + +### Notes + +## xxxx Hardfork [Conway](./cardano-conway.json) -> xxxx (202x-xx-xx) + +- [Conway CDDL (xxxxxxx)]() +- + +### Added + +### Changed + +### Removed + +### Notes