Skip to main content

zlicenser_protocol/message/
receipt.rs

1// Field order is the wire format. Do not reorder without a protocol version bump.
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
6pub struct Receipt {
7    pub payload: ReceiptPayload,
8    #[serde(with = "crate::wire::bytes::sig_bytes")]
9    pub customer_signature: [u8; 64],
10}
11
12#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
13pub struct ReceiptPayload {
14    pub protocol_version: u16,
15    pub receipt_id: [u8; 16],
16    pub grant_id: [u8; 16],
17    pub request_id: [u8; 16],
18    /// BLAKE3 hash of the full canonical LicenseGrant bytes (payload + vendor signature).
19    pub grant_hash: [u8; 32],
20    pub customer_public_key: [u8; 32],
21    pub acknowledged_at: u64,
22}