Skip to content

Commit bb5506d

Browse files
committed
update to beta.3
1 parent 582074a commit bb5506d

File tree

6 files changed

+47
-82
lines changed

6 files changed

+47
-82
lines changed

Diff for: CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2929

3030
- first release
3131

32-
[Unreleased]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.2...main
33-
[v1.0.0-beta.3]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.1...v1.0.0-beta.2
32+
[Unreleased]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.3...main
33+
[v1.0.0-beta.3]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.2...v1.0.0-beta.3
3434
[v1.0.0-beta.2]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.1...v1.0.0-beta.2
3535
[v1.0.0-beta.1]: https://github.com/stacchain/merkle-tree-stac-extension/tree/v1.0.0-beta.1

Diff for: README.md

+30-29
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Merkle Tree Extension Specification
22

33
- **Title:** Merkle Tree
4-
- **Identifier:** <https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json>
4+
- **Identifier:** <https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json>
55
- **Field Name Prefix:** `merkle`
66
- **Scope:** Item, Collection, Catalog
77
- **Extension [Maturity Classification](https://github.com/radiantearth/stac-spec/tree/master/extensions/README.md#extension-maturity):** Proposal
88
- **Owner**: @jonhealy1
9-
10-
This extension specifies a way to ensure metadata integrity for STAC Items, Collections, and Catalogs by encoding them in a Merkle tree via
11-
hashing. Each STAC object (Item, Collection, or Catalog) is hashed using a hash function (e.g., SHA-256), and this hash is stored in the
12-
object's properties under the `merkle:object_hash` field. Details concerning the methods used for hashing are stored in a separate object
13-
called `merkle:hash_method`. To produce the Merkle root identifier for a Collection or Catalog, the hashes from its child objects are taken
9+
10+
This extension specifies a way to ensure metadata integrity for STAC Items, Collections, and Catalogs by encoding them in a Merkle tree via
11+
hashing. Each STAC object (Item, Collection, or Catalog) is hashed using a hash function (e.g., SHA-256), and this hash is stored in the
12+
object's properties under the `merkle:object_hash` field. Details concerning the methods used for hashing are stored in a separate object
13+
called `merkle:hash_method`. To produce the Merkle root identifier for a Collection or Catalog, the hashes from its child objects are taken
1414
into account. This process ensures the integrity of all STAC objects within the hierarchy.
1515

1616
- **Examples:**
@@ -30,19 +30,19 @@ The fields in the table below can be used in these parts of STAC documents:
3030
- [ ] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections)
3131
- [ ] Links
3232

33-
| Field Name | Type | Description |
34-
| --------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
35-
| `merkle:object_hash` | string | **REQUIRED** in Items, Collections, and Catalogs. A cryptographic hash of the object's metadata, used to verify its integrity. |
33+
| Field Name | Type | Description |
34+
| -------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| `merkle:object_hash` | string | **REQUIRED** in Items, Collections, and Catalogs. A cryptographic hash of the object's metadata, used to verify its integrity. |
3636
| `merkle:hash_method` | [Hash Method Object](#hash-method-object) | **REQUIRED** in Collections and Catalogs. An object describing the method used to compute `merkle:object_hash` and `merkle:root`, including the hash function used, fields included, ordering, and any special considerations. Items inherit this from their parent Collection but may include it if they use a different method. |
37-
| `merkle:root` | string | **REQUIRED** in Collections and Catalogs. The Merkle root hash representing the Collection or Catalog, used to verify the integrity of all underlying objects. |
37+
| `merkle:root` | string | **REQUIRED** in Collections and Catalogs. The Merkle root hash representing the Collection or Catalog, used to verify the integrity of all underlying objects. |
3838

3939
### Additional Field Information
4040

4141
#### `merkle:object_hash`
4242

4343
- **Type:** string
4444
- **Description:** A cryptographic hash of the object's metadata (Item, Collection, or Catalog), computed according to the method specified in
45-
the `merkle:hash_method`. This hash allows users to verify that the object's metadata has not been altered.
45+
the `merkle:hash_method`. This hash allows users to verify that the object's metadata has not been altered.
4646

4747
#### `merkle:hash_method`
4848

@@ -57,25 +57,25 @@ the `merkle:hash_method`. This hash allows users to verify that the object's met
5757
- **Usage:**
5858
- **Collections and Catalogs:** This object is **REQUIRED**.
5959
- **Items:** Items inherit the `merkle:hash_method` from their parent Collection by default. An Item can optionally include its own
60-
`merkle:hash_method` if it uses a different hash method than the Collection.
60+
`merkle:hash_method` if it uses a different hash method than the Collection.
6161

6262
#### `merkle:root`
6363

6464
- **Type:** string
6565
- **Description:** The Merkle root hash representing the Collection or Catalog. It is computed by building a Merkle tree from the `merkle:object_hash`
66-
values of its child objects and, optionally, its own `merkle:object_hash`. This root hash provides a single value that represents the integrity of
67-
all underlying objects.
66+
values of its child objects and, optionally, its own `merkle:object_hash`. This root hash provides a single value that represents the integrity of
67+
all underlying objects.
6868

6969
### Hash Method Object
7070

7171
The `merkle:hash_method` object provides details about the hash computation method used for `merkle:object_hash` and `merkle:root`.
7272

73-
| Field Name | Type | Description |
74-
| ------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75-
| `function` | string | **REQUIRED**. The cryptographic hash function used (e.g., `sha256`, `sha3-256`). |
73+
| Field Name | Type | Description |
74+
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75+
| `function` | string | **REQUIRED**. The cryptographic hash function used (e.g., `sha256`, `sha3-256`). |
7676
| `fields` | \[string\] | **REQUIRED** (for all objects). An array of fields included in the hash computation. Use `"*"` or `"all"` to indicate that all fields are included. For nested fields, dot notation should be used (e.g., `properties.datetime`, `assets.image`). |
77-
| `ordering` | string | **REQUIRED** (for Collections and Catalogs). Describes how the hashes are ordered when building the Merkle tree (e.g., "ascending by hash value"). |
78-
| `description` | string | Optional. Additional details or notes about the hash computation method, such as serialization format or any special considerations. |
77+
| `ordering` | string | **REQUIRED** (for Collections and Catalogs). Describes how the hashes are ordered when building the Merkle tree (e.g., "ascending by hash value"). |
78+
| `description` | string | Optional. Additional details or notes about the hash computation method, such as serialization format or any special considerations. |
7979

8080
## Computing Hashes and Merkle Roots
8181

@@ -101,7 +101,7 @@ The `merkle:hash_method` object provides details about the hash computation meth
101101
- Pairwise hash the ordered hashes, proceeding up the tree until a single hash remains—the `merkle:root`.
102102
4. **Include `merkle:hash_method`:**
103103
- Specify the method used in the Collection's or Catalog's `merkle:hash_method` field, including any details necessary for users
104-
to replicate the process.
104+
to replicate the process.
105105

106106
## Examples
107107

@@ -130,6 +130,7 @@ The `merkle:hash_method` object provides details about the hash computation meth
130130
```
131131

132132
### Collection Example
133+
133134
```jsonc
134135
{
135136
"type": "Collection",
@@ -151,13 +152,12 @@ The `merkle:hash_method` object provides details about the hash computation meth
151152
// ... collection links
152153
],
153154
"license": "proprietary",
154-
"stac_extensions": [
155-
"https://stacchain.github.io/merkle/v1.0.0/schema.json"
156-
]
155+
"stac_extensions": ["https://stacchain.github.io/merkle/v1.0.0/schema.json"]
157156
}
158157
```
159158

160159
### Catalog Example
160+
161161
```jsonc
162162
{
163163
"type": "Catalog",
@@ -182,9 +182,7 @@ The `merkle:hash_method` object provides details about the hash computation meth
182182
"href": "collection-456.json"
183183
}
184184
],
185-
"stac_extensions": [
186-
"https://stacchain.github.io/merkle/v1.0.0/schema.json"
187-
]
185+
"stac_extensions": ["https://stacchain.github.io/merkle/v1.0.0/schema.json"]
188186
}
189187
```
190188

@@ -201,28 +199,31 @@ For contributions, please follow the
201199
[STAC specification contributing guide](https://github.com/radiantearth/stac-spec/blob/master/CONTRIBUTING.md). Instructions
202200
for running tests are copied here for convenience.
203201

204-
**Note:** This extension is currently a proposal and is open for feedback from the STAC community. Your input is valuable to
202+
**Note:** This extension is currently a proposal and is open for feedback from the STAC community. Your input is valuable to
205203
refine and adopt the Merkle Root Extension.
206204

207205
### Running tests
208206

209-
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
207+
The same checks that run as checks on PR's are part of the repository and can be run locally to verify that changes are valid.
210208
To run tests locally, you'll need `npm`, which is a standard part of any [node.js installation](https://nodejs.org/en/download/).
211209

212-
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
210+
First you'll need to install everything with npm once. Just navigate to the root of this repository and on
213211
your command line run:
212+
214213
```bash
215214
npm install
216215
```
217216

218217
Then to check markdown formatting and test the examples against the JSON schema, you can run:
218+
219219
```bash
220220
npm test
221221
```
222222

223223
This will spit out the same texts that you see online, and you can then go and fix your markdown or examples.
224224

225225
If the tests reveal formatting problems with the examples, you can fix them with:
226+
226227
```bash
227228
npm run format-examples
228229
```

Diff for: examples/catalog.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
"id": "catalog-001",
55
"description": "Sample Catalog with Merkle Root",
66
"stac_extensions": [
7-
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json"
7+
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json"
88
],
99
"merkle:object_hash": "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
1010
"merkle:root": "f1e2d3c4b5a67890abcdef1234567890abcdef1234567890abcdef1234567890",
1111
"merkle:hash_method": {
1212
"function": "sha256",
13-
"fields": [
14-
"*"
15-
],
13+
"fields": ["*"],
1614
"ordering": "ascending",
1715
"description": "Computed by including merkle:object_hash values of child objects in ascending order and building the Merkle tree."
1816
},

Diff for: examples/collection.json

+4-18
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"stac_version": "1.1.0",
33
"stac_extensions": [
4-
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json"
4+
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json"
55
],
66
"type": "Collection",
77
"id": "collection-123",
@@ -10,31 +10,17 @@
1010
"license": "Apache-2.0",
1111
"extent": {
1212
"spatial": {
13-
"bbox": [
14-
[
15-
172.9,
16-
1.3,
17-
173,
18-
1.4
19-
]
20-
]
13+
"bbox": [[172.9, 1.3, 173, 1.4]]
2114
},
2215
"temporal": {
23-
"interval": [
24-
[
25-
"2015-06-23T00:00:00Z",
26-
null
27-
]
28-
]
16+
"interval": [["2015-06-23T00:00:00Z", null]]
2917
}
3018
},
3119
"merkle:object_hash": "7890abcdef1234567890abcdef1234567890abcdef1234567890abcdef123456",
3220
"merkle:root": "abc123def4567890abcdef1234567890abcdef1234567890abcdef1234567890",
3321
"merkle:hash_method": {
3422
"function": "sha256",
35-
"fields": [
36-
"*"
37-
],
23+
"fields": ["*"],
3824
"ordering": "ascending",
3925
"description": "Computed by including merkle:object_hash values in ascending order and building the Merkle tree."
4026
},

Diff for: examples/item.json

+7-27
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,20 @@
11
{
22
"stac_version": "1.1.0",
33
"stac_extensions": [
4-
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json"
4+
"https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json"
55
],
66
"type": "Feature",
77
"id": "item-123",
8-
"bbox": [
9-
172.9,
10-
1.3,
11-
173,
12-
1.4
13-
],
8+
"bbox": [172.9, 1.3, 173, 1.4],
149
"geometry": {
1510
"type": "Polygon",
1611
"coordinates": [
1712
[
18-
[
19-
172.9,
20-
1.3
21-
],
22-
[
23-
173,
24-
1.3
25-
],
26-
[
27-
173,
28-
1.4
29-
],
30-
[
31-
172.9,
32-
1.4
33-
],
34-
[
35-
172.9,
36-
1.3
37-
]
13+
[172.9, 1.3],
14+
[173, 1.3],
15+
[173, 1.4],
16+
[172.9, 1.4],
17+
[172.9, 1.3]
3818
]
3919
]
4020
},

Diff for: json-schema/schema.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json#",
3+
"$id": "https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json#",
44
"title": "Merkle Tree Root Extension",
55
"description": "An extension to ensure metadata integrity for STAC Items, Collections, and Catalogs by encoding them in a Merkle tree via hashing.",
66
"oneOf": [
@@ -113,7 +113,7 @@
113113
"stac_extensions": {
114114
"type": "array",
115115
"contains": {
116-
"const": "https://stacchain.github.io/merkle-tree/v1.0.0-beta.2/schema.json"
116+
"const": "https://stacchain.github.io/merkle-tree/v1.0.0-beta.3/schema.json"
117117
}
118118
}
119119
}

0 commit comments

Comments
 (0)