2026-02-24 17:51:30 +01:00
|
|
|
open Time
|
2026-02-05 17:51:24 +01:00
|
|
|
open Hash
|
2025-12-07 08:03:00 +01:00
|
|
|
|
|
|
|
|
module Aliases = struct
|
2026-02-27 23:36:05 +01:00
|
|
|
module DenominationHash = Crypto.DenominationHash
|
2026-02-05 15:31:49 +01:00
|
|
|
|
2026-02-05 21:19:57 +01:00
|
|
|
(* some of those are actuall ecdhe, or union of eddsa|ecdhe *)
|
2025-12-07 08:03:00 +01:00
|
|
|
open Crypto
|
|
|
|
|
module PursePublicKey = EddsaPublicKey
|
|
|
|
|
module AuditorPublicKeyP = EddsaPublicKey
|
|
|
|
|
module ReservePublicKeyP = EddsaPublicKey
|
|
|
|
|
module MerchantPublicKeyP = EddsaPublicKey
|
|
|
|
|
module TransferPublicKeyP = EddsaPublicKey
|
|
|
|
|
module AmlOfficerPublicKeyP = EddsaPublicKey
|
|
|
|
|
module ExchangePublicKeyP = EddsaPublicKey
|
|
|
|
|
module MasterPublicKeyP = EddsaPublicKey
|
|
|
|
|
module CoinSpendPublicKeyP = EddsaPublicKey
|
|
|
|
|
module TokenPublicKeyP = EddsaPublicKey
|
|
|
|
|
module ReservePrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module MerchantPrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module TransferPrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module AmlOfficerPrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module ExchangePrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module MasterPrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module CoinSpendPrivateKeyP = EddsaPrivateKey
|
|
|
|
|
module MasterSignatureP = EddsaSignature
|
|
|
|
|
module ReserveSignatureP = EddsaSignature
|
|
|
|
|
module ExchangeSignatureP = EddsaSignature
|
|
|
|
|
module CoinSpendSignatureP = EddsaSignature
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
open Aliases
|
2025-10-17 20:05:48 +02:00
|
|
|
|
2026-02-24 17:51:30 +01:00
|
|
|
let size_of_int32 = 4
|
2026-02-05 19:11:59 +01:00
|
|
|
|
2026-02-26 16:20:20 +01:00
|
|
|
module type BYTES = sig
|
|
|
|
|
type t
|
|
|
|
|
|
|
|
|
|
val of_octets : string -> (t, string) result
|
|
|
|
|
val to_octets : t -> string
|
|
|
|
|
val bin : t Bin.t
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module Bytes32 : BYTES = struct
|
|
|
|
|
let n = 32
|
|
|
|
|
|
2026-02-05 19:11:59 +01:00
|
|
|
type t = string
|
|
|
|
|
|
2026-02-26 16:20:20 +01:00
|
|
|
let of_octets s =
|
|
|
|
|
match String.length s = n with
|
|
|
|
|
| false -> Error "invalid bytes length"
|
|
|
|
|
| true -> Ok s
|
|
|
|
|
|
|
|
|
|
let to_octets = Fun.id
|
|
|
|
|
let bin = Bin.bytes n
|
2026-02-05 19:11:59 +01:00
|
|
|
end
|
|
|
|
|
|
2026-02-26 16:20:20 +01:00
|
|
|
module Bytes64 : BYTES = struct
|
|
|
|
|
let n = 64
|
|
|
|
|
|
2026-02-05 19:11:59 +01:00
|
|
|
type t = string
|
|
|
|
|
|
2026-02-26 16:20:20 +01:00
|
|
|
let of_octets s =
|
|
|
|
|
match String.length s = n with
|
|
|
|
|
| false -> Error "invalid bytes length"
|
|
|
|
|
| true -> Ok s
|
|
|
|
|
|
|
|
|
|
let to_octets = Fun.id
|
|
|
|
|
let bin = Bin.bytes n
|
2026-02-05 19:11:59 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module TransferSecretP = Bytes64
|
|
|
|
|
module LinkSecretP = Bytes64
|
|
|
|
|
module EncryptedLinkSecretP = Bytes64
|
|
|
|
|
module BlindingMasterSeed = Bytes32
|
|
|
|
|
module BlindingMasterSecret = Bytes32
|
|
|
|
|
module WireTransferIdentifierRawP = Bytes32
|
|
|
|
|
module PublicRefreshCoinNonceP = Bytes64
|
|
|
|
|
module DenominationBlindingKeyP = Bytes32
|
|
|
|
|
module RefreshCommitmentP = Bytes64
|
|
|
|
|
|
|
|
|
|
module UUID = struct
|
|
|
|
|
type t = string
|
|
|
|
|
|
2026-02-24 17:51:30 +01:00
|
|
|
let size = 4 * size_of_int32
|
2026-02-05 19:11:59 +01:00
|
|
|
let bin = Bin.bytes size
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module WadId = struct
|
|
|
|
|
type t = string
|
|
|
|
|
|
2026-02-24 17:51:30 +01:00
|
|
|
let size = 6 * size_of_int32
|
2026-02-05 19:11:59 +01:00
|
|
|
let bin = Bin.bytes size
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module AgeMask = struct
|
|
|
|
|
type t = int32
|
|
|
|
|
|
|
|
|
|
let bin = Bin.beint32
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
(* --- *)
|
|
|
|
|
|
2025-10-17 20:05:48 +02:00
|
|
|
(* EccSignaturePurpose *)
|
|
|
|
|
module Purpose = struct
|
|
|
|
|
type t = {
|
|
|
|
|
size: int32;
|
|
|
|
|
purpose: int32;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
record (fun size purpose -> { size; purpose })
|
|
|
|
|
|+ field beint32 (fun t -> t.size)
|
|
|
|
|
|+ field beint32 (fun t -> t.purpose)
|
|
|
|
|
|> sealr
|
|
|
|
|
|
|
|
|
|
let make ~size purpose = { size= Int32.of_int size; purpose }
|
|
|
|
|
let dummy = make ~size:0 0_l
|
|
|
|
|
|
|
|
|
|
(* helper function to make ['signature Bin.t]
|
|
|
|
|
to compute [t.size], we first build a bin with a dummy purpose *)
|
|
|
|
|
let make_bin =
|
|
|
|
|
let get_size f =
|
|
|
|
|
let open Bin in
|
|
|
|
|
match Size.of_value (Size.size_of (f dummy)) with
|
|
|
|
|
| Dynamic _ | Unknown ->
|
|
|
|
|
Fmt.failwith "size_of failure: size is not Static"
|
|
|
|
|
| Static n -> n
|
|
|
|
|
in
|
|
|
|
|
fun code f -> make ~size:(get_size f) code |> f
|
|
|
|
|
|
|
|
|
|
let field purpose = Bin.field bin (fun _t -> purpose)
|
|
|
|
|
end
|
2025-10-07 14:20:32 +02:00
|
|
|
|
2026-02-05 19:11:59 +01:00
|
|
|
(* --- Packed Signatures --- *)
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
module MK (R : sig
|
2025-12-03 16:19:11 +01:00
|
|
|
type r
|
|
|
|
|
|
|
|
|
|
val bin : r Bin.t
|
2026-02-23 04:35:42 +01:00
|
|
|
end) : sig
|
2025-12-16 14:20:41 +01:00
|
|
|
open Crypto
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
(* record type of data to sign *)
|
|
|
|
|
type r = R.r
|
2025-12-03 16:19:11 +01:00
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
(* type of signature over r *)
|
|
|
|
|
type t
|
2025-12-06 19:18:53 +01:00
|
|
|
|
2026-02-17 09:30:20 +01:00
|
|
|
(* todo
|
|
|
|
|
- type for unknown/verified signatures? (nk/ok) *)
|
|
|
|
|
val verify : EddsaPublicKey.t -> t -> r -> (unit, string) result
|
2026-02-23 04:35:42 +01:00
|
|
|
val signf : (string -> EddsaSignature.t) -> r -> t
|
2025-12-03 16:19:11 +01:00
|
|
|
val jsont : t Jsont.t
|
2025-12-07 01:02:54 +01:00
|
|
|
val caqti : t Caqti_type.t
|
2026-01-19 20:54:39 +01:00
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
(* only needed for /keys `exchange_sig`
|
|
|
|
|
(signature over contatentation of all of the master_sigs) *)
|
2026-01-19 20:54:39 +01:00
|
|
|
val to_octets : t -> string
|
2026-02-23 04:35:42 +01:00
|
|
|
end = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
open Crypto
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
type r = R.r
|
2025-12-03 16:19:11 +01:00
|
|
|
type t = EddsaSignature.t
|
|
|
|
|
|
2026-02-17 09:30:20 +01:00
|
|
|
let to_string = Bin.to_string R.bin
|
|
|
|
|
let verify key t r = EddsaSignature.verify ~key t ~msg:(to_string r)
|
|
|
|
|
let signf f r = f (to_string r)
|
2025-12-03 16:19:11 +01:00
|
|
|
let jsont = EddsaSignature.jsont
|
2025-12-15 08:56:44 +01:00
|
|
|
let caqti : EddsaSignature.t Caqti_type.t = EddsaSignature.caqti
|
2026-01-19 20:54:39 +01:00
|
|
|
let to_octets t = EddsaSignature.to_octets t
|
2025-12-03 16:19:11 +01:00
|
|
|
end
|
|
|
|
|
|
2026-02-17 09:30:20 +01:00
|
|
|
(* ---- *)
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationKeyAnnouncement = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
2026-02-16 17:55:21 +01:00
|
|
|
(* CS: use purpose TALER_SIGNATURE_SM_CS_DENOMINATION_KEY *)
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_SM_RSA_DENOMINATION_KEY *)
|
2025-12-03 16:19:11 +01:00
|
|
|
type r = {
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_section_name: Hash.Cstring.H64.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
anchor_time: Timestamp.t;
|
|
|
|
|
duration_withdraw: TimeRelative.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.sm_rsa_denomination_key
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose h_denom_pub h_section_name anchor_time duration_withdraw ->
|
|
|
|
|
{ h_denom_pub; h_section_name; anchor_time; duration_withdraw })
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field DenominationHash.bin (fun t -> t.h_denom_pub)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_section_name)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.anchor_time)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.duration_withdraw)
|
2025-12-03 16:19:11 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module SigningKeyAnnouncement = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_SM_SIGNING_KEY *)
|
2025-12-03 16:19:11 +01:00
|
|
|
type r = {
|
|
|
|
|
exchange_pub: ExchangePublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
anchor_time: Timestamp.t;
|
|
|
|
|
duration: TimeRelative.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.sm_signing_key @@ fun purpose ->
|
|
|
|
|
record (fun _purpose exchange_pub anchor_time duration ->
|
|
|
|
|
{ exchange_pub; anchor_time; duration })
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field ExchangePublicKeyP.bin (fun t -> t.exchange_pub)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.anchor_time)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.duration)
|
2025-12-03 16:19:11 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationKeyValidity = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY *)
|
2025-12-03 16:19:11 +01:00
|
|
|
type r = {
|
|
|
|
|
master: MasterPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
start: Timestamp.t;
|
|
|
|
|
expire_withdraw: Timestamp.t;
|
|
|
|
|
expire_spend: Timestamp.t;
|
|
|
|
|
expire_legal: Timestamp.t;
|
|
|
|
|
value: Amount.t;
|
|
|
|
|
fee_withdraw: Amount.t;
|
|
|
|
|
fee_deposit: Amount.t;
|
|
|
|
|
fee_refresh: Amount.t;
|
2026-02-16 17:55:21 +01:00
|
|
|
(* TODO signatures taler doc *)
|
2026-02-24 17:51:30 +01:00
|
|
|
fee_refund: Amount.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
denom_hash: DenominationHash.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_denomination_key_validity
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
master
|
|
|
|
|
start
|
|
|
|
|
expire_withdraw
|
|
|
|
|
expire_spend
|
|
|
|
|
expire_legal
|
|
|
|
|
value
|
|
|
|
|
fee_withdraw
|
|
|
|
|
fee_deposit
|
|
|
|
|
fee_refresh
|
2026-02-07 00:11:25 +01:00
|
|
|
fee_refund
|
2025-12-03 16:19:11 +01:00
|
|
|
denom_hash
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
master;
|
|
|
|
|
start;
|
|
|
|
|
expire_withdraw;
|
|
|
|
|
expire_spend;
|
|
|
|
|
expire_legal;
|
|
|
|
|
value;
|
|
|
|
|
fee_withdraw;
|
|
|
|
|
fee_deposit;
|
|
|
|
|
fee_refresh;
|
2026-02-07 00:11:25 +01:00
|
|
|
fee_refund;
|
2025-12-03 16:19:11 +01:00
|
|
|
denom_hash;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_withdraw)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_spend)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_legal)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.value)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_withdraw)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_deposit)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_refresh)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_refund)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field DenominationHash.bin (fun t -> t.denom_hash)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-03 16:19:11 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeSigningKeyValidity = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY *)
|
2025-12-03 16:19:11 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
start: Timestamp.t;
|
|
|
|
|
expire: Timestamp.t;
|
|
|
|
|
end_: Timestamp.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
signkey_pub: ExchangePublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_signing_key_validity
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record (fun _purpose start expire end_ signkey_pub ->
|
|
|
|
|
{ start; expire; end_; signkey_pub })
|
|
|
|
|
|+ Purpose.field purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.end_)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field ExchangePublicKeyP.bin (fun t -> t.signkey_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-03 16:19:11 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDenominationKeyRevocation = struct
|
2025-12-04 16:08:50 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. *)
|
2025-12-04 16:08:50 +01:00
|
|
|
type r = { h_denom_pub: DenominationHash.t }
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_denomination_key_revoked
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record (fun _purpose h_denom_pub -> { h_denom_pub })
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field DenominationHash.bin (fun t -> t.h_denom_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:08:50 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterSigningKeyRevocation = struct
|
2025-12-04 16:08:50 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED *)
|
2025-12-04 16:08:50 +01:00
|
|
|
type r = { exchange_pub: ExchangePublicKeyP.t }
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_signing_key_revoked
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record (fun _purpose exchange_pub -> { exchange_pub })
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field ExchangePublicKeyP.bin (fun t -> t.exchange_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:08:50 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAddAuditor = struct
|
2025-12-04 16:19:10 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR *)
|
2025-12-04 16:19:10 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
2025-12-04 16:19:10 +01:00
|
|
|
auditor_pub: AuditorPublicKeyP.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_auditor_url: Hash.Cstring.H64.t;
|
2025-12-04 16:19:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_add_auditor @@ fun purpose ->
|
|
|
|
|
record (fun _purpose start_date auditor_pub h_auditor_url ->
|
|
|
|
|
{ start_date; auditor_pub; h_auditor_url })
|
|
|
|
|
|+ Purpose.field purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
2025-12-04 16:19:10 +01:00
|
|
|
|+ field AuditorPublicKeyP.bin (fun t -> t.auditor_pub)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_auditor_url)
|
2025-12-04 16:19:10 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:19:10 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDelAuditor = struct
|
2025-12-04 16:22:38 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_DEL_AUDITOR *)
|
2025-12-04 16:22:38 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
end_date: Timestamp.t;
|
2025-12-04 16:22:38 +01:00
|
|
|
auditor_pub: AuditorPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_del_auditor @@ fun purpose ->
|
|
|
|
|
record (fun _purpose end_date auditor_pub -> { end_date; auditor_pub })
|
|
|
|
|
|+ Purpose.field purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
2025-12-04 16:22:38 +01:00
|
|
|
|+ field AuditorPublicKeyP.bin (fun t -> t.auditor_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:22:38 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module GlobalFees = struct
|
2025-12-04 16:45:03 +01:00
|
|
|
module R = struct
|
2026-02-16 17:55:21 +01:00
|
|
|
(* TODO signatures taler doc *)
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES *)
|
2025-12-04 16:45:03 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
|
|
|
|
end_date: Timestamp.t;
|
|
|
|
|
purse_timeout: TimeRelative.t;
|
|
|
|
|
history_expiration: TimeRelative.t;
|
|
|
|
|
history_fee: Amount.t;
|
|
|
|
|
account_fee: Amount.t;
|
|
|
|
|
purse_fee: Amount.t;
|
2025-12-04 16:45:03 +01:00
|
|
|
purse_account_limit: int32;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_global_fees @@ fun purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
start_date
|
|
|
|
|
end_date
|
|
|
|
|
purse_timeout
|
|
|
|
|
history_expiration
|
|
|
|
|
history_fee
|
|
|
|
|
account_fee
|
|
|
|
|
purse_fee
|
|
|
|
|
purse_account_limit
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
start_date;
|
|
|
|
|
end_date;
|
|
|
|
|
purse_timeout;
|
|
|
|
|
history_expiration;
|
|
|
|
|
history_fee;
|
|
|
|
|
account_fee;
|
|
|
|
|
purse_fee;
|
|
|
|
|
purse_account_limit;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.purse_timeout)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.history_expiration)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.history_fee)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.account_fee)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.purse_fee)
|
2025-12-04 16:45:03 +01:00
|
|
|
|+ field beint32 (fun t -> t.purse_account_limit)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:45:03 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterWireDetails = struct
|
2025-12-04 16:53:53 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS *)
|
2025-12-04 16:53:53 +01:00
|
|
|
type r = {
|
|
|
|
|
h_wire_details: FullPaytoHash.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_conversion_url: Hash.Cstring.H64.t;
|
|
|
|
|
h_credit_restrictions: Hash.Cstring.H64.t;
|
|
|
|
|
h_debit_restrictions: Hash.Cstring.H64.t;
|
2025-12-04 16:53:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_wire_details @@ fun purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
h_wire_details
|
|
|
|
|
h_conversion_url
|
|
|
|
|
h_credit_restrictions
|
|
|
|
|
h_debit_restrictions
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
h_wire_details;
|
|
|
|
|
h_conversion_url;
|
|
|
|
|
h_credit_restrictions;
|
|
|
|
|
h_debit_restrictions;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_wire_details)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_conversion_url)
|
|
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_credit_restrictions)
|
|
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_debit_restrictions)
|
2025-12-04 16:53:53 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:53:53 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAddWire = struct
|
2025-12-04 16:53:53 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_ADD_WIRE *)
|
2025-12-04 16:53:53 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
2025-12-04 16:53:53 +01:00
|
|
|
h_wire: FullPaytoHash.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_conversion_url: Hash.Cstring.H64.t;
|
|
|
|
|
h_credit_restrictions: Hash.Cstring.H64.t;
|
|
|
|
|
h_debit_restrictions: Hash.Cstring.H64.t;
|
2025-12-04 16:53:53 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_add_wire @@ fun _purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
start_date
|
|
|
|
|
h_wire
|
|
|
|
|
h_conversion_url
|
|
|
|
|
h_credit_restrictions
|
|
|
|
|
h_debit_restrictions
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
start_date;
|
|
|
|
|
h_wire;
|
|
|
|
|
h_conversion_url;
|
|
|
|
|
h_credit_restrictions;
|
|
|
|
|
h_debit_restrictions;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
2025-12-04 16:53:53 +01:00
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_wire)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_conversion_url)
|
|
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_credit_restrictions)
|
|
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_debit_restrictions)
|
2025-12-04 16:53:53 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 16:53:53 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDelWire = struct
|
2025-12-04 17:10:13 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_DEL_WIRE *)
|
2025-12-04 17:10:13 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
end_date: Timestamp.t;
|
2025-12-04 17:10:13 +01:00
|
|
|
h_wire: FullPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_del_wire @@ fun _purpose ->
|
|
|
|
|
record (fun _purpose end_date h_wire -> { end_date; h_wire })
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
2025-12-04 17:10:13 +01:00
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_wire)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 17:10:13 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDrainProfit = struct
|
2025-12-04 17:16:41 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS *)
|
2025-12-04 17:16:41 +01:00
|
|
|
type r = {
|
|
|
|
|
wtid: WireTransferIdentifierRawP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
date: Timestamp.t;
|
|
|
|
|
amount: Amount.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_section: Hash.Cstring.H64.t;
|
2025-12-04 17:16:41 +01:00
|
|
|
h_payto: FullPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_drain_profit @@ fun _purpose ->
|
|
|
|
|
record (fun _purpose wtid date amount h_section h_payto ->
|
|
|
|
|
{ wtid; date; amount; h_section; h_payto })
|
|
|
|
|
|+ Purpose.field _purpose
|
|
|
|
|
|+ field WireTransferIdentifierRawP.bin (fun t -> t.wtid)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.date)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.amount)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_section)
|
2025-12-04 17:16:41 +01:00
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_payto)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 17:16:41 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAmlOfficerStatus = struct
|
2025-12-04 17:26:19 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_AML_KEY *)
|
2025-12-04 17:26:19 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
change_date: Timestamp.t;
|
2025-12-04 17:26:19 +01:00
|
|
|
officer_pub: AmlOfficerPublicKeyP.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_officer_name: Hash.Cstring.H64.t;
|
2025-12-04 17:26:19 +01:00
|
|
|
is_active: int32;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_aml_key @@ fun _purpose ->
|
|
|
|
|
record (fun _purpose change_date officer_pub h_officer_name is_active ->
|
|
|
|
|
{ change_date; officer_pub; h_officer_name; is_active })
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.change_date)
|
2025-12-04 17:26:19 +01:00
|
|
|
|+ field AmlOfficerPublicKeyP.bin (fun t -> t.officer_pub)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_officer_name)
|
2025-12-04 17:26:19 +01:00
|
|
|
|+ field beint32 (fun t -> t.is_active)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 17:26:19 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PartnerConfiguration = struct
|
2025-12-04 17:35:48 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS *)
|
2025-12-04 17:35:48 +01:00
|
|
|
type r = {
|
|
|
|
|
partner_pub: MasterPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
|
|
|
|
end_date: Timestamp.t;
|
|
|
|
|
wad_frequency: TimeRelative.t;
|
|
|
|
|
wad_fee: Amount.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_url: Hash.Cstring.H64.t;
|
2025-12-04 17:35:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_partner_details
|
|
|
|
|
@@ fun _purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
partner_pub
|
|
|
|
|
start_date
|
|
|
|
|
end_date
|
|
|
|
|
wad_frequency
|
|
|
|
|
wad_fee
|
|
|
|
|
h_url
|
|
|
|
|
-> { partner_pub; start_date; end_date; wad_frequency; wad_fee; h_url })
|
|
|
|
|
|+ Purpose.field _purpose
|
|
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.partner_pub)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.wad_frequency)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.wad_fee)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_url)
|
2025-12-04 17:35:48 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 17:35:48 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WadPartnerSignature = struct
|
2025-12-04 17:50:49 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_PARTNER_DETAILS *)
|
2025-12-04 17:50:49 +01:00
|
|
|
type r = {
|
2026-02-05 17:51:24 +01:00
|
|
|
h_partner_base_url: Hash.Cstring.H64.t;
|
2025-12-04 17:50:49 +01:00
|
|
|
master_public_key: MasterPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
|
|
|
|
end_date: Timestamp.t;
|
|
|
|
|
wad_fee: Amount.t;
|
|
|
|
|
wad_frequency: TimeRelative.t;
|
2025-12-04 17:50:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_partner_details
|
|
|
|
|
@@ fun _purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
h_partner_base_url
|
|
|
|
|
master_public_key
|
|
|
|
|
start_date
|
|
|
|
|
end_date
|
|
|
|
|
wad_fee
|
|
|
|
|
wad_frequency
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
h_partner_base_url;
|
|
|
|
|
master_public_key;
|
|
|
|
|
start_date;
|
|
|
|
|
end_date;
|
|
|
|
|
wad_fee;
|
|
|
|
|
wad_frequency;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_partner_base_url)
|
2025-12-04 17:50:49 +01:00
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master_public_key)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.wad_fee)
|
|
|
|
|
|+ field TimeRelative.bin (fun t -> t.wad_frequency)
|
2025-12-04 17:50:49 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterWireFee = struct
|
2025-12-04 17:54:40 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MASTER_WIRE_FEES *)
|
2025-12-04 17:54:40 +01:00
|
|
|
type r = {
|
2026-02-05 17:51:24 +01:00
|
|
|
h_wire_method: Hash.Cstring.H64.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
|
|
|
|
end_date: Timestamp.t;
|
|
|
|
|
wire_fee: Amount.t;
|
|
|
|
|
closing_fee: Amount.t;
|
2025-12-04 17:54:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.master_wire_fees @@ fun _purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun _purpose h_wire_method start_date end_date wire_fee closing_fee ->
|
|
|
|
|
{ h_wire_method; start_date; end_date; wire_fee; closing_fee })
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.h_wire_method)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.end_date)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.wire_fee)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.closing_fee)
|
2025-12-04 17:54:40 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
2026-02-23 04:35:42 +01:00
|
|
|
include MK (R)
|
2025-12-04 17:54:40 +01:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeKeyValidity = struct
|
2025-12-04 17:59:07 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS *)
|
2025-12-04 17:59:07 +01:00
|
|
|
type r = {
|
2026-02-05 17:51:24 +01:00
|
|
|
auditor_url_hash: Hash.Cstring.H64.t;
|
2025-12-04 17:59:07 +01:00
|
|
|
master: MasterPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
start: Timestamp.t;
|
|
|
|
|
expire_withdraw: Timestamp.t;
|
|
|
|
|
expire_spend: Timestamp.t;
|
|
|
|
|
expire_legal: Timestamp.t;
|
|
|
|
|
value: Amount.t;
|
|
|
|
|
fee_withdraw: Amount.t;
|
|
|
|
|
fee_deposit: Amount.t;
|
|
|
|
|
fee_refresh: Amount.t;
|
2025-12-04 17:59:07 +01:00
|
|
|
denom_hash: DenominationHash.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.auditor_exchange_keys @@ fun _purpose ->
|
|
|
|
|
record
|
|
|
|
|
(fun
|
|
|
|
|
_purpose
|
|
|
|
|
auditor_url_hash
|
|
|
|
|
master
|
|
|
|
|
start
|
|
|
|
|
expire_withdraw
|
|
|
|
|
expire_spend
|
|
|
|
|
expire_legal
|
|
|
|
|
value
|
|
|
|
|
fee_withdraw
|
|
|
|
|
fee_deposit
|
|
|
|
|
fee_refresh
|
|
|
|
|
denom_hash
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
auditor_url_hash;
|
|
|
|
|
master;
|
|
|
|
|
start;
|
|
|
|
|
expire_withdraw;
|
|
|
|
|
expire_spend;
|
|
|
|
|
expire_legal;
|
|
|
|
|
value;
|
|
|
|
|
fee_withdraw;
|
|
|
|
|
fee_deposit;
|
|
|
|
|
fee_refresh;
|
|
|
|
|
denom_hash;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field Hash.Cstring.H64.bin (fun t -> t.auditor_url_hash)
|
2025-12-04 17:59:07 +01:00
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master)
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.start)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_withdraw)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_spend)
|
|
|
|
|
|+ field Timestamp.bin (fun t -> t.expire_legal)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.value)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_withdraw)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_deposit)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee_refresh)
|
2025-12-04 17:59:07 +01:00
|
|
|
|+ field DenominationHash.bin (fun t -> t.denom_hash)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeKeySet = struct
|
2025-12-06 17:49:25 +01:00
|
|
|
module R = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_KEY_SET *)
|
2025-12-06 17:49:25 +01:00
|
|
|
type r = {
|
2026-02-24 17:51:30 +01:00
|
|
|
list_issue_date: Timestamp.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
(* hash over a concatenation of master_sigs *)
|
|
|
|
|
hc: H64.t;
|
2025-12-06 17:49:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.exchange_key_set @@ fun _purpose ->
|
|
|
|
|
record (fun _purpose list_issue_date hc -> { list_issue_date; hc })
|
|
|
|
|
|+ Purpose.field _purpose
|
2026-02-24 17:51:30 +01:00
|
|
|
|+ field Timestamp.bin (fun t -> t.list_issue_date)
|
2026-02-05 17:51:24 +01:00
|
|
|
|+ field H64.bin (fun t -> t.hc)
|
2025-12-06 17:49:25 +01:00
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-03 16:19:11 +01:00
|
|
|
(* ### BIN IMPL END ### *)
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WithdrawRequest = struct
|
2025-10-07 14:20:32 +02:00
|
|
|
(* Purpose is #TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
2025-10-07 11:10:40 +02:00
|
|
|
type t = {
|
|
|
|
|
amount: Amount.t;
|
|
|
|
|
fee: Amount.t;
|
2025-10-07 14:59:58 +02:00
|
|
|
h_planchets: HashPlanchetsP.t;
|
2025-10-17 20:05:48 +02:00
|
|
|
blinding_seed: BlindingMasterSecret.t;
|
2025-10-07 11:10:40 +02:00
|
|
|
max_age_group: int32;
|
2025-10-07 14:59:58 +02:00
|
|
|
mask: AgeMask.t;
|
2025-10-07 11:10:40 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
|
|
|
|
let open Bin in
|
2025-10-07 23:45:07 +02:00
|
|
|
Purpose.make_bin Taler_signatures.wallet_reserve_withdraw @@ fun purpose ->
|
2025-10-07 11:10:40 +02:00
|
|
|
record
|
2025-10-07 23:45:07 +02:00
|
|
|
(fun _purpose amount fee h_planchets blinding_seed max_age_group mask ->
|
2025-10-07 14:20:32 +02:00
|
|
|
{ amount; fee; h_planchets; blinding_seed; max_age_group; mask })
|
2025-10-07 23:45:07 +02:00
|
|
|
|+ Purpose.field purpose
|
2025-10-07 11:10:40 +02:00
|
|
|
|+ field Amount.bin (fun t -> t.amount)
|
|
|
|
|
|+ field Amount.bin (fun t -> t.fee)
|
2025-10-07 14:59:58 +02:00
|
|
|
|+ field HashPlanchetsP.bin (fun t -> t.h_planchets)
|
2025-10-17 20:05:48 +02:00
|
|
|
|+ field BlindingMasterSecret.bin (fun t -> t.blinding_seed)
|
2025-10-07 11:10:40 +02:00
|
|
|
|+ field beint32 (fun t -> t.max_age_group)
|
2025-10-07 14:59:58 +02:00
|
|
|
|+ field AgeMask.bin (fun t -> t.mask)
|
2025-10-07 11:10:40 +02:00
|
|
|
|> sealr
|
|
|
|
|
end
|
2025-10-07 11:45:15 +02:00
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WithdrawConfirmation = struct
|
2026-02-05 21:19:57 +01:00
|
|
|
(* Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_WITHDRAW *)
|
2025-10-07 11:45:15 +02:00
|
|
|
type t = {
|
2025-10-07 14:59:58 +02:00
|
|
|
h_planchets: HashPlanchetsP.t;
|
2025-10-07 11:45:15 +02:00
|
|
|
noreveal_index: int32;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let bin =
|
2025-10-07 23:45:07 +02:00
|
|
|
let open Bin in
|
|
|
|
|
Purpose.make_bin Taler_signatures.exchange_confirm_withdraw
|
|
|
|
|
@@ fun purpose ->
|
|
|
|
|
record (fun _purpose h_planchets noreveal_index ->
|
|
|
|
|
{ h_planchets; noreveal_index })
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field HashPlanchetsP.bin (fun t -> t.h_planchets)
|
|
|
|
|
|+ field beint32 (fun t -> t.noreveal_index)
|
2025-10-07 11:45:15 +02:00
|
|
|
|> sealr
|
|
|
|
|
end
|
2025-10-08 21:17:03 +02:00
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module SingleWithdrawRequest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
amount_with_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_denomination_pub: DenominationHash.t;
|
|
|
|
|
h_coin_envelope: BlindedCoinHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DepositRequest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_age_commitment: AgeCommitmentHash.t;
|
|
|
|
|
h_policy: ExtensionsPolicyHash.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
|
|
|
|
refund_deadline: Timestamp.t;
|
|
|
|
|
amount_with_fee: Amount.t;
|
|
|
|
|
deposit_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
merchant: MerchantPublicKeyP.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
wallet_data_hash: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DepositConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
h_policy: ExtensionsPolicyHash.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
|
|
|
|
refund_deadline: Timestamp.t;
|
|
|
|
|
amount_without_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefreshMeltCoinAffirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_COIN_MELT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
session_hash: RefreshCommitmentP.t;
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
h_age_commitment: AgeCommitmentHash.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
amount_with_fee: Amount.t;
|
|
|
|
|
melt_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefreshMeltConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
session_hash: RefreshCommitmentP.t;
|
|
|
|
|
noreveal_index: int; (* uint16_t mapped to OCaml int *)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DepositTrack = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module WireDepositDetailP = struct
|
|
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
execution_time: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
deposit_value: Amount.t;
|
|
|
|
|
deposit_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WireDepositData = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
total: Amount.t;
|
|
|
|
|
wire_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
merchant_pub: MerchantPublicKeyP.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_details: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PaymentResponse = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = { h_contract_terms: PrivateContractHash.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module Contract = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_CONTRACT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = { h_contract_terms: PrivateContractHash.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ConfirmWire = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
wtid: WireTransferIdentifierRawP.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
execution_time: Timestamp.t;
|
|
|
|
|
coin_contribution: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefundConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
|
|
|
|
rtransaction_id: int64;
|
2026-02-24 17:51:30 +01:00
|
|
|
refund_amount: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module DepositTrackPS2 = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefundRequest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_REFUND *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
rtransaction_id: int64;
|
2026-02-24 17:51:30 +01:00
|
|
|
refund_amount: Amount.t;
|
|
|
|
|
refund_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MerchantRefundConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK *)
|
2025-10-08 21:17:03 +02:00
|
|
|
(* Hash of the order ID (a string), hashed without the 0-termination. *)
|
2026-02-05 17:51:24 +01:00
|
|
|
type t = { h_order_id: Hash.Cstring.H64.t }
|
2025-10-08 21:17:03 +02:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupRequest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
coin_blind: DenominationBlindingKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupRefreshConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
|
|
|
|
recoup_amount: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
old_coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
|
|
|
|
recoup_amount: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationUnknownAffirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationExpiredAffirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_GENERIC_DENOMINATIN_EXPIRED *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
operation: string; (* char[8] → string *)
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveCloseConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
timestamp: Timestamp.t;
|
|
|
|
|
closing_amount: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
h_wire: FullPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module CoinLinkSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_COIN_LINK *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
old_coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
transfer_pub: TransferPublicKeyP.t;
|
|
|
|
|
coin_envelope_hash: BlindedCoinHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefreshNonceSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_COIN_LINK *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = { nonce: PublicRefreshCoinNonceP.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveStatusRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_RESERVE_STATUS_REQUEST *)
|
|
|
|
|
type t = { request_timestamp: Timestamp.t }
|
2025-10-08 21:17:03 +02:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveHistoryRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_RESERVE_HISTORY_REQUEST *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
history_fee: Amount.t;
|
|
|
|
|
request_timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseStatusRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_PURSE_STATUS_REQUEST *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = unit
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseStatusResponseSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_PURSE_STATUS_RESPONSE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
total_purse_amount: Amount.t;
|
|
|
|
|
total_deposit_amount: Amount.t;
|
|
|
|
|
max_deposit_fees: Amount.t;
|
|
|
|
|
purse_expiration: Timestamp.t;
|
|
|
|
|
status_timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveCloseRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = unit
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
purse_expiration: Timestamp.t;
|
|
|
|
|
merge_value_after_fees: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
min_age: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseDepositSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_PURSE_DEPOSIT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
coin_contribution: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
h_age_commitment: AgeCommitmentHash.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_exchange_base_url: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module PurseDepositSignaturePS2 = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
reserve_sig: ReserveSignatureP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
coin_contribution: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseDepositConfirmedSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_PURSE_DEPOSIT_CONFIRMED *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
total_purse_amount: Amount.t;
|
|
|
|
|
total_deposit_fees: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
purse_pub: PursePublicKey.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
purse_expiration: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseMergeSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
merge_timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_wire: NormalizedPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module AccountMergeSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
merge_amount_after_fees: Amount.t;
|
|
|
|
|
merge_timestamp: Timestamp.t;
|
|
|
|
|
purse_expiration: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
min_age: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module AccountSetupRequestSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP *)
|
|
|
|
|
type t = { threshold: Amount.t }
|
2025-10-08 21:17:03 +02:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseMergeSuccessSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
merge_amount_after_fees: Amount.t;
|
|
|
|
|
contract_time: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_wire: NormalizedPaytoHash.t;
|
|
|
|
|
min_age: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WadDataSignature = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WAD_DATA *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
wad_execution_time: Timestamp.t;
|
|
|
|
|
total_amount: Amount.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_items: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
wad_id: WadId.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module P2PFees = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_P2P_FEES *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
start_date: Timestamp.t;
|
|
|
|
|
end_date: Timestamp.t;
|
|
|
|
|
kyc_fee: Amount.t;
|
|
|
|
|
purse_fee: Amount.t;
|
|
|
|
|
account_history_fee: Amount.t;
|
|
|
|
|
account_annual_fee: Amount.t;
|
|
|
|
|
account_kyc_timeout: TimeRelative.t;
|
|
|
|
|
purse_timeout: TimeRelative.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
purse_account_limit: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module CoinPurseRefundConfirmation = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
refunded_amount: Amount.t;
|
|
|
|
|
refund_fee: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module AmlDecision = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_AML_DECISION *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-05 17:51:24 +01:00
|
|
|
h_justification: Hash.Cstring.H64.t;
|
2026-02-24 17:51:30 +01:00
|
|
|
decision_time: Timestamp.t;
|
|
|
|
|
new_threshold: Amount.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
h_payto: NormalizedPaytoHash.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_kyc_requirements: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
new_state: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveOpen = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
reserve_payment: Amount.t;
|
|
|
|
|
request_timestamp: Timestamp.t;
|
|
|
|
|
reserve_expiration: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
purse_limit: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveClose = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
request_timestamp: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
target_account_h_payto: FullPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveAttestRequest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
request_timestamp: Timestamp.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_details: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeAttest = struct
|
2026-02-24 17:51:30 +01:00
|
|
|
(* purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS *)
|
2025-10-08 21:17:03 +02:00
|
|
|
type t = {
|
2026-02-24 17:51:30 +01:00
|
|
|
attest_timestamp: Timestamp.t;
|
|
|
|
|
expiration_time: Timestamp.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
2026-02-05 17:51:24 +01:00
|
|
|
h_attributes: Hash.Cstring.H64.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|