forked from ehanoc/CIPs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write down specification about Plutus contract blueprints. (cardano-f…
…oundation#258) Including meta-schemas and type definitions for existing "builtins" Plutus types.
- Loading branch information
Showing
8 changed files
with
1,050 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Plutus Contract Blueprint - Meta-Schemas | ||
|
||
In these folders you'll find meta JSON-schemas for CIP-0057; Meta-schemas are JSON schemas describing how a Plutus Contract Blueprint should be structured. They also define several common data-types that can be referenced when writing your own specification. | ||
|
||
Schema | Description | ||
--- | --- | ||
[plutus-blueprint.json](./plutus-blueprint.json) | The meta-schema for the blueprint specification document itself | ||
[plutus-blueprint-argument.json](./plutus-blueprint-argument.json) | The meta-schema for blueprints runtime arguments (i.e datums & redeemers) | ||
[plutus-blueprint-parameter.json](./plutus-blueprint-parameter.json) | The meta-schema for blueprints compile-time parameters | ||
[plutus-data.json](./plutus-data.json) | Definitions of the _Plutus Data Schema_ and the various supported keywords | ||
[plutus-builtin.json](./plutus-builtin.json) | Definitions of the Untyped Plutus Core builtin types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://cips.cardano.org/cips/cip57/schemas/plutus-blueprint-argument.json", | ||
"$vocabulary": { | ||
"https://json-schema.org/draft/2020-12/vocab/core": true, | ||
"https://json-schema.org/draft/2020-12/vocab/applicator": true, | ||
"https://json-schema.org/draft/2020-12/vocab/validation": true, | ||
"https://cips.cardano.org/cips/cip57": true | ||
}, | ||
|
||
"type": "object", | ||
"required": ["schema"], | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"purpose": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/$defs/purpose" | ||
}, | ||
{ | ||
"type": "object", | ||
"required": ["oneOf"], | ||
"properties": { | ||
"oneOf": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"$ref": "#/$defs/purpose" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"schema": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "plutus-data.json" | ||
}, | ||
{ | ||
"$ref": "#/$defs/applicator" | ||
} | ||
] | ||
} | ||
}, | ||
|
||
"$defs": { | ||
"purpose": { | ||
"type": "string", | ||
"enum": ["spend", "mint", "withdraw", "publish"] | ||
}, | ||
"applicator": { | ||
"type": "object", | ||
"required": ["oneOf"], | ||
"properties": { | ||
"oneOf": { | ||
"$ref": "#/$defs/schemaArray" | ||
} | ||
} | ||
}, | ||
"schemaArray": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"$ref": "#" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://cips.cardano.org/cips/cip57/schemas/plutus-blueprint-parameter.json", | ||
"$vocabulary": { | ||
"https://json-schema.org/draft/2020-12/vocab/core": true, | ||
"https://json-schema.org/draft/2020-12/vocab/applicator": true, | ||
"https://json-schema.org/draft/2020-12/vocab/validation": true, | ||
"https://cips.cardano.org/cips/cip57": true | ||
}, | ||
|
||
"type": "object", | ||
"required": ["schema"], | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"purpose": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "#/$defs/purpose" | ||
}, | ||
{ | ||
"type": "object", | ||
"required": ["oneOf"], | ||
"properties": { | ||
"oneOf": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"$ref": "#/$defs/purpose" | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"schema": { | ||
"anyOf": [ | ||
{ | ||
"$ref": "plutus-data.json" | ||
}, | ||
{ | ||
"$ref": "plutus-builtin.json" | ||
}, | ||
{ | ||
"$ref": "#/$defs/applicator" | ||
} | ||
] | ||
} | ||
}, | ||
|
||
"$defs": { | ||
"purpose": { | ||
"type": "string", | ||
"enum": ["spend", "mint", "withdraw", "publish"] | ||
}, | ||
"applicator": { | ||
"type": "object", | ||
"required": ["oneOf"], | ||
"properties": { | ||
"oneOf": { | ||
"$ref": "#/$defs/schemaArray" | ||
} | ||
} | ||
}, | ||
"schemaArray": { | ||
"type": "array", | ||
"minItems": 1, | ||
"items": { | ||
"$ref": "#" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://cips.cardano.org/cips/cip57/schemas/plutus-blueprint.json", | ||
"$vocabulary": { | ||
"https://json-schema.org/draft/2020-12/vocab/core": true, | ||
"https://json-schema.org/draft/2020-12/vocab/applicator": true, | ||
"https://json-schema.org/draft/2020-12/vocab/validation": true, | ||
"https://cips.cardano.org/cips/cip57": true | ||
}, | ||
"type": "object", | ||
"required": [ | ||
"preamble", | ||
"validators" | ||
], | ||
"properties": { | ||
"preamble": { | ||
"$ref": "#/$defs/preamble" | ||
}, | ||
"validators": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/$defs/validator" | ||
} | ||
}, | ||
"definitions": { | ||
"type": "object", | ||
"additionalProperties": true | ||
} | ||
}, | ||
"$defs": { | ||
"preamble": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"title", | ||
"version", | ||
"plutusVersion" | ||
], | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"type": "string" | ||
}, | ||
"plutusVersion": { | ||
"type": "string", | ||
"enum": [ "v1", "v2" ] | ||
}, | ||
"license": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"validator": { | ||
"type": "object", | ||
"required": [ | ||
"title", | ||
"redeemer" | ||
], | ||
"properties": { | ||
"title": { | ||
"type": "string" | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"compiledCode": { | ||
"$ref": "#/$defs/compiledCode" | ||
}, | ||
"hash": { | ||
"$ref": "#/$defs/hashDigest" | ||
}, | ||
"datum": { | ||
"$ref": "plutus-blueprint-argument.json" | ||
}, | ||
"redeemer": { | ||
"$ref": "plutus-blueprint-argument.json" | ||
}, | ||
"parameters": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "plutus-blueprint-parameter.json" | ||
} | ||
} | ||
} | ||
}, | ||
"compiledCode": { | ||
"type": "string", | ||
"contentEncoding": "base16", | ||
"description": "A cbor-serialised flat-encoded Plutus script", | ||
"example": "01450100002601" | ||
}, | ||
"hashDigest": { | ||
"type": "string", | ||
"contentEncoding": "base16", | ||
"description": "Blake2b-224 hash digest of the serialised Plutus script, with language tag prefix.", | ||
"minLength": 56, | ||
"maxLength": 56 | ||
} | ||
} | ||
} |
Oops, something went wrong.