Skip to content

Commit 819b314

Browse files
committed
Update READMEs for bootstrap and IETF MTC crates
- bootstrap_mtc_worker: clarifies this implements the older bootstrap experiment (~davidben-09), not the current IETF draft; updates 'signatureless' → 'landmark-relative'; removes stale test-dev.sh steps - bootstrap_mtc_api: new README describing its role as the frozen bootstrap protocol library - ietf_mtc_worker: replaces stale bootstrap copy with accurate description of the plants-02 implementation; lists known limitations (standalone certs, ML-DSA, subtree signing oracle, notBefore/notAfter) - ietf_mtc_api: new README describing the plants-02 wire format components
1 parent 83b70cc commit 819b314

4 files changed

Lines changed: 119 additions & 55 deletions

File tree

crates/bootstrap_mtc_api/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# bootstrap_mtc_api
2+
3+
Core types and logic for the [Bootstrap MTC CA](../bootstrap_mtc_worker/README.md).
4+
5+
This crate implements the bootstrap-specific protocol layer on top of the shared
6+
[`tlog_tiles`](../tlog_tiles/) infrastructure:
7+
8+
- **X.509 bootstrap chain validation** — validates a submitted certificate chain
9+
against a root pool, enforces EKU (`serverAuth`), filters extensions, and
10+
converts the leaf to a `TBSCertificateLogEntry`.
11+
- **`MerkleTreeCertEntry` encoding/decoding** — the binary log entry format
12+
(approximately draft-davidben-tls-merkle-tree-certs-09).
13+
- **`serialize_landmark_relative_cert`** — constructs the landmark-relative MTC
14+
certificate from a sequenced log entry, an inclusion proof, and the subscriber's
15+
SPKI.
16+
- **Landmark sequence** — tracks the active landmark subtrees and their Merkle
17+
roots for inclusion proof generation.
18+
- **Cosigner** — Ed25519-based subtree cosigning over the `mtc-subtree/v1` note
19+
format.
20+
21+
This crate is intentionally frozen at the bootstrap protocol version and will not
22+
be updated to track the IETF draft. For the current IETF draft implementation,
23+
see [`ietf_mtc_api`](../ietf_mtc_api/).
24+
25+
## License
26+
27+
The project is licensed under the [BSD-3-Clause License](./LICENSE).

crates/bootstrap_mtc_worker/README.md

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,53 @@
1-
# Merkle Tree CA Worker
1+
# Bootstrap Merkle Tree CA Worker
22

3-
A Rust implementation of a [Merkle Tree CA](https://github.com/davidben/merkle-tree-certs/) (MTCA) for deployment on [Cloudflare Workers](https://workers.cloudflare.com/).
3+
A Rust implementation of a [Bootstrap MTC CA](https://blog.cloudflare.com/bootstrap-mtc) for deployment on [Cloudflare Workers](https://workers.cloudflare.com/).
44

5-
Much of the API and the internal architecture of the Merkle Tree CA is shared by the [Static CT Log](../ct_worker/README.md). This Worker also implements issuance of Merkle Tree Certificates (MTCs). The issuance API should be considered unstable. For now, its primary purpose is to support an experimental deployment of the MTC specification.
5+
This worker implements an experimental Merkle Tree Certificate CA based on the bootstrap experiment described in the Cloudflare blog post above. It predates the IETF standardisation effort and implements an older version of the protocol (approximately draft-davidben-tls-merkle-tree-certs-09). For a CA tracking the current IETF draft, see [`ietf_mtc_worker`](../ietf_mtc_worker/README.md).
66

7-
## Development
7+
The internal log architecture (Sequencer, Batcher, Cleaner Durable Objects, tiled R2 storage) is shared with the [Static CT Log](../ct_worker/README.md).
88

9-
`node` and `npm` are required to run the Worker locally. First, use `npm` to install `wrangler`:
9+
## How it works
1010

11-
```bash
12-
npm install -g wrangler@latest
13-
```
11+
For every MTC issued, the requester must provide a **bootstrap certificate chain** — a standard X.509 certificate chain with a path to a root trusted by the CA. By default the root store is the intersection of Chrome's and Mozilla's trust stores (sourced from the CCADB). The CA validates the chain, extracts the subject, SPKI, SANs, key usage, and EKU, and logs them as a `TBSCertificateLogEntry`.
12+
13+
Once a landmark interval elapses, the sequencer produces a landmark subtree and the CA can issue **landmark-relative MTC certificates** — DER-encoded X.509 structures whose `signatureValue` encodes a Merkle inclusion proof into the landmark subtree rather than a traditional signature.
1414

15-
Then use `wrangler` to run the Worker locally from this directory:
15+
## Development
16+
17+
Requires `node` and `npm`.
1618

1719
```bash
18-
npx wrangler dev -e=dev
19-
```
20+
# Run locally
21+
npx wrangler -e=dev dev
2022

21-
The Worker doesn't implement a full-blown MTCA. Instead, it implements what we call a **bootstrap MTCA**. For every MTC requested, the requester must provide a **bootstrap certificate**. A bootstrap certificate is a standard X.509 certificate chain that must have a path to a root certificate trusted by `bootstrap_mtc_worker`. By default, the root store used is the intersection of Chrome's and Mozilla's trust stores.
23+
# Reset local state between runs
24+
./reset-dev.sh
25+
```
2226

2327
To test the basic functionality, run the following script from this directory:
2428

2529
```bash
2630
./test-dev.sh
2731
```
2832

29-
This script does the following:
30-
31-
1. Fetch a bootstrap certificate chain.
32-
33-
1. Submit the bootstrap certificate chain to the MTCA running locally.
34-
35-
1. Wait for the next landmark to be minted. The landmark interval is defined in [`config.dev.json`](./config.dev.json).
36-
37-
1. Request the signatureless MTC from the MTCA running locally
33+
This script:
34+
1. Fetches a bootstrap certificate chain.
35+
2. Submits it to the MTCA running locally.
36+
3. Waits for the next landmark (interval defined in [`config.dev.json`](./config.dev.json)).
37+
4. Requests the landmark-relative MTC.
3838

3939
### Overriding the trust store
4040

41-
It may be useful to provide your own roots for testing. To do so:
41+
To test with your own root certificates:
4242

43-
1. Build the Worker with the `"dev-bootstrap-roots"` feature. Note that `wrangler` invokes `cargo` with a custom build script, so the simplest thing to do is to edit the `Cargo.toml` file by adding `"dev-boostrap-roots"` to the default feature set.
43+
1. Add `dev-bootstrap-roots` to the default features in `Cargo.toml`.
44+
2. Append your root certificates (PEM format) to [`dev-bootstrap-roots.pem`](./dev-bootstrap-roots.pem).
4445

45-
1. Append your roots to [`dev-bootstrap-roots.pem`](./dev-bootstrap-roots.pem).
46+
### Integration tests
47+
48+
```bash
49+
BASE_URL=http://localhost:8787 BOOTSTRAP_MTC_LOG_NAME=dev2 cargo test -p integration_tests --test bootstrap_mtc_api
50+
```
4651

4752
## Deployment
4853

crates/ietf_mtc_api/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ietf_mtc_api
2+
3+
Core types and logic for the [IETF Merkle Tree CA Worker](../ietf_mtc_worker/README.md).
4+
5+
This crate implements the IETF draft protocol layer on top of the shared
6+
[`tlog_tiles`](../tlog_tiles/) infrastructure, targeting
7+
[draft-ietf-plants-merkle-tree-certs-02](https://datatracker.ietf.org/doc/draft-ietf-plants-merkle-tree-certs/).
8+
9+
Key components:
10+
11+
- **`AddEntryRequest`**PKCS#10 CSR submission request (base64url-encoded DER,
12+
matching the ACME `finalize` format per RFC 8555 §7.4).
13+
- **`build_pending_entry`** — parses a CSR, extracts subject, SPKI algorithm,
14+
SPKI hash, and SANs, and constructs an `IetfMtcPendingLogEntry`.
15+
- **`TbsCertificateLogEntry`** — the plants-02 wire format: fields encoded as raw
16+
concatenated DER (no outer SEQUENCE wrapper), including the new
17+
`subjectPublicKeyInfoAlgorithm` field.
18+
- **`MerkleTreeCertEntry`** — entry type enum (`NullEntry` / `TbsCertEntry`) with
19+
encode/decode.
20+
- **`serialize_landmark_relative_cert`** — constructs the landmark-relative MTC
21+
certificate from a sequenced log entry, an inclusion proof, and the subscriber's
22+
SPKI.
23+
- **Landmark sequence** — tracks the active landmark subtrees and their Merkle
24+
roots.
25+
- **Cosigner** — Ed25519-based subtree cosigning over the `mtc-subtree/v1` note
26+
format.
27+
28+
For the older bootstrap experiment (draft-davidben-tls-merkle-tree-certs-09),
29+
see [`bootstrap_mtc_api`](../bootstrap_mtc_api/).
30+
31+
## License
32+
33+
The project is licensed under the [BSD-3-Clause License](./LICENSE).

crates/ietf_mtc_worker/README.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
1-
# Merkle Tree CA Worker
1+
# IETF Merkle Tree CA Worker
22

3-
A Rust implementation of a [Merkle Tree CA](https://github.com/davidben/merkle-tree-certs/) (MTCA) for deployment on [Cloudflare Workers](https://workers.cloudflare.com/).
3+
A Rust implementation of an [IETF Merkle Tree Certificate CA](https://github.com/ietf-plants-wg/merkle-tree-certs/) for deployment on [Cloudflare Workers](https://workers.cloudflare.com/).
44

5-
Much of the API and the internal architecture of the Merkle Tree CA is shared by the [Static CT Log](../ct_worker/README.md). This Worker also implements issuance of Merkle Tree Certificates (MTCs). The issuance API should be considered unstable. For now, its primary purpose is to support an experimental deployment of the MTC specification.
5+
This worker implements [draft-ietf-plants-merkle-tree-certs-02](https://datatracker.ietf.org/doc/draft-ietf-plants-merkle-tree-certs/). For the older bootstrap experiment, see [`bootstrap_mtc_worker`](../bootstrap_mtc_worker/README.md).
66

7-
## Development
8-
9-
`node` and `npm` are required to run the Worker locally. First, use `npm` to install `wrangler`:
7+
The internal log architecture (Sequencer, Batcher, Cleaner Durable Objects, tiled R2 storage) is shared with the [Static CT Log](../ct_worker/README.md).
108

11-
```bash
12-
npm install -g wrangler@latest
13-
```
9+
## How it works
1410

15-
Then use `wrangler` to run the Worker locally from this directory:
11+
Subscribers submit a PKCS#10 CSR (base64url-encoded, no padding) to the `add-entry` endpoint, matching the ACME `finalize` format (RFC 8555 §7.4). The CA extracts the subject, SPKI, and SANs from the CSR and logs them as a `TBSCertificateLogEntry`. The validity window is set server-side to `[now, now + max_certificate_lifetime_secs]`.
1612

17-
```bash
18-
npx wrangler dev -e=dev
19-
```
20-
21-
The Worker doesn't implement a full-blown MTCA. Instead, it implements what we call a **bootstrap MTCA**. For every MTC requested, the requester must provide a **bootstrap certificate**. A bootstrap certificate is a standard X.509 certificate chain that must have a path to a root certificate trusted by `bootstrap_mtc_worker`. By default, the root store used is the intersection of Chrome's and Mozilla's trust stores.
22-
23-
To test the basic functionality, run the following script from this directory:
24-
25-
```bash
26-
./test-dev.sh
27-
```
13+
Once a landmark interval elapses, the sequencer produces a landmark subtree and the CA can issue **landmark-relative MTC certificates** — DER-encoded X.509 structures whose `signatureValue` encodes a Merkle inclusion proof into the landmark subtree rather than a traditional signature.
2814

29-
This script does the following:
15+
## Known limitations
3016

31-
1. Fetch a bootstrap certificate chain.
17+
- Standalone certificates (with cosignatures in the `signatures` field) are not yet implemented.
18+
- ML-DSA signing is not yet implemented.
19+
- The subtree signing oracle (for external cosigners) is not yet implemented.
20+
- ACME order `notBefore`/`notAfter` fields are not currently supported.
3221

33-
1. Submit the bootstrap certificate chain to the MTCA running locally.
34-
35-
1. Wait for the next landmark to be minted. The landmark interval is defined in [`config.dev.json`](./config.dev.json).
22+
## Development
3623

37-
1. Request the signatureless MTC from the MTCA running locally
24+
Requires `node` and `npm`.
3825

39-
### Overriding the trust store
26+
```bash
27+
# Run locally
28+
npx wrangler -e=dev dev
4029

41-
It may be useful to provide your own roots for testing. To do so:
30+
# Reset local state between runs
31+
./reset-dev.sh
32+
```
4233

43-
1. Build the Worker with the `"dev-bootstrap-roots"` feature. Note that `wrangler` invokes `cargo` with a custom build script, so the simplest thing to do is to edit the `Cargo.toml` file by adding `"dev-boostrap-roots"` to the default feature set.
34+
### Integration tests
4435

45-
1. Append your roots to [`dev-bootstrap-roots.pem`](./dev-bootstrap-roots.pem).
36+
```bash
37+
BASE_URL=http://localhost:8787 IETF_MTC_LOG_NAME=dev2 cargo test -p integration_tests --test ietf_mtc_api
38+
```
4639

4740
## Deployment
4841

4942
See the [`ct_worker` documentation](../ct_worker/README.md#deployment-to-a-custom-domain) for deployment to a custom domain.
5043

44+
The production environment is `prod` (maps to `config.prod.json`):
45+
46+
```bash
47+
npx wrangler -e=prod deploy
48+
```
49+
5150
## License
5251

5352
The project is licensed under the [BSD-3-Clause License](./LICENSE).

0 commit comments

Comments
 (0)