From de9f1810440705989cf79bffcea42adae92eedb4 Mon Sep 17 00:00:00 2001 From: Ignat Zapolsky Date: Thu, 9 Jan 2025 12:25:42 +0000 Subject: [PATCH 1/3] Added VIP 243. --- .idea/.gitignore | 8 ++++ .idea/misc.xml | 6 +++ .idea/vcs.xml | 4 ++ vips/VIP-243.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 vips/VIP-243.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..881e1b3 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..d843f34 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/vips/VIP-243.md b/vips/VIP-243.md new file mode 100644 index 0000000..50a8058 --- /dev/null +++ b/vips/VIP-243.md @@ -0,0 +1,96 @@ +--- +VIP: 243 +Title: Extensible Certificate Payload Types +Description: This VIP proposes to expand certificate payload types to include JSON and YAML formats with optional IPFS CID references. +Author: Ignat Zapolsky +Category: Interface +Status: Draft +CreatedAt: 2025-01-09 +--- + +## Overview + +This VIP proposes an extension to the certificate payload types defined in VIP-192. The extension aims to include JSON and YAML formats with optional Content Identifier (CID) references to JSON schemas stored on IPFS. This enhancement will provide more flexibility and standardization in certificate payloads while maintaining compatibility with existing implementations. + +## Motivation + +The current certificate payload structure, as defined in VIP-192, is limited in its ability to represent complex, structured data with schema validation. By expanding the payload types to include JSON and YAML formats with optional schema references, we can: + +1. Enhance data representation capabilities in certificates +2. Enable schema-based validation for improved data integrity +3. Leverage IPFS for decentralized schema storage and retrieval +4. Maintain backwards compatibility with existing implementations + +## Specification + +We propose to extend the `type` field in the certificate payload to include the following new values: + +1. `application/json+cid=` +2. `application/yaml+cid=` + +The `+cid` part is optional, allowing for flexibility in schema usage. + +### Payload Structure + +The payload structure remains consistent with VIP-192: + +```json +{ + "type": "string", + "content": "string" +} +``` + +### New Type Formats +1. JSON format without schema: + + ```json + { + "type": "application/json", + "content": "{\"key\": \"value\"}" + } + ``` + +2. JSON format with schema: + + ```json + { + "type": "application/json+cid=QmA1b2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0", + "content": "{\"key\": \"value\"}" + } + ``` + +3. YAML format without schema: + + ```json + { + "type": "application/yaml", + "content": "key: value" + } + ``` +4. YAML format with schema: + + ```json + { + "type": "application/yaml+cid=QmA1b2C3D4E5F6G7H8I9J0K1L2M3N4O5P6Q7R8S9T0", + "content": "key: value" + } + ``` + +When a CID is provided, the JSON schema referenced by the CID should be used to validate the content. +The process for retrieving and applying the schema is left to the implementation. +## Rationale + +This extension builds upon the existing certificate structure defined in VIP-192, adding support for more complex data structures and schema validation. +By adding schema capability interested parties (like wallets) are able to display user-friendly information about signed certificate structure. +The use of IPFS for schema storage ensures decentralized access and immutability of schemas. +## Backwards Compatibility +This proposal is backwards compatible with existing implementations of VIP-192. Certificates using the current payload types will continue to function without modification. +## Test Cases +[To be added: Test cases demonstrating the use of new payload types and schema validation] +## Security Considerations +1. Schema Retrieval: Implementations must ensure secure retrieval of schemas from IPFS. +2. Schema Validation: Proper error handling should be implemented for cases where schema validation fails. +3. Content Size: Implementations should consider imposing size limits on payload content to prevent potential DoS attacks. + +Copyright and related rights waived via <./LICENSE.md|CC0>. From f7d10b7d27c73431251ec584c038cd51abf6d52a Mon Sep 17 00:00:00 2001 From: Ignat Zapolsky Date: Thu, 9 Jan 2025 13:23:13 +0000 Subject: [PATCH 2/3] Improvements in documentation and rationale. --- vips/VIP-243.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vips/VIP-243.md b/vips/VIP-243.md index 50a8058..27b5f9f 100644 --- a/vips/VIP-243.md +++ b/vips/VIP-243.md @@ -16,7 +16,9 @@ This VIP proposes an extension to the certificate payload types defined in VIP-1 The current certificate payload structure, as defined in VIP-192, is limited in its ability to represent complex, structured data with schema validation. By expanding the payload types to include JSON and YAML formats with optional schema references, we can: -1. Enhance data representation capabilities in certificates +1. Enhance data representation capabilities in certificates by allowing third parties to have native object rendering which is based on structured content type +2. Allows extensibility and compactness of representation in the future by allowing more `types` +2. Provide future capability to define common semantics by providing reference schema documents 2. Enable schema-based validation for improved data integrity 3. Leverage IPFS for decentralized schema storage and retrieval 4. Maintain backwards compatibility with existing implementations @@ -91,6 +93,7 @@ This proposal is backwards compatible with existing implementations of VIP-192. ## Security Considerations 1. Schema Retrieval: Implementations must ensure secure retrieval of schemas from IPFS. 2. Schema Validation: Proper error handling should be implemented for cases where schema validation fails. +3. Schema: Parties that are parsing schema documents need to be aware of security context and use strict mechanisms to prevent attacks via insecure schema documents. 3. Content Size: Implementations should consider imposing size limits on payload content to prevent potential DoS attacks. Copyright and related rights waived via <./LICENSE.md|CC0>. From 1189f2ea7f741238026f1c7b4727f33a0079b791 Mon Sep 17 00:00:00 2001 From: Ignat Zapolsky Date: Thu, 9 Jan 2025 13:30:27 +0000 Subject: [PATCH 3/3] Added affected parties section. --- vips/VIP-243.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vips/VIP-243.md b/vips/VIP-243.md index 27b5f9f..424563d 100644 --- a/vips/VIP-243.md +++ b/vips/VIP-243.md @@ -96,4 +96,12 @@ This proposal is backwards compatible with existing implementations of VIP-192. 3. Schema: Parties that are parsing schema documents need to be aware of security context and use strict mechanisms to prevent attacks via insecure schema documents. 3. Content Size: Implementations should consider imposing size limits on payload content to prevent potential DoS attacks. +## Affected Parties + +This VIP affects libraries and clients that would like to generate & comprehend certificates, notably: +1. Vechain SDK +2. VeWorld wallet + +This VIP does not affect protocol because identification certificates are not intended for consumption by public / authority nodes. + Copyright and related rights waived via <./LICENSE.md|CC0>.