# Gordian Envelope ## Abstract The Gordian Envelope, developed by Blockchain Commons, offers a sophisticated smart document architecture to enhance and secure private data management, particularly emphasizing hashed data elision. This privacy-centric feature enables provable data redaction without compromising data integrity or authenticity, aligning closely with global data protection laws that advocate for data minimization and the protection of individual privacy, by allowing users to manage data exposure incrementally as trust develops over time. Gordian Envelope is also designed to handle a variety of structured data formats. The architecture uses a recursive structure capable of encapsulating multiple envelopes, thereby enabling complex data hierarchies and solutions while maintaining the integrity, authenticity, and privacy of data. Deterministic CBOR (dCBOR) then ensures consistent data encoding across multiple languages and platforms, crucial for maintaining data integrity in distributed systems and constrained computing environments. This uniformity is essential for ensuring reliable data verification and authentication, addressing common challenges in data interchange and storage, and supporting decentralized applications. In practical applications, the Gordian Envelope is utilized in sectors where data security and privacy are critical. In the healthcare industry, it is used to manage patient information securely, complying with HIPAA regulations. Financial institutions leverage it for secure transactions and compliance reporting, and educational institutions use it to maintain the integrity of digital credentials. Additionally, wallet developers deploy Gordian Envelope to enhance the security and privacy of digital wallets, to ensure robust protection for users' digital identities and assets. Blockchain Commons supports this technology with a robust developer community, providing specification, updates to code libraries, documentation, and tools necessary for developers to effectively integrate and deploy Gordian Envelope solutions. This proactive support promotes a collaborative ecosystem that enhances the architecture's adoption and demonstrates its practical deployment and relevance in today's digital landscape. ## Executive Summary Gordian Envelope, a Blockchain Commons initiative, is an advanced smart document architecture designed to enhance secure and privacy-preserving data storage and transmission. This is achieved through structured data and hashing that provides any holder the flexibility to redact data as needed. Hashed data elision is the foundation that enables provable data redaction without compromising integrity or authenticity. The core specification employs the well-established quantum-resistant SHA-256 algorithm to build structured Merkle trees, ensuring robust and cryptographically secure data. Gordian Envelope enables several approaches for holder-initiated elision, to provide fine-grained control over data exposure. Signatures maintain their consistency and verifiability even after redaction, as they are computed across the structured trees of hashes, rather than the original data. The elision capability of Gordian Envelope is essential for complying with global data protection regulations for data minimization, while supporting individual privacy and human rights. The design promotes a progressive trust architecture, which not only facilitates phased information sharing but also adapts to evolving trust levels, enabling data holders to dynamically control the visibility of their information based on interaction and perceived risk. Leveraging this architecture supports minimal initial data disclosure with structured options to expand transparency as trust or the relationship matures over time. By enabling holders to manage their data revelation progressively, this architecture not only enhances privacy and security but also bolsters user autonomy, thereby cultivating more organic and adaptable trust across interactions. The Gordian Envelope architecture supports a wide range of data structures, from various relational hierarchical structures, simple linked lists, or node or edge-labeled graphs, to accommodate complex data relationships. Its nested recursive structure can reference and encapsulate other Envelopes, enabling more complex data structures and scenarios. Gordian Envelope offers schema flexibility—no schema is required, allowing for enhanced adaptability and ease of use, yet supports formal schemas when necessary for specific data integrity needs or regulatory compliance. Consistent data encoding is guaranteed across diverse platforms using dCBOR (Deterministic CBOR), available in multi-platform code libraries written in security-conscious Rust, mobile-optimized Swift, server-centric Ruby, and web-optimized Typescript, each ensuring uniformity even on constrained or low-powered hardware. This reliability is crucial in heterogeneous environments such as distributed systems and blockchain applications, where consistent integrity and authentication are required to verify and authenticate data across different languages and platforms. Gordian Envelope is engineered to be cryptographically agnostic, adept at integrating both current and emerging encryption standards, and thus adaptable to varying trust levels and security requirements. This includes using multiple permits such as symmetric keys, public-private key pairs, and advanced cryptographic techniques such as secret sharing, bolstered by support of proof of inclusion for herd privacy, as well as support for emerging quantum-resistant algorithms, each allowing diverse security configuration tailored to specific scenarios. Employing multiple decorrelation approaches, including salting and emerging zero-knowledge proofs, Gordian Envelope prevents unintended data correlation, thereby enhancing data confidentiality and privacy within the Envelope. This flexibility is ensured by architecture's structured and layered design for data security and verifiability, engineered to seamlessly adopt new cryptographic standards as they emerge. Gordian Envelope is a key component of Blockchain Commons' broader Gordian Architecture and is advanced through collaborations with the IETF and W3C, aiming to establish it as a foundation for standardized secure digital architectures that can adapt to evolving cryptographic landscapes. This larger architecture introduces a range of optional enhancements to Gordian Envelope. Envelope data can be stored in a variety of ways. Data compression optimizes storage and transmission without compromising integrity and verifiability, while selective encryption secures partial or entire contents of an Envelope. Additionally, the Gordian Architecture is designed to support advanced cryptographic solutions, including secret sharing, quorum threshold schemes, and multisig cryptography, to expand beyond basic signing and encryption. Gordian Envelope is further engineered to accommodate zero-knowledge proofs for enhanced cryptographic privacy. Data can also be dynamic in both what it does and how it changes over time. Proof-of-inclusion, differencing, and merging tools for Gordian Envelope facilitate the auditing and integration of data changes over time, optimizing storage and streamlining data integration. There is support for an expression language with application-specific logic within Envelopes. A sealed transaction protocol employs Envelope expressions to support encrypted and authenticated communications across potentially insecure channels such as QR codes and NFC, ensuring secure data exchanges even in vulnerable environments. The Gordian Architecture additionally supports a wide variety of forward-looking technologies. A sealed transaction protocol employs Envelope expressions to support encrypted and authenticated communications across potentially insecure channels such as QR codes and NFC (Near-Field Communication) cards. The architecture is also designed to operate efficiently in resource-constrained environments, including low-power devices, embedded systems, and IoT. Gordian Envelope significantly enhances data security and privacy across numerous industry sectors. In the healthcare industry, it ensures the secure handling and sharing of patient information, compliant with privacy regulations like HIPAA. Financial institutions can leverage its robust capabilities for secure transactions and compliance reporting. The technology excels in managing digital credentials by offering secure issuance and privacy-preserving verification processes that adapt based on the holder's and verifier's trust levels. More specifically, Gordian Envelope was also designed to support self-sovereign identity management by allowing individuals and organizations to control their digital identities without reliance on a central authority. Gordian Envelope also supports use cases in supply chain transparency, data provenance in scientific research and AI models, and the integrity of software releases. In the realm of digital media, Gordian Envelope safeguards journalistic integrity by verifying the source and authenticity of news content, thus combating misinformation and bolstering public trust in media outlets. Blockchain Commons' Gordian Envelope is actively deployed today by developers to create the next generation of secure, privacy-centric digital wallets. Its application in real-world scenarios, where security and privacy are paramount, demonstrates its effectiveness. By integrating Gordian Envelope, developers are able to significantly enhance the resilience and privacy of digital wallets, crucial for protecting users' digital identities and assets. This practical deployment positions Gordian Envelope as a leading choice in the competitive field of cryptographic security solutions, underlining its role in safeguarding privacy and bolstering human rights. Blockchain Commons actively supports the Gordian Envelope by positioning it as a leading cryptographic security tool, essential for enhancing privacy and protecting human rights. The organization drives continuous improvement and open development of the Gordian Envelope specification, libraries, and reference applications through robust collaboration with the developer community and key standards organizations like the IETF and W3C. By hosting monthly meetings and specialized roundtable events, Blockchain Commons facilitates a proactive planning process for enhancements, ensuring the Gordian Envelope remains responsive to the evolving challenges within the industry. These collaborative efforts help to foster an ecosystem where security innovations can thrive, aligning with the latest in cryptographic practices and industry needs. Gordian Envelope is a future-proof technology that readily adapts to evolving technological needs and supports a broad spectrum of applications, from securing data at rest to digital asset management and secure communications, making it an indispensable tool for developers seeking robust, flexible, and secure data architecture solutions. ## Features & Benefits of Gordian Envelope ### Architectural and Structural Design - **Supports Elision as a Basic Best Practice**: - Elision is a technique that offers provable redaction, while maintaining data integrity and authenticity. - This technique aligns with data minimization principles and is critical for protecting individual privacy and human rights, and compliance with global data protection regulations. - **Flexible Data Structures** - Supports a comprehensive range of data formats from relational hierarchical structures, simple linked lists, or node or edge-labeled graphs, and thus accommodate complex data relationships and ensuring adaptability across different use cases. - Nested recursive design allows for encapsulation of other envelopes, facilitating complex data scenarios and nested structures. - ** Schema Flexibility - Structures do not require formal schemas, enhancing adaptability and ease of use. - Capable of supporting formal schemas when needed for specific regulatory compliance or data integrity requirements. - **Data Integrity and Control** - Incorporates foundational practices for data redaction and phased information sharing, supporting compliance with global data protection laws and individual privacy. - Enables nested and complex data relationships with rich semantic metadata, allowing for scalability and adaptability in data management. - **Deterministic Data Encoding** - Employs dCBOR for deterministic encoding to ensure uniform data representation across different platforms and applications, crucial for data integrity in distributed systems. ### Privacy Enhancements and Data Management - **Provable Data Redaction** - Utilizes hashed data elision to enable provable redaction without losing data integrity, supporting auditability and verifiability. - Allows for holder-initiated elision, providing users with the autonomy to manage their data exposure based on personal or business risk. - **Data Optimization and Management Techniques** - Features data compression and advanced differencing/merging tools that enhance data management by optimizing storage and streamlining data integration. - Implements advanced decorrelation techniques, including zero-knowledge proofs, to prevent unintended data correlation, thereby securing data confidentiality and enhancing privacy. ### Cryptography and Data Security - **Robust Encryption and Signing Mechanisms** - Supports extensive encryption capabilities, including full or partial application of both public key and symmetric encryption, complemented by embedded and detached signatures for enhanced data security. - **Advanced Cryptographic Features** - Cryptographically agnostic framework capable of integrating both current and emerging encryption standards, including quantum-resistant approaches. - Incorporates flexible permission systems for enhanced security, allowing data access through multiple permits such as symmetric keys, public-private key pairs, and advanced cryptographic techniques like secret sharing, to meet diverse security requirements and adapt to various cryptographic landscapes. ### Enhanced Functionality and Support - **Dynamic Data Handling and Communication** - Supports dynamic data handling through an expression language that allows for the implementation of application-specific logic within envelopes, facilitating responsive and adaptive data interactions. - Implements sealed transaction protocols to support encrypted and authenticated communications across insecure channels, such as QR codes and NFC, ensuring secure data exchanges even in vulnerable environments. - **Resilient Data Backup and Security Protocols** - Enhances data resilience through the integration of sharding via secret sharing and advanced multisig schemes, ensuring robust data backup and recovery processes. ### Use Cases Across Industries - **Healthcare, Finance, and More** - Provides robust solutions for the secure handling and sharing of sensitive information, ensuring compliance with industry-specific regulations such as HIPAA in healthcare and stringent security requirements in finance. - **Supply Chain, Software Integrity, and Digital Identity** - Facilitates transparency and integrity in supply chains, supports the maintenance of software release integrity, and enables comprehensive self-sovereign identity management, promoting autonomy and reducing reliance on centralized authorities. ### Blockchain Commons Support and Industry Applications - **Community Engagement and Development Support** - Actively promotes community engagement through regular meetings and specialized roundtable discussions, driving continuous improvement and fostering a collaborative environment for industry adaptation. - Offers extensive development support with libraries available in multiple programming languages, ensuring that developers have the tools they need to implement Gordian Envelope effectively across various platforms and applications. ## Links - Top Level Pages - [Blockchain Commons Home](https://www.BlockchainCommons.com) - [Blockchain Commons Advocacy Home](https://advocacy.BlockchainCommons.com) - [Blockchain Commons Smart Custody Home](https://smartcustody.BlockchainCommons.com) - [Blockchain Commons Developer Home](https://developer.BlockchainCommons.com) - [Gordian Envelope Home Page](https://developer.blockchaincommons.com/envelope/) - [dCBOR Home Page](https://developer.blockchaincommons.com/dcbor/) - [Blockchain Commons Community on GitHub](https://github.com/BlockchainCommons) - [Gordian Architecture GitHub Root](https://github.com/blockchainCommons/Gordian) - [Gordian Crypto Commons GitHub Root](https://github.com/BlockchainCommons/crypto-commons) - High Level Introductions - [An Introduction to Gordian Envelopes](https://www.blockchaincommons.com/introduction/Envelope-Intro) - [VIDEO: Introduction to Gordian Envelope](https://m.youtube.com/watch?v=OcnpYqHn8NQ) - [The Dangers of Digital Credentials in Education](https://www.blockchaincommons.com/articles/Dangerous-Educational-Credentials/) - [Protecting Your Wellness Data with Hashed Elision](https://www.blockchaincommons.com/articles/Dangerous-Wellness-Data/) - Technical Articles - [A Technical Introduction to Gordian Envelope](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Intro-Tech.md) - [VIDEO: Gordian Envelope CLI - 1 - Commands Overview](https://m.youtube.com/watch?v=K2gFTyjbiYk) - [ANNOTATED TRANSCRIPT: Gordian Envelope CLI - 1 - Commands Overview](https://github.com/BlockchainCommons/envelope-cli-swift/blob/master/Transcripts/1-OVERVIEW-TRANSCRIPT.md) * GitHub Repositories - Libraries & Reference CLI - Gordian Envelope - [BlockchainCommons/bc-envelope-rust](https://github.com/BlockchainCommons/bc-envelope-rust): Rust implementation of Gordian Envelope. - [BlockchainCommons/bc-envelope-cli-rust](https://github.com/BlockchainCommons/bc-envelope-cli-rust)`envelope`: A command line tool for manipulating the Gordian Envelope data type, written in pure Rust. - [BlockchainCommons/BCSwiftEnvelope](https://github.com/BlockchainCommons/BCSwiftEnvelope): Gordian Envelope - Swift Reference Implementation - [BlockchainCommons/envelope-cli-swift](https://github.com/BlockchainCommons/envelope-cli-swift): A command line tool written in Swift used to manipulate the Envelope data type. - dCBOR (deterministic CBOR) - [BlockchainCommons/bc-dcbor-rust](https://github.com/BlockchainCommons/bc-dcbor-rust): Deterministic CBOR ("dCBOR") for Rust. - [BlockchainCommons/bc-dcbor-cli](https://github.com/BlockchainCommons/bc-dcbor-cli): A command line Deterministic CBOR ("dCBOR") validation and diagnostic tool. - [BlockchainCommons/BCSwiftDCBOR](https://github.com/BlockchainCommons/BCSwiftDCBOR): A pure Swift CBOR codec that focuses on writing and parsing "deterministic" CBOR per §4.2 of RFC-8949. - [BlockchainCommons/bc-dcbor-ts](https://github.com/BlockchainCommons/bc-dcbor-ts): Blockchain Commons Deterministic CBOR ("dCBOR") for TypeScript - Documentation - IETF Internet Drafts - [The Gordian Envelope Structured Data Format (draft-mcnally-envelope-07)](https://datatracker.ietf.org/doc/draft-mcnally-envelope/) - [dCBOR: A Deterministic CBOR Application Profile (draft-mcnally-deterministic-cbor-09)](https://datatracker.ietf.org/doc/draft-mcnally-deterministic-cbor/) - [Deterministic Hashed Data Elision: Problem Statement and Areas of Work (draft-appelcline-hashed-elision-00)](https://datatracker.ietf.org/doc/draft-appelcline-hashed-elision/) - Blockchain Commons Research (BCR) re: Envelope - [bcr-2021-002 Digests for Digital Objects]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2021-002-digest.md) - [bcr-2022-001 UR Type Definition for Encrypted Messages]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2022-001-encrypted-message.md) - [bcr-2022-002 ARID: Apparently Random Identifier]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2022-002-arid.md) - [bcr-2023-001 UR Type Definition for Compressed Messages]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-001-compressed-message.md) - [bcr-2023-003 Gordian Envelope Extension: Known Values]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-003-envelope-known-value.md) - [bcr-2023-004 Gordian Envelope Extension: Symmetric Encryption]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-004-envelope-symmetric-encryption.md) - [bcr-2023-005 Gordian Envelope Extension: Compression]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-005-envelope-compression.md) - [bcr-2023-006- Gordian Envelope: Attachments]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-006-envelope-attachment.md) - [bcr-2023-007 Gordian Envelope: Bitcoin Output Descriptors (Version 2)](https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-007-envelope-output-desc.md) - [bcr-2023-008 dCBOR: Preferred Encoding of Dates]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-008-dcbor-date.md) - [bcr-2023-009 Gordian Envelope: Cryptographic Seeds]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-009-envelope-seed.md) - [bcr-2023-012 Gordian Envelope Expressions]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-012-envelope-expression.md) - [bcr-2023-013 Gordian Envelope Cryptography]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-013-envelope-crypto.md) - [bcr-2023-014 Gordian Sealed Transaction Protocol (GSTP)]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-014-gstp.md) - [bcr-2023-018 Gordian Depository API]( https://github.com/BlockchainCommons/Research/blob/master/papers/bcr-2023-018-depo-api.md) - Use Cases - [Gordian Envelope Use Cases Overview](https://developer.blockchaincommons.com/envelope/use-cases/) - [Gordian Envelope Use Cases Summary](https://developer.blockchaincommons.com/envelope/use-cases/summary/) - [Gordian Envelope Use Cases - Introduction](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/README.md) - [Gordian Envelope Use Cases: Data Distribution](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/Data.md) - [Gordian Envelope Use Cases: Financial Industry (including Self-Sovereign Assets)](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/Financial.md) - [Gordian Envelope Use Cases: Software & AI Industry](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/Software.md) - [Gordian Envelope Use Cases: Wellness](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/Wellness.md) * [Gordian Envelope Use Cases: Educational & Credential Industries](https://github.com/BlockchainCommons/Gordian/blob/master/Envelope/Use-Cases/Educational.md) - Other - [DOCUMENTATION:`envelope` Swift Command Line Tool Documentation](https://github.com/BlockchainCommons/envelope-cli-swift/tree/master/Docs) - [ARTICLE: Why CBOR?](https://www.blockchaincommons.com/introduction/Why-CBOR/) - [VIDEO: Gordian Architecture: Why CBOR?](https://m.youtube.com/watch?v=uoD5_Vr6qzw) - [VIDEO: dCBOR (Deterministic CBOR) Library from Blockchain Commons](https://m.youtube.com/watch?v=NlJE8oF1B5M) - [TEST: Envelope Request & Response Test Vectors](https://developer.blockchaincommons.com/envelope/request/vectors/) - [TEST: DCBOR Numeric Reduction Test Vectors](https://hackmd.io/@bc-community/B1aIasXKp) - [VIDEO PLAYLIST: Gordian Envelope](https://m.youtube.com/playlist?list=PLCkrqxOY1FbooYwJ7ZhpJ_QQk8Az1aCnG) === Older version details not incorporated: - **Full or Partial Signing**: Supports both embedded and detached signatures without compromising data integrity or authentication. - **Full or Partial Public Key Encryption**: Applies encryption methods that safeguard the integrity and authenticity of data. - **Full or Partial Symmetric Encryption**: Protects data while maintaining the validity of signatures. - **Rich Semantic Metadata**: Every envelope is a piece of data called its "subject", and a set of assertions (facts) about that subject. But every part of an envelope, including the subject, the assertions, and the parts of the assertions (the "predicates" and "objects") are *themselves* envelopes. Example of elision. Take a simple example envelope with the human-readable string `"Hello"` as the subject: ``` "Hello" ``` The subject can have an assertion added to it that specifies the language in which the string is written: ``` "Hello" [ 'language': "en" ] ``` The predicate (`'language'`) could itself bear an assertion specifying the ontology that defines it: ``` "Hello" [ 'language' [ 'ontology': "Dublin Core" ]: "en" ] ``` The subject is the same, but we're adding more detailed metadata. This rich "metadata on metadata" can continue recursively as necessary or desired for a given application. When transmitted to another party, any part of an envelope can be elided without disturbing its digest tree (invalidating signatures). So if our envelope above was signed, it would look like this: ``` { "Hello" [ 'language' [ 'ontology': "Dublin Core" ]: "en" ] } [ 'verifiedBy': Signature ] ``` In the envelope above, the subject is now the original envelope wrapped into a single envelope, and then signed. We can now elide parts of the inner envelope, such as the ontology assertion, without invalidating the signature: ``` { "Hello" [ 'language' [ ELIDED ]: "en" ] } [ 'verifiedBy': Signature ] ``` Or we can elide the entire language assertion: again, without invalidating the signature: ``` { "Hello" [ ELIDED ] } [ 'verifiedBy': Signature ] ``` We can even elide the entire signed envelope, and still be able to prove that we have *something* that has been signed. This is a cryptographic commitment to parts of the envelope's content we may choose to reveal at some point in the future: ``` ELIDED [ 'verifiedBy': Signature ] ``` === I did a little work on how a simple graph could be represented using Envelope: ``` "id:graph" [ 'node': "id:john" [ 'isA': 'foaf:person' 'foaf:name' : "John Doe" 'foaf:age' : 30 'foaf:based_near' : "New York" ] 'node': "id:jane" [ 'isA': 'foaf:person' 'foaf:name' : "Jane Doe" 'foaf:age' : 25 'foat:based_near' : "Los Angeles" ] 'edge': "id:johnKnowsJane": [ 'isA': 'foaf:knows' 'source' : "id:john" 'target' : "id:jane" ] ] ``` Note that the subject of the envelope `"id:graph"` is the identifier for the graph as a whole. A graph is a set of nodes and edges, and these are represented by the `'node'` and `'edge'` assertions. The object of each assertion is an envelope whose subject is the identifier of the object (node or edge). The assertions on this subject are the specific information about the object. In the case of nodes, it is information about it from the FOAF (Friend-Of-A-Friend) ontology. In the case of edges, it specifies the source and target ID of the edge, and the relationship specified by the edge. In this example I used human-readable strings as IDs, but they could be ARIDs or anything else. I've used known values for everything else except literal strings and numbers. Note that by extracting the object of any `node` assertion, you have a complete envelope with all the information about the object in question. Of course, if your system knows how to look up IDs as in the example, your envelope just containing the graph structure could be: ``` "id:graph" [ 'node': "id:john" 'node': "id:jane" 'edge': "id:johnKnowsJane": [ 'source' : "id:john" 'target' : "id:jane" ] ] ``` You could also collapse explicit edges into the nodes: ``` "id:graph" [ 'node': "id:john" [ 'isA': 'foaf:person' 'foaf:name' : "John Doe" 'foaf:age' : 30 'foaf:based_near' : "New York" 'foaf:knows': "id:jane" ] 'node': "id:jane" [ 'isA': 'foaf:person' 'foaf:name' : "Jane Doe" 'foaf:age' : 25 'foaf:based_near' : "Los Angeles" 'foaf:knows': "id:john" ] ] ``` In this case, there are two `knows` edges: one from John to Jane, and one to Jane from John. You could also collapse explicit nodes into edges: ``` "id:graph" [ 'edge': "id:johnKnowsJane": [ 'isA': 'foaf:knows' 'source' : "id:john" [ 'isA': 'foaf:person' 'foaf:name' : "John Doe" 'foaf:age' : 30 'foaf:based_near' : "New York" ] 'target' : "id:jane" [ 'isA': 'foaf:person' 'foaf:name' : "Jane Doe" 'foaf:age' : 25 'foat:based_near' : "Los Angeles" ] ] ] ``` Of course, if you want the bidirectional relationship, you'd have to add another edge: ``` "id:graph" [ 'edge': "id:johnKnowsJane": [ 'isA': 'foaf:knows' 'source' : "id:john" [ 'isA': 'foaf:person' 'foaf:name' : "John Doe" 'foaf:age' : 30 'foaf:based_near' : "New York" ] 'target' : "id:jane" [ 'isA': 'foaf:person' 'foaf:name' : "Jane Doe" 'foaf:age' : 25 'foat:based_near' : "Los Angeles" ] ] 'edge': "id:janeKnowsJohn": [ 'isA': 'foaf:knows' 'source' : "id:jane" 'target' : "id:john" ] ] ``` I also just realized that you can make all these versions completely isomorphic if you preserve the IDs of the nodes and edges using metadata: ``` "id:graph" [ 'node': "id:john" [ 'isA': 'foaf:person' 'foaf:name' : "John Doe" 'foaf:age' : 30 'foaf:based_near' : "New York" 'foaf:knows' [ 'id': "id:johnKnowsJane" ]: "id:jane" ] 'node': "id:jane" [ 'isA': 'foaf:person' 'foaf:name' : "Jane Doe" 'foaf:age' : 25 'foaf:based_near' : "Los Angeles" 'foaf:knows' [ 'id': "id:janeKnowsJohn" ]: "id:john" ] ] ``` In this case, the `knows` predicates are annotated with the ID of the edge they define. So this example could be considered exactly equivalent to the others (in the semantic sense, not the digest tree sense). In fact, you *could* compare them for digest tree equivalence by transforming any of the variants above into the "canonical" version where each node is a single `node` assertion and each edge is a single `edge` assertion, and *then* performing the digest tree comparison. Conclusion: yeah, envelopes can do graphs pretty well. 😊 Claude's thoughts on the above: The conversation has highlighted the versatility and potential of Gordian Envelopes to serve as a general container for graph-based structures, in addition to its primary design as a tree-based structure. Key points from the discussion: 1. Gordian Envelopes can represent various graph structures, including property graphs, semantic triples, and other forms of structured graphs, by leveraging the flexibility of its assertion model. 2. Different graph representations can be achieved within the Envelope structure: - Nodes and edges can be represented explicitly using separate node and edge assertions. - Edges can be collapsed into nodes by including the edge information within the node assertions. - Nodes can be collapsed into edges by embedding the node information within the edge assertions. 3. The choice of representation depends on the specific use case, the desired level of granularity, and the trade-offs between storage space and computational complexity. 4. By preserving the IDs of nodes and edges using metadata, different graph representations can be made isomorphic, ensuring semantic equivalence regardless of the structural representation. 5. Transforming graph representations into a canonical form, where each node and edge is represented by a single assertion, allows for reliable comparison and equivalence checking using digest tree comparisons. 6. The ability to elide specific parts of the graph structure enables privacy-preserving sharing and progressive disclosure of graph data. 7. Gordian Envelopes provide a foundation for extending and adapting graph representations to specific domains or use cases by defining custom predicates, types, and metadata. The exploration of using Gordian Envelopes as a container for graph-based structures opens up exciting possibilities for representing, exchanging, and manipulating graph data in a structured and privacy-preserving manner. The flexibility and extensibility of the Envelope format make it well-suited for accommodating diverse graph structures and enabling interoperability between different graph-based systems. As the Gordian Envelope ecosystem evolves, it will be interesting to see how the graph-based capabilities are further developed and utilized in various applications, such as knowledge representation, data integration, and graph-based analytics. The combination of the tree-based foundation and the graph-based extensions makes Gordian Envelopes a powerful and versatile tool for structured data representation and exchange.