zkgroup/api/receipts/
receipt_credential_request.rs

1//
2// Copyright 2021 Signal Messenger, LLC.
3// SPDX-License-Identifier: AGPL-3.0-only
4//
5
6use partial_default::PartialDefault;
7use serde::{Deserialize, Serialize};
8
9use crate::common::serialization::ReservedByte;
10use crate::crypto;
11
12#[derive(Serialize, Deserialize, PartialDefault)]
13pub struct ReceiptCredentialRequest {
14    pub(crate) reserved: ReservedByte,
15    pub(crate) public_key: crypto::receipt_credential_request::PublicKey,
16    pub(crate) ciphertext: crypto::receipt_credential_request::Ciphertext,
17    // Note that unlike ProfileKeyCredentialRequest, we don't have a proof. This is because our only
18    // "blinded" attribute is the receipt serial number, which is just a random number generated by
19    // the client. Whether or not the server is willing to issue a receipt credential doesn't depend
20    // on any properties of that serial number.
21    //
22    // (We could still prove that `public_key` and `ciphertext.D1` were generated according to
23    // zkgroup's "blinding" protocol, but that only helps guarantee that the client will be able to
24    // decrypt the resulting blinded credential and get a valid credential back, and if the client
25    // wants to waste everybody's time by getting the server to issue a credential that it can't
26    // use, so be it.)
27}