Skip to content

Commit 8d75976

Browse files
committed
chore: centralize protocol version metadata
1 parent c399459 commit 8d75976

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

CROSSLINK_INTEGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Crosslink introduces proof-of-stake to Zcash. Validators lock ZEC as collateral,
1010
2. A validator withdraws stake
1111
3. A validator receives a reward
1212

13-
ZAP1 already has event types for these: STAKING_DEPOSIT (0x0A), STAKING_WITHDRAW (0x0B), STAKING_REWARD (0x0C). They're reserved in the spec and implemented in the API as of v3.0.0-draft.
13+
ZAP1 already has event types for these: STAKING_DEPOSIT (0x0A), STAKING_WITHDRAW (0x0B), STAKING_REWARD (0x0C). They're reserved in the spec and implemented in the API as of v3.0.0.
1414

1515
## Event types
1616

ONCHAIN_PROTOCOL.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ONCHAIN_PROTOCOL.md
22

3-
**Specification Version: 3.0.0-draft**
3+
**Specification Version: 3.0.0**
44

5-
**Version:** 2.2.0
5+
**Version:** 3.0.0
66
**Date:** 2026-03-28
77
**Status:** Deployed on Zcash mainnet
88

@@ -379,7 +379,7 @@ The credential profile depends on the proof profile and is not expected to deplo
379379

380380
## Changelog
381381

382-
### 3.0.0-draft (2026-03-31)
382+
### 3.0.0 (2026-03-31)
383383
- Added type byte prefix to leaf hash construction (Section 3)
384384
- Renumbered sections 12-15 to fix gap from removed sections
385385
- Clarified domain separation constants

conformance/openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: ZAP1 Attestation Protocol
44
description: Read-only API for Zcash on-chain attestation discovery, verification, and memo classification.
5-
version: "3.0.0-draft"
5+
version: "3.0.0"
66
license:
77
name: MIT
88
url: https://github.com/Frontier-Compute/zap1/blob/main/LICENSE
@@ -33,13 +33,13 @@ paths:
3333
example: ZAP1
3434
version:
3535
type: string
36-
example: "2.2.0"
36+
example: "3.0.0"
3737
event_types:
3838
type: integer
39-
example: 12
39+
example: 18
4040
deployed_types:
4141
type: integer
42-
example: 9
42+
example: 15
4343
reserved_types:
4444
type: integer
4545
example: 3

src/api.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ pub struct AppState {
6464
pub foreman: Option<Arc<ForemanClient>>,
6565
}
6666

67+
pub const PROTOCOL_VERSION: &str = "3.0.0";
68+
6769
pub fn router(state: AppState) -> Router {
6870
Router::new()
6971
.route("/invoice", post(create_invoice))
@@ -998,7 +1000,7 @@ async fn recent_events(
9981000
async fn protocol_info() -> Json<serde_json::Value> {
9991001
Json(serde_json::json!({
10001002
"protocol": "ZAP1",
1001-
"version": "3.0.0",
1003+
"version": PROTOCOL_VERSION,
10021004
"event_types": 18,
10031005
"deployed_types": 15,
10041006
"reserved_types": 3,

tests/api_integration_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async fn protocol_info_returns_zap1() {
4242
let body = axum::body::to_bytes(resp.into_body(), 10000).await.unwrap();
4343
let json: serde_json::Value = serde_json::from_slice(&body).unwrap();
4444
assert_eq!(json["protocol"], "ZAP1");
45-
assert_eq!(json["version"], "3.0.0");
45+
assert_eq!(json["version"], zap1::api::PROTOCOL_VERSION);
4646
assert_eq!(json["deployed_types"], 15);
4747
}
4848

0 commit comments

Comments
 (0)