Skip to main content

withdrawal_request

Function withdrawal_request 

Source
pub fn withdrawal_request(
    sk_user: &SecretKeyUser,
    expiration_date: u32,
    t_type: u8,
) -> Result<(WithdrawalRequest, RequestInfo), CompactEcashError>
Expand description

Generates a withdrawal request for the given user to request a zk-nym credential wallet.

§Arguments

  • sk_user - A reference to the user’s secret key.
  • expiration_date - The expiration date for the withdrawal request.
  • t_type - The type of the ticket book

§Returns

A tuple containing the generated WithdrawalRequest and RequestInfo, or an error if the operation fails.

§Details

The function starts by generating a random, unique wallet secret v and computing the joined commitment for all attributes, including public (expiration date) and private ones (user secret key and wallet secret). It then calculates the commitment hash (joined_commitment_hash) and computes Pedersen commitments for private attributes. A zero-knowledge proof of knowledge is constructed to prove possession of specific attributes.

The resulting WithdrawalRequest includes the commitment hash, joined commitment, commitments for private attributes, and the constructed zero-knowledge proof.

The associated RequestInfo includes information such as commitment hash, commitment opening, openings for private attributes, v, and the expiration date.