@bcts/envelope 1.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +48 -0
- package/README.md +23 -0
- package/dist/index.cjs +2646 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +978 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +978 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.iife.js +2644 -0
- package/dist/index.iife.js.map +1 -0
- package/dist/index.mjs +2552 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +85 -0
- package/src/base/assertion.ts +179 -0
- package/src/base/assertions.ts +304 -0
- package/src/base/cbor.ts +122 -0
- package/src/base/digest.ts +204 -0
- package/src/base/elide.ts +526 -0
- package/src/base/envelope-decodable.ts +229 -0
- package/src/base/envelope-encodable.ts +71 -0
- package/src/base/envelope.ts +790 -0
- package/src/base/error.ts +421 -0
- package/src/base/index.ts +56 -0
- package/src/base/leaf.ts +226 -0
- package/src/base/queries.ts +374 -0
- package/src/base/walk.ts +241 -0
- package/src/base/wrap.ts +72 -0
- package/src/extension/attachment.ts +369 -0
- package/src/extension/compress.ts +293 -0
- package/src/extension/encrypt.ts +379 -0
- package/src/extension/expression.ts +404 -0
- package/src/extension/index.ts +72 -0
- package/src/extension/proof.ts +276 -0
- package/src/extension/recipient.ts +557 -0
- package/src/extension/salt.ts +223 -0
- package/src/extension/signature.ts +463 -0
- package/src/extension/types.ts +222 -0
- package/src/format/diagnostic.ts +116 -0
- package/src/format/hex.ts +25 -0
- package/src/format/index.ts +13 -0
- package/src/format/tree.ts +168 -0
- package/src/index.ts +32 -0
- package/src/utils/index.ts +8 -0
- package/src/utils/string.ts +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Copyright © 2023 Blockchain Commons, LLC
|
|
2
|
+
Copyright © 2025 Leonardo Amoroso Custodio
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
5
|
+
are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
1. Redistributions of source code must retain the above copyright notice,
|
|
8
|
+
this list of conditions and the following disclaimer.
|
|
9
|
+
|
|
10
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
this list of conditions and the following disclaimer in the documentation
|
|
12
|
+
and/or other materials provided with the distribution.
|
|
13
|
+
|
|
14
|
+
Subject to the terms and conditions of this license, each copyright holder and
|
|
15
|
+
contributor hereby grants to those receiving rights under this license a
|
|
16
|
+
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
17
|
+
(except for failure to satisfy the conditions of this license) patent license to
|
|
18
|
+
make, have made, use, offer to sell, sell, import, and otherwise transfer this
|
|
19
|
+
software, where such license applies only to those patent claims, already
|
|
20
|
+
acquired or hereafter acquired, licensable by such copyright holder or
|
|
21
|
+
contributor that are necessarily infringed by:
|
|
22
|
+
|
|
23
|
+
(a) their Contribution(s) (the licensed copyrights of copyright holders and
|
|
24
|
+
non-copyrightable additions of contributors, in source or binary form)
|
|
25
|
+
alone; or
|
|
26
|
+
|
|
27
|
+
(b) combination of their Contribution(s) with the work of authorship to
|
|
28
|
+
which such Contribution(s) was added by such copyright holder or
|
|
29
|
+
contributor, if, at the time the Contribution is added, such addition causes
|
|
30
|
+
such combination to be necessarily infringed. The patent license shall not
|
|
31
|
+
apply to any other combinations which include the Contribution.
|
|
32
|
+
|
|
33
|
+
Except as expressly stated above, no rights or licenses from any copyright
|
|
34
|
+
holder or contributor is granted under this license, whether expressly, by
|
|
35
|
+
implication, estoppel or otherwise.
|
|
36
|
+
|
|
37
|
+
DISCLAIMER
|
|
38
|
+
|
|
39
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
40
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
41
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
42
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
|
|
43
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
44
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
45
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
46
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
|
|
47
|
+
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
48
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Blockchain Commons Gordian Envelope for TypeScript
|
|
2
|
+
|
|
3
|
+
> Disclaimer: This package is under active development and APIs may change.
|
|
4
|
+
|
|
5
|
+
## Introduction
|
|
6
|
+
|
|
7
|
+
[Gordian Envelope](https://www.blockchaincommons.com/introduction/Envelope-Intro/) is a structured format for hierarchical binary data focused on privacy. The TypeScript implementation provides a feature-rich reference implementation.
|
|
8
|
+
|
|
9
|
+
Envelopes are designed to facilitate "smart documents" with a number of unique features:
|
|
10
|
+
|
|
11
|
+
- **Hierarchical structure**: Easy representation of a variety of semantic structures, from simple key-value pairs to complex property graphs
|
|
12
|
+
- **Merkle-like digest tree**: Built-in integrity verification at any level of the structure
|
|
13
|
+
- **Deterministic representation**: Uses CBOR with deterministic encoding rules for consistent serialization
|
|
14
|
+
- **Privacy-focused**: The holder of a document can selectively encrypt or elide specific parts without invalidating the structure, signatures, or digest tree
|
|
15
|
+
- **Progressive trust**: Holders can reveal information incrementally to build trust with verifiers
|
|
16
|
+
|
|
17
|
+
## Specification
|
|
18
|
+
|
|
19
|
+
Gordian Envelope is formally specified in the [IETF Internet Draft](https://datatracker.ietf.org/doc/draft-mcnally-envelope/).
|
|
20
|
+
|
|
21
|
+
## Rust Reference Implementation
|
|
22
|
+
|
|
23
|
+
This TypeScript implementation is based on [bc-envelope-rust](https://github.com/BlockchainCommons/bc-envelope-rust) **v0.39.0** ([commit](https://github.com/BlockchainCommons/bc-envelope-rust/tree/6c1ee07ee25f5edc098cb6e1118c60def880ab26)).
|