From 4c239063e29d3f33287e3923f63f2217ad62ebe4 Mon Sep 17 00:00:00 2001 From: swrup Date: Tue, 7 Oct 2025 12:02:05 +0200 Subject: [PATCH] --- src/binary_formats.ml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/binary_formats.ml b/src/binary_formats.ml index d5adf7a7..fd9cafe2 100644 --- a/src/binary_formats.ml +++ b/src/binary_formats.ml @@ -468,3 +468,33 @@ module Withdraw_request_ps = struct |+ field Age_mask.bin (fun t -> t.mask) |> sealr end + +module Withdraw_confirmation_ps = struct + type t = { + (* Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_WITHDRAW. + Signed by a `struct TALER_ExchangePrivateKeyP` using EdDSA. *) + purpose: Ecc_signature_purpose.t; + (* Commitment made in the /withdraw request. + Also needed for the /reveal-withdraw endpoint (in case + of required proof of age restriction) and for /recoup *) + (* TODO TALER doc + missing TALER_HashBlindedPlanchetsP*) + h_planchets: Hash_planchets_p.t; + (* If proof of age restriction is not required for to this + withdrawal, (i.e. max_age was not set during the request) + MUST be 0xFFFFFFFF. + Otherwise (i.e. proof of age restriction required): + index that the client will not have to reveal, in NBO, + MUST be smaller than #TALER_CNC_KAPPA. *) + noreveal_index: int32; + } + + let bin = + let open Bin in + record (fun purpose h_planchets noreveal_index -> + { purpose; h_planchets; noreveal_index }) + |+ field Ecc_signature_purpose.bin (fun t -> t.purpose) + |+ field Hash_planchets_p.bin (fun t -> t.h_planchets) + |+ field beint32 (fun t -> t.noreveal_index) + |> sealr +end