diff --git a/EVES/drafts/EVES-003/eves-003.md b/EVES/drafts/EVES-003/eves-003.md index a516072..2f547e5 100644 --- a/EVES/drafts/EVES-003/eves-003.md +++ b/EVES/drafts/EVES-003/eves-003.md @@ -29,8 +29,8 @@ This EVES addresses the need for clear guidelines to onboard assets and synchron ### 1. Asset Definition -An asset is defined by the [Gaia-X 4 PLC-AAD Manifest Ontology](https://github.com/GAIA-X4PLC-AAD/ontology-management-base/tree/main/manifest/). -The example implementation [here](https://github.com/ASCS-eV/smart-contracts/tree/main/contracts/marketplace/metadata) is based on release v0.1.6 from the [HD-Map Asset Example](https://github.com/GAIA-X4PLC-AAD/hd-map-asset-example). +An asset is defined by the [Gaia-X 4 PLC-AAD Manifest Ontology](https://github.com/ASCS-eV/ontology-management-base/tree/main/manifest). +The example implementation in the 📁 `metadata/` folder is based on release v0.1.8 of the [HD-Map Asset Example](https://github.com/ASCS-eV/hd-map-asset-example/releases/tag/v0.1.8). This EVES references the [Gaia-X Policy Rules Compliance Document (Release 24.11)](https://docs.gaia-x.eu/policy-rules-committee/compliance-document/24.11/). Compatibility with this release is **to be verified** in a future update of this EVES. @@ -107,8 +107,8 @@ The ENVITED-X Data Space implements a three-tiered privacy model: #### CID as the Primary Identifier - The CID of the uploaded `asset.zip` serves as the unique identifier connecting data across all systems. -- The CIDs are signed by the user according to EIP-712. -- An additional UUID MUST be generated pre-mint to link the asset with the ENVITED-X database securely. +- The CIDs MAY be signed by the user according to EIP-712. +- A UUID MUST be generated pre-mint to link the asset with the ENVITED-X database securely. - The DID of the member associated with the user minting the asset MUST be known. #### Pre-Mint Information @@ -120,7 +120,7 @@ If additional non-public information needs to be stored in the database before m The synchronization between the smart contract and the ENVITED-X database relies on: 1. The contract DID (current Ghostnet contract): - `did:tezos:NetXnHfVqm9iesp:KT1XC2fTBNqoafnrhEb7TuToRCzewgbHAhnA` + `did:tezos:NetXnHfVqm9iesp:KT1PCaD2kmgCHy15wQ1gpqZUy9RLxyBVJdTF` 2. Search `CID` of `tzip21_token_metadata.json` in database. 3. Compare if signature on CID is a `user` belonging to the `member` and if member is owner of token. 4. Check: Uniqueness of CID in database. @@ -162,10 +162,10 @@ No retroactive changes to previous assets are required. ## References -1. [Gaia-X 4 PLC-AAD Manifest Ontology](https://github.com/GAIA-X4PLC-AAD/ontology-management-base/tree/main/manifest/) -2. [HD-Map Asset Example](https://github.com/GAIA-X4PLC-AAD/hd-map-asset-example) +1. [Gaia-X 4 PLC-AAD Manifest Ontology](https://github.com/ASCS-eV/ontology-management-base/tree/main/manifest) +2. [HD-Map Asset Example](https://github.com/ASCS-eV/hd-map-asset-example) 3. [Pinata Documentation](https://docs.pinata.cloud/web3/pinning/pinata-metadata#pinataoptions) 4. [RFC 2119: Key Words for Use in RFCs to Indicate Requirement Levels](https://datatracker.ietf.org/doc/html/rfc2119) 5. [Gaia-X Policy Rules Compliance Document (Release 24.11)](https://docs.gaia-x.eu/policy-rules-committee/compliance-document/24.11/) -6. [Reference Implementation](https://github.com/ASCS-eV/smart-contracts/tree/main/contracts/marketplace/metadata) +6. [Reference Implementation](https://github.com/ASCS-eV/smart-contracts/tree/main/contracts/marketplace/) 7. [EIP-712](https://eips.ethereum.org/EIPS/eip-712) diff --git a/EVES/drafts/EVES-003/metadata/Readme.md b/EVES/drafts/EVES-003/metadata/Readme.md new file mode 100644 index 0000000..356494c --- /dev/null +++ b/EVES/drafts/EVES-003/metadata/Readme.md @@ -0,0 +1,63 @@ +# Reference metadata for ENVITED-X Assets + +This folder contains the reference example for the metadata specifications outlined in [EVES-003](../eves-003.md) to demonstrate how metadata is structured ENVITED-X Data Space. + +## File Structure + +📁 `metadata/` + +- 📄 `bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu.zip` + *Example HD map renamed to CID v1.* +- 📄 `tzip21_asset_manifest.json` + *Generated metadata file for IPFS referenced in the TZIP21 token metadata containing remote URLs.* +- 📄 `tzip21_token_metadata-schema.json` + *TZIP21 json schema to validate the token metadata.* +- 📄 `tzip21_token_metadata.json` + *Token metadata for minting assets.* + +The shacles can be found [here](https://github.com/ASCS-eV/hd-map-asset-example/tree/v0.1.8/shacls-and-ontologies/used-shacls): + +📁 `shacls-and-ontologies/used-shacls/` + +- 📄 `manifest_shacl.ttl` + *SHACL file for validating the `manifest.json`.* +- 📄 `domainMetadata_shacl.ttl` + *SHACL file for validating the `domainMetadata.json`.* + +## Key Concepts + +### Gaia-X Compliance + +The metadata files follow the [Gaia-X Policy Rules Compliance Document (Release 24.11)](https://docs.gaia-x.eu/policy-rules-committee/compliance-document/24.11/). Compatibility with this release is a **TODO** in [EVES-003](../eves-003.md). + +### CID-Based Identification + +All assets and metadata files are identified using CID v1, ensuring interoperability and immutability across the IPFS-based ENVITED-X Data Space. + +### TZIP-21 Metadata + +The `tzip21_asset_manifest.json` and `tzip21_token_metadata.json` demonstrate the mapping of asset information to TZIP-21 token metadata standards, as detailed in [EVES-003](../eves-003.md). + +## How to Use This Reference Implementation + +1. **Validate Metadata**: + - Use the referenced SHACL files in the `shacls-and-ontologies/used-shacls/` folder to validate `manifest.json` and `domainMetadata.json`. + - Ensure all required files and URLs referenced in the manifest are accessible. + +2. **Prepare Metadata for IPFS**: + - Upload the `tzip21_asset_manifest.json` and associated files to IPFS. + - Convert relative file paths in `manifest.json` to CID-based IPFS URLs using the `tzip21_asset_manifest.json`. + +3. **Integrate with ENVITED-X Data Space**: + - Mint tokens using `tzip21_token_metadata.json`. + +4. **Test and Debug**: + - Compare local CID calculations with those generated by Pinata to ensure consistency. + - Use this implementation as a baseline to adapt to your specific asset requirements. + +## Related Documentation + +- [EVES-003: ENVITED Asset Definition and Upload Process](../eves-003.md) +- [Gaia-X 4 PLC-AAD Manifest Ontology](https://github.com/ASCS-eV/ontology-management-base/tree/main/manifest) +- [Pinata Documentation: Pinning CIDs](https://docs.pinata.cloud/web3/pinning/pinata-metadata#pinataoptions) +- [TZIP-21 Metadata Standard](https://tzip.tezos.com/proposal/tzip-21/) diff --git a/EVES/drafts/EVES-003/metadata/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu.zip b/EVES/drafts/EVES-003/metadata/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu.zip new file mode 100644 index 0000000..c32adfb Binary files /dev/null and b/EVES/drafts/EVES-003/metadata/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu.zip differ diff --git a/EVES/drafts/EVES-003/metadata/tzip21_asset_manifest.json b/EVES/drafts/EVES-003/metadata/tzip21_asset_manifest.json new file mode 100644 index 0000000..998095b --- /dev/null +++ b/EVES/drafts/EVES-003/metadata/tzip21_asset_manifest.json @@ -0,0 +1,155 @@ +{ + "@context": { + "xsd": "http://www.w3.org/2001/XMLSchema#", + "gx": "https://registry.lab.gaia-x.eu/development/api/trusted-shape-registry/v1/shapes/jsonld/trustframework#", + "skos": "http://www.w3.org/2004/02/skos/core#", + "sh": "http://www.w3.org/ns/shacl#", + "manifest": "https://github.com/GAIA-X4PLC-AAD/ontology-management-base/tree/main/manifest/" + }, + "@id": "urn:uuid:896f0b9d-5626-4ddb-9d28-568f4af63603", + "@type": "manifest:Manifest", + "manifest:data": { + "@type": "manifest:Data", + "manifest:assetData": [ + { + "@type": "manifest:Link", + "manifest:accessRole": "owner", + "manifest:type": "assetData", + "manifest:format": "xodr", + "manifest:path": { + "@value": "https://assets.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu/data/TestfeldNiedersachsen_ALKS_ODR_sample.xodr", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "owner", + "manifest:type": "assetData", + "manifest:format": "xodr", + "manifest:path": { + "@value": "https://assets.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu/data/TestfeldNiedersachsen_ALKS_ODR_sample_offset.xodr", + "@type": "xsd:anyURI" + } + } + ], + "manifest:contentData": [ + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "metadata", + "manifest:format": "json", + "manifest:path": { + "@value": "ipfs://bafkreifsu25wkyq7oecmtam3mguuoov2zmjp6xi3chuf5plajagdjfoule", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "registeredUser", + "manifest:type": "documentation", + "manifest:format": "pdf", + "manifest:path": { + "@value": "https://metadata.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu/documentation/TestfeldNiedersachsen_ALKS_ODR_sample_Documentation.pdf", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "registeredUser", + "manifest:type": "documentation", + "manifest:format": "txt", + "manifest:path": { + "@value": "https://metadata.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu/documentation/TestfeldNiedersachsen_ALKS_ODR_sample_Documentation_stats.txt", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "registeredUser", + "manifest:type": "validation", + "manifest:format": "txt", + "manifest:path": { + "@value": "https://metadata.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu/validation/qcReport.txt", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "visualization", + "manifest:format": "png", + "manifest:path": { + "@value": "ipfs://bafybeief5r2xgciehzhx6c4kbooifsnbjpiifjei36lpi3kzcdmpr2wvue", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "visualization", + "manifest:format": "png", + "manifest:path": { + "@value": "ipfs://bafybeiezbvlzqsawb3dkoie2ka4aawj6kf52prbsnap23q7x4z7j6aufwe", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "visualization", + "manifest:format": "png", + "manifest:path": { + "@value": "ipfs://bafkreidk4peygis2nnxjvvj5s4fl62uw3cglxj3jkavfzn3qffaorrydyi", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "visualization", + "manifest:format": "geojson", + "manifest:path": { + "@value": "ipfs://bafkreigszlzol72wvmge3lnlmjx7z6enkshoxrw6d32kuezgao2hllqbtm", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "visualization", + "manifest:format": "geojson", + "manifest:path": { + "@value": "ipfs://bafkreiakpb3ajhljq6cgwizcyirsk6uz322szaxd6ynmovcwuu5jkx5isa", + "@type": "xsd:anyURI" + } + }, + { + "@type": "manifest:Link", + "manifest:accessRole": "registeredUser", + "manifest:type": "visualization", + "manifest:format": "geojson", + "manifest:path": { + "@value": "ipfs://bafkreia3od7e5yezmp2hv7gduqpv4x4ildseyqj5x5flijitskqojrtrpm", + "@type": "xsd:anyURI" + } + } + ] + }, + "manifest:license": { + "@type": "manifest:License", + "manifest:spdxIdentifier": { + "@value": "MPL-2.0", + "@type": "xsd:string" + }, + "manifest:licenseData": { + "@type": "manifest:Link", + "manifest:accessRole": "publicUser", + "manifest:type": "license", + "manifest:format": "html", + "manifest:path": { + "@value": "https://www.mozilla.org/en-US/MPL/2.0/", + "@type": "xsd:anyURI" + } + } + } +} diff --git a/EVES/drafts/EVES-003/metadata/tzip21_token_metadata-schema.json b/EVES/drafts/EVES-003/metadata/tzip21_token_metadata-schema.json new file mode 100644 index 0000000..c432f41 --- /dev/null +++ b/EVES/drafts/EVES-003/metadata/tzip21_token_metadata-schema.json @@ -0,0 +1,243 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "#/definitions/asset", + "title": "Rich Metadata", + "definitions": { + "asset": { + "type": "object", + "additionalProperties": true, + "properties": { + "description": { + "type": "string", + "description": "General notes, abstracts, or summaries about the contents of an asset." + }, + "minter": { + "type": "string", + "format": "tzaddress", + "description": "The tz address responsible for minting the asset." + }, + "creators": { + "type": "array", + "description": "The primary person, people, or organization(s) responsible for creating the intellectual content of the asset.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "contributors": { + "type": "array", + "description": "The person, people, or organization(s) that have made substantial creative contributions to the asset.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "publishers": { + "type": "array", + "description": "The person, people, or organization(s) primarily responsible for distributing or making the asset available to others in its present form.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "date": { + "type": "string", + "format": "date-time", + "description": "A date associated with the creation or availability of the asset." + }, + "blockLevel": { + "type": "integer", + "description": "Chain block level associated with the creation or availability of the asset." + }, + "type": { + "type": "string", + "description": "A broad definition of the type of content of the asset." + }, + "tags": { + "type": "array", + "description": "A list of tags that describe the subject or content of the asset.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "genres": { + "type": "array", + "description": "A list of genres that describe the subject or content of the asset.", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "language": { + "type": "string", + "format": "https://tools.ietf.org/html/rfc1766", + "description": "The language of the intellectual content of the asset as defined in RFC 1776." + }, + "identifier": { + "type": "string", + "description": "A string or number used to uniquely identify the asset. Ex. URL, URN, UUID, ISBN, etc." + }, + "rights": { + "type": "string", + "description": "A statement about the asset rights." + }, + "rightsUri": { + "type": "string", + "format": "uri-reference", + "description": "Links to a statement of rights." + }, + "artifactUri": { + "type": "string", + "format": "uri-reference", + "description": "A URI to the asset." + }, + "displayUri": { + "type": "string", + "format": "uri-reference", + "description": "A URI to an image of the asset. Used for display purposes." + }, + "thumbnailUri": { + "type": "string", + "format": "uri-reference", + "description": "A URI to an image of the asset for wallets and client applications to have a scaled down image to present to end-users. Reccomened maximum size of 350x350px." + }, + "externalUri": { + "type": "string", + "format": "uri-reference", + "description": "A URI with additional information about the subject or content of the asset." + }, + "isTransferable": { + "type": "boolean", + "description": "All tokens will be transferable by default to allow end-users to send them to other end-users. However, this field exists to serve in special cases where owners will not be able to transfer the token." + }, + "isBooleanAmount": { + "type": "boolean", + "description": "Describes whether an account can have an amount of exactly 0 or 1. (The purpose of this field is for wallets to determine whether or not to display balance information and an amount field when transferring.)" + }, + "shouldPreferSymbol": { + "type": "boolean", + "description": "Allows wallets to decide whether or not a symbol should be displayed in place of a name." + }, + "ttl": { + "type": "integer", + "description": "The maximum amount of time in seconds the asset metadata should be cached." + }, + "formats": { + "type": "array", + "items": { + "$ref": "#/definitions/format" + } + }, + "attributes": { + "type": "array", + "items": { + "$ref": "#/definitions/attribute" + }, + "description": "Custom attributes about the subject or content of the asset." + }, + "assets": { + "type": "array", + "items": { + "$ref": "#/definitions/asset" + }, + "description": "Facilitates the description of collections and other types of resources that contain multiple assets." + } + } + }, + "format": { + "type": "object", + "additionalProperties": false, + "properties": { + "uri": { + "type": "string", + "format": "uri-reference", + "description": "A URI to the asset represented in this format." + }, + "hash": { + "type": "string", + "description": "A checksum hash of the content of the asset in this format." + }, + "mimeType": { + "type": "string", + "description": "Media (MIME) type of the format." + }, + "fileSize": { + "type": "integer", + "description": "Size in bytes of the content of the asset in this format." + }, + "fileName": { + "type": "string", + "description": "Filename for the asset in this format. For display purposes." + }, + "duration": { + "type": "string", + "format": "time", + "description": "Time duration of the content of the asset in this format." + }, + "dimensions": { + "$ref": "#/definitions/dimensions", + "description": "Dimensions of the content of the asset in this format." + }, + "dataRate": { + "$ref": "#/definitions/dataRate", + "description": "Data rate which the content of the asset in this format was captured at." + } + } + }, + "attribute": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "description": "Name of the attribute." + }, + "value": { + "type": "string", + "description": "Value of the attribute." + }, + "type": { + "type": "string", + "description": "Type of the value. To be used for display purposes." + } + }, + "required": [ + "name", + "value" + ] + }, + "dataRate": { + "type": "object", + "additionalProperties": false, + "properties": { + "value": { + "type": "integer" + }, + "unit": { + "type": "string" + } + }, + "required": [ + "unit", + "value" + ] + }, + "dimensions": { + "type": "object", + "additionalProperties": false, + "properties": { + "value": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "required": [ + "unit", + "value" + ] + } + } +} diff --git a/EVES/drafts/EVES-003/metadata/tzip21_token_metadata.json b/EVES/drafts/EVES-003/metadata/tzip21_token_metadata.json new file mode 100644 index 0000000..6e65f22 --- /dev/null +++ b/EVES/drafts/EVES-003/metadata/tzip21_token_metadata.json @@ -0,0 +1,80 @@ +{ + "decimals": 0, + "isBooleanAmount": true, + "name": "TestfeldNiedersachsen_ALKS_ODR_sample", + "description": "simple hdmap example file on Testfeld Niedersachsen for ALKS scenario", + "tags": [ + "GaiaX", + "ASCS", + "ENVITED-X", + "EVES", + "nft", + "ASAM OpenDRIVE 1.6" + ], + "minter": "tz1cZaiTjNSN7x4VZjTQGYBVz4p8eEcVcYkz", + "creators": [ + "Automotive Solution Center for Simulation e.V." + ], + "publishers": [ + "Automotive Solution Center for Simulation e.V.", + "ENVITED-X Data Space" + ], + "date": "2025-02-17T00:00:00+00:00", + "type": "EVES-003 https://github.com/ASCS-eV/EVES", + "rights": "MPL-2.0", + "rightsUri": "https://www.mozilla.org/en-US/MPL/2.0/", + "language": "en", + "artifactUri": "https://assets.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu", + "identifier": "bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu", + "externalUri": "ipfs://bafkreihpprbjqxpsro2byir2zzwnby2cbm7jra5zr73az7dqgbocv6ie3q", + "displayUri": "ipfs://bafybeief5r2xgciehzhx6c4kbooifsnbjpiifjei36lpi3kzcdmpr2wvue", + "formats": [ + { + "uri": "https://assets.envited-x.net/bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu", + "hash": "bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu", + "mimeType": "application/zip", + "fileSize": 3150043, + "fileName": "bafybeidhmknqn4cofjlphtrxpyvruur42t55bfmtcldyb74l2ob22kjjdu.zip" + }, + { + "uri": "ipfs://bafkreihpprbjqxpsro2byir2zzwnby2cbm7jra5zr73az7dqgbocv6ie3q", + "hash": "bafkreihpprbjqxpsro2byir2zzwnby2cbm7jra5zr73az7dqgbocv6ie3q", + "mimeType": "application/json", + "fileSize": 5572, + "fileName": "tzip21_asset_manifest.json" + }, + { + "uri": "ipfs://bafybeief5r2xgciehzhx6c4kbooifsnbjpiifjei36lpi3kzcdmpr2wvue", + "hash": "bafybeief5r2xgciehzhx6c4kbooifsnbjpiifjei36lpi3kzcdmpr2wvue", + "mimeType": "image/png", + "dimensions": { + "value": "1095x850", + "unit": "px" + }, + "fileSize": 2397906, + "fileName": "TestfeldNiedersachsen_ALKS_ODR_sample_01.png" + } + ], + "attributes": [ + { + "name": "de.gaiax4plcaad.ontology-management-base.hdmap.ontology", + "value": "https://github.com/GAIA-X4PLC-AAD/ontology-management-base/blob/main/hdmap/", + "type": "uri" + }, + { + "name": "de.gaiax4plcaad.ontology-management-base.hdmap.metadata", + "value": "ipfs://bafkreifsu25wkyq7oecmtam3mguuoov2zmjp6xi3chuf5plajagdjfoule", + "type": "application/json" + }, + { + "name": "de.gaiax4plcaad.ontology-management-base.manifest.ontology", + "value": "https://github.com/GAIA-X4PLC-AAD/ontology-management-base/blob/main/manifest/", + "type": "uri" + }, + { + "name": "de.gaiax4plcaad.ontology-management-base.manifest.metadata", + "value": "ipfs://bafkreihpprbjqxpsro2byir2zzwnby2cbm7jra5zr73az7dqgbocv6ie3q", + "type": "application/json" + } + ] +}