2025-11-21 19:29:04 +01:00
|
|
|
(* Packed Signature *)
|
2025-10-06 23:56:10 +02:00
|
|
|
|
2025-11-21 19:29:04 +01:00
|
|
|
open Bin_type
|
2025-12-07 08:03:00 +01:00
|
|
|
|
|
|
|
|
module Aliases = struct
|
2026-02-05 15:31:49 +01:00
|
|
|
module Timestamp = struct
|
|
|
|
|
type t = Time.Timestamp.t
|
|
|
|
|
|
|
|
|
|
let bin = Time.Timestamp.bin
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module TimestampNBO = struct
|
|
|
|
|
type t = Time.Timestamp.t
|
|
|
|
|
|
|
|
|
|
let bin = Time.Timestamp.bin_nbo
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module TimeRelative = struct
|
|
|
|
|
type t = Time.Relative.t
|
|
|
|
|
|
|
|
|
|
let bin = Time.Relative.bin
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module TimeRelativeNBO = struct
|
|
|
|
|
type t = Time.Relative.t
|
|
|
|
|
|
|
|
|
|
let bin = Time.Relative.bin_nbo
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 08:03:00 +01:00
|
|
|
module AmountNBO = struct
|
|
|
|
|
type t = Amount.t
|
|
|
|
|
|
|
|
|
|
let bin = Amount.bin_nbo
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
(* - Keys - *)
|
2026-02-05 15:31:49 +01:00
|
|
|
|
|
|
|
|
(* TODO keep this?
|
|
|
|
|
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
|
|
|
|
|
|
|
|
(* 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
|
|
|
|
2025-12-03 16:19:11 +01:00
|
|
|
module MK (R : sig
|
|
|
|
|
type r
|
|
|
|
|
|
|
|
|
|
val bin : r Bin.t
|
|
|
|
|
end) : sig
|
2025-12-16 14:20:41 +01:00
|
|
|
open Crypto
|
|
|
|
|
|
2025-12-03 16:19:11 +01:00
|
|
|
type r = R.r
|
|
|
|
|
type t
|
|
|
|
|
|
2025-12-16 14:20:41 +01:00
|
|
|
val sign_f : f:(string -> eddsa_sig) -> r -> t
|
|
|
|
|
|
|
|
|
|
val verify_f :
|
|
|
|
|
f:(eddsa_sig -> msg:string -> (unit, string) result) ->
|
|
|
|
|
t ->
|
|
|
|
|
r ->
|
|
|
|
|
(unit, string) result
|
2025-12-06 19:18:53 +01:00
|
|
|
|
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
|
|
|
|
|
|
|
|
(* TODO rm *)
|
|
|
|
|
(* escape hatch, only needed for /keys `exchange_sig` (signature over contatentation of all of the master_sigs) *)
|
|
|
|
|
val to_octets : t -> string
|
2025-12-03 16:19:11 +01:00
|
|
|
end = struct
|
|
|
|
|
open Crypto
|
|
|
|
|
|
|
|
|
|
type r = R.r
|
|
|
|
|
type t = EddsaSignature.t
|
|
|
|
|
|
2025-12-16 14:20:41 +01:00
|
|
|
let sign_f ~f r = f (Bin.to_string R.bin r)
|
|
|
|
|
let verify_f ~f t r = f t ~msg:(Bin.to_string R.bin 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
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationKeyAnnouncement = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* TODO taler_signatures purpose
|
|
|
|
|
we use TALER_SIGNATURE_SM_RSA_DENOMINATION_KEY instead here *)
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_SM_DENOMINATION_KEY *)
|
|
|
|
|
type r = {
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
h_section_name: Hash_64_cstr.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
anchor_time: TimestampNBO.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
duration_withdraw: TimeRelativeNBO.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_section_name)
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.anchor_time)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.duration_withdraw)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
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
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_SM_SIGNING_KEY *)
|
|
|
|
|
type r = {
|
|
|
|
|
exchange_pub: ExchangePublicKeyP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
anchor_time: TimestampNBO.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
duration: TimeRelativeNBO.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.anchor_time)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.duration)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
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
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY *)
|
|
|
|
|
type r = {
|
|
|
|
|
master: MasterPublicKeyP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
start: TimestampNBO.t;
|
|
|
|
|
expire_withdraw: TimestampNBO.t;
|
|
|
|
|
expire_spend: TimestampNBO.t;
|
|
|
|
|
expire_legal: TimestampNBO.t;
|
2025-12-03 16:19:11 +01:00
|
|
|
value: AmountNBO.t;
|
|
|
|
|
fee_withdraw: AmountNBO.t;
|
|
|
|
|
fee_deposit: AmountNBO.t;
|
|
|
|
|
fee_refresh: AmountNBO.t;
|
|
|
|
|
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
|
|
|
|
|
denom_hash
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
master;
|
|
|
|
|
start;
|
|
|
|
|
expire_withdraw;
|
|
|
|
|
expire_spend;
|
|
|
|
|
expire_legal;
|
|
|
|
|
value;
|
|
|
|
|
fee_withdraw;
|
|
|
|
|
fee_deposit;
|
|
|
|
|
fee_refresh;
|
|
|
|
|
denom_hash;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field purpose
|
|
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master)
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_withdraw)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_spend)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_legal)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field AmountNBO.bin (fun t -> t.value)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_withdraw)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_deposit)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_refresh)
|
|
|
|
|
|+ field DenominationHash.bin (fun t -> t.denom_hash)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeSigningKeyValidity = struct
|
2025-12-03 16:19:11 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_VALIDITY *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
start: TimestampNBO.t;
|
|
|
|
|
expire: TimestampNBO.t;
|
|
|
|
|
end_: TimestampNBO.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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_)
|
2025-12-03 16:19:11 +01:00
|
|
|
|+ field ExchangePublicKeyP.bin (fun t -> t.signkey_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDenominationKeyRevocation = struct
|
2025-12-04 16:08:50 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED. *)
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterSigningKeyRevocation = struct
|
2025-12-04 16:08:50 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED *)
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAddAuditor = struct
|
2025-12-04 16:19:10 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_ADD_AUDITOR *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
2025-12-04 16:19:10 +01:00
|
|
|
auditor_pub: AuditorPublicKeyP.t;
|
|
|
|
|
h_auditor_url: Hash_64_cstr.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
2025-12-04 16:19:10 +01:00
|
|
|
|+ field AuditorPublicKeyP.bin (fun t -> t.auditor_pub)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_auditor_url)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDelAuditor = struct
|
2025-12-04 16:22:38 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_DEL_AUDITOR *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
end_date: TimestampNBO.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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
2025-12-04 16:22:38 +01:00
|
|
|
|+ field AuditorPublicKeyP.bin (fun t -> t.auditor_pub)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module GlobalFees = struct
|
2025-12-04 16:45:03 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_GLOBAL_FEES *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
|
|
|
|
end_date: TimestampNBO.t;
|
2025-12-04 16:45:03 +01:00
|
|
|
purse_timeout: TimeRelativeNBO.t;
|
|
|
|
|
kyc_timeout: TimeRelativeNBO.t;
|
|
|
|
|
history_expiration: TimeRelativeNBO.t;
|
|
|
|
|
history_fee: AmountNBO.t;
|
|
|
|
|
kyc_fee: AmountNBO.t;
|
|
|
|
|
account_fee: AmountNBO.t;
|
|
|
|
|
purse_fee: AmountNBO.t;
|
|
|
|
|
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
|
|
|
|
|
kyc_timeout
|
|
|
|
|
history_expiration
|
|
|
|
|
history_fee
|
|
|
|
|
kyc_fee
|
|
|
|
|
account_fee
|
|
|
|
|
purse_fee
|
|
|
|
|
purse_account_limit
|
|
|
|
|
->
|
|
|
|
|
{
|
|
|
|
|
start_date;
|
|
|
|
|
end_date;
|
|
|
|
|
purse_timeout;
|
|
|
|
|
kyc_timeout;
|
|
|
|
|
history_expiration;
|
|
|
|
|
history_fee;
|
|
|
|
|
kyc_fee;
|
|
|
|
|
account_fee;
|
|
|
|
|
purse_fee;
|
|
|
|
|
purse_account_limit;
|
|
|
|
|
})
|
|
|
|
|
|+ Purpose.field purpose
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
2025-12-04 16:45:03 +01:00
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.purse_timeout)
|
|
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.kyc_timeout)
|
|
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.history_expiration)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.history_fee)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.kyc_fee)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.account_fee)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.purse_fee)
|
|
|
|
|
|+ field beint32 (fun t -> t.purse_account_limit)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterWireDetails = struct
|
2025-12-04 16:53:53 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_DETAILS *)
|
|
|
|
|
type r = {
|
|
|
|
|
h_wire_details: FullPaytoHash.t;
|
|
|
|
|
h_conversion_url: Hash_64_cstr.t;
|
|
|
|
|
h_credit_restrictions: Hash_64_cstr.t;
|
|
|
|
|
h_debit_restrictions: Hash_64_cstr.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_conversion_url)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_credit_restrictions)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_debit_restrictions)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAddWire = struct
|
2025-12-04 16:53:53 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_ADD_WIRE *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
2025-12-04 16:53:53 +01:00
|
|
|
h_wire: FullPaytoHash.t;
|
|
|
|
|
h_conversion_url: Hash_64_cstr.t;
|
|
|
|
|
h_credit_restrictions: Hash_64_cstr.t;
|
|
|
|
|
h_debit_restrictions: Hash_64_cstr.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
2025-12-04 16:53:53 +01:00
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_wire)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_conversion_url)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_credit_restrictions)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_debit_restrictions)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDelWire = struct
|
2025-12-04 17:10:13 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_DEL_WIRE *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
end_date: TimestampNBO.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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
2025-12-04 17:10:13 +01:00
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_wire)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterDrainProfit = struct
|
2025-12-04 17:16:41 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_DRAIN_PROFITS *)
|
|
|
|
|
type r = {
|
|
|
|
|
wtid: WireTransferIdentifierRawP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
date: TimestampNBO.t;
|
2025-12-04 17:16:41 +01:00
|
|
|
amount: AmountNBO.t;
|
|
|
|
|
h_section: Hash_64_cstr.t;
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.date)
|
2025-12-04 17:16:41 +01:00
|
|
|
|+ field AmountNBO.bin (fun t -> t.amount)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_section)
|
|
|
|
|
|+ field FullPaytoHash.bin (fun t -> t.h_payto)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MasterAmlOfficerStatus = struct
|
2025-12-04 17:26:19 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_AML_KEY *)
|
|
|
|
|
type r = {
|
|
|
|
|
change_date: TimestampNBO.t;
|
|
|
|
|
officer_pub: AmlOfficerPublicKeyP.t;
|
|
|
|
|
h_officer_name: Hash_64_cstr.t;
|
|
|
|
|
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
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.change_date)
|
|
|
|
|
|+ field AmlOfficerPublicKeyP.bin (fun t -> t.officer_pub)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_officer_name)
|
|
|
|
|
|+ field beint32 (fun t -> t.is_active)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PartnerConfiguration = struct
|
2025-12-04 17:35:48 +01:00
|
|
|
module R = struct
|
2025-12-04 17:50:49 +01:00
|
|
|
(* TODO purpose
|
|
|
|
|
this purpose is used 2 times!? *)
|
2025-12-04 17:35:48 +01:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_PARNTER_DETAILS *)
|
|
|
|
|
type r = {
|
|
|
|
|
partner_pub: MasterPublicKeyP.t;
|
|
|
|
|
start_date: TimestampNBO.t;
|
|
|
|
|
end_date: TimestampNBO.t;
|
|
|
|
|
wad_frequency: TimeRelativeNBO.t;
|
|
|
|
|
wad_fee: AmountNBO.t;
|
|
|
|
|
h_url: Hash_64_cstr.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
|
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.wad_frequency)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.wad_fee)
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_url)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WadPartnerSignature = struct
|
2025-12-04 17:50:49 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_PARTNER_DETAILS *)
|
|
|
|
|
type r = {
|
|
|
|
|
h_partner_base_url: Hash_64_cstr.t;
|
|
|
|
|
master_public_key: MasterPublicKeyP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
|
|
|
|
end_date: TimestampNBO.t;
|
2025-12-04 17:50:49 +01:00
|
|
|
wad_fee: AmountNBO.t;
|
|
|
|
|
wad_frequency: TimeRelativeNBO.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_partner_base_url)
|
|
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master_public_key)
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
2025-12-04 17:50:49 +01:00
|
|
|
|+ field AmountNBO.bin (fun t -> t.wad_fee)
|
|
|
|
|
|+ field TimeRelativeNBO.bin (fun t -> t.wad_frequency)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
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
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MASTER_WIRE_FEES *)
|
|
|
|
|
type r = {
|
|
|
|
|
h_wire_method: Hash_64_cstr.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
|
|
|
|
end_date: TimestampNBO.t;
|
2025-12-04 17:54:40 +01:00
|
|
|
wire_fee: AmountNBO.t;
|
|
|
|
|
closing_fee: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.h_wire_method)
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start_date)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.end_date)
|
2025-12-04 17:54:40 +01:00
|
|
|
|+ field AmountNBO.bin (fun t -> t.wire_fee)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.closing_fee)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
include MK (R)
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeKeyValidity = struct
|
2025-12-04 17:59:07 +01:00
|
|
|
module R = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS *)
|
|
|
|
|
type r = {
|
|
|
|
|
auditor_url_hash: Hash_64_cstr.t;
|
|
|
|
|
master: MasterPublicKeyP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
start: TimestampNBO.t;
|
|
|
|
|
expire_withdraw: TimestampNBO.t;
|
|
|
|
|
expire_spend: TimestampNBO.t;
|
|
|
|
|
expire_legal: TimestampNBO.t;
|
2025-12-04 17:59:07 +01:00
|
|
|
value: AmountNBO.t;
|
|
|
|
|
fee_withdraw: AmountNBO.t;
|
|
|
|
|
fee_deposit: AmountNBO.t;
|
|
|
|
|
fee_refresh: AmountNBO.t;
|
|
|
|
|
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
|
|
|
|
|
|+ field Hash_64_cstr.bin (fun t -> t.auditor_url_hash)
|
|
|
|
|
|+ field MasterPublicKeyP.bin (fun t -> t.master)
|
2026-02-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.start)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_withdraw)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_spend)
|
|
|
|
|
|+ field TimestampNBO.bin (fun t -> t.expire_legal)
|
2025-12-04 17:59:07 +01:00
|
|
|
|+ field AmountNBO.bin (fun t -> t.value)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_withdraw)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_deposit)
|
|
|
|
|
|+ field AmountNBO.bin (fun t -> t.fee_refresh)
|
|
|
|
|
|+ field DenominationHash.bin (fun t -> t.denom_hash)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
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
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_KEY_SET *)
|
|
|
|
|
type r = {
|
2026-02-05 17:03:53 +01:00
|
|
|
list_issue_date: TimestampNBO.t;
|
2025-12-06 17:49:25 +01:00
|
|
|
hc: Hash_64.t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
|+ field TimestampNBO.bin (fun t -> t.list_issue_date)
|
2025-12-06 17:49:25 +01:00
|
|
|
|+ field Hash_64.bin (fun t -> t.hc)
|
|
|
|
|
|> sealr
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
include R
|
|
|
|
|
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
|
2025-10-07 12:02:16 +02:00
|
|
|
(* Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_WITHDRAW.
|
|
|
|
|
Signed by a `struct TALER_ExchangePrivateKeyP` using EdDSA. *)
|
2025-10-07 11:45:15 +02:00
|
|
|
type t = {
|
|
|
|
|
(* TODO TALER doc
|
|
|
|
|
missing TALER_HashBlindedPlanchetsP*)
|
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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW *)
|
|
|
|
|
type t = {
|
|
|
|
|
amount_with_fee: AmountNBO.t;
|
|
|
|
|
h_denomination_pub: DenominationHash.t;
|
|
|
|
|
h_coin_envelope: BlindedCoinHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DepositRequest = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_DEPOSIT *)
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.t;
|
|
|
|
|
refund_deadline: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
amount_with_fee: AmountNBO.t;
|
|
|
|
|
deposit_fee: AmountNBO.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
wallet_data_hash: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DepositConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT *)
|
|
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
h_policy: ExtensionsPolicyHash.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.t;
|
|
|
|
|
refund_deadline: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
amount_without_fee: AmountNBO.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefreshMeltCoinAffirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_MELT *)
|
|
|
|
|
type t = {
|
|
|
|
|
session_hash: RefreshCommitmentP.t;
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
h_age_commitment: AgeCommitmentHash.t;
|
|
|
|
|
amount_with_fee: AmountNBO.t;
|
|
|
|
|
melt_fee: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefreshMeltConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_MELT *)
|
|
|
|
|
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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *)
|
|
|
|
|
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-05 17:03:53 +01:00
|
|
|
execution_time: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
deposit_value: AmountNBO.t;
|
|
|
|
|
deposit_fee: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module WireDepositData = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE_DEPOSIT *)
|
|
|
|
|
type t = {
|
|
|
|
|
total: AmountNBO.t;
|
|
|
|
|
wire_fee: AmountNBO.t;
|
|
|
|
|
merchant_pub: MerchantPublicKeyP.t;
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_details: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PaymentResponse = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_PAYMENT_OK *)
|
|
|
|
|
type t = { h_contract_terms: PrivateContractHash.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module Contract = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_CONTRACT *)
|
|
|
|
|
type t = { h_contract_terms: PrivateContractHash.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ConfirmWire = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_WIRE *)
|
|
|
|
|
type t = {
|
|
|
|
|
h_wire: MerchantWireHash.t;
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
wtid: WireTransferIdentifierRawP.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
execution_time: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
coin_contribution: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RefundConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND *)
|
|
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
merchant: MerchantPublicKeyP.t;
|
|
|
|
|
rtransaction_id: int64;
|
|
|
|
|
refund_amount: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module DepositTrackPS2 = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_TRACK_TRANSACTION *)
|
|
|
|
|
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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND *)
|
|
|
|
|
type t = {
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
rtransaction_id: int64;
|
|
|
|
|
refund_amount: AmountNBO.t;
|
|
|
|
|
refund_fee: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module MerchantRefundConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_MERCHANT_REFUND_OK *)
|
|
|
|
|
(* Hash of the order ID (a string), hashed without the 0-termination. *)
|
2025-11-21 19:29:04 +01:00
|
|
|
type t = { h_order_id: Hash_64_cstr.t }
|
2025-10-08 21:17:03 +02:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupRequest = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_RECOUP or TALER_SIGNATURE_WALLET_COIN_RECOUP_REFRESH *)
|
|
|
|
|
type t = {
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
coin_blind: DenominationBlindingKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupRefreshConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
recoup_amount: AmountNBO.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
old_coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module RecoupConfirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
recoup_amount: AmountNBO.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module DenominationUnknownAffirmation = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_AFFIRM_DENOM_UNKNOWN *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_GENERIC_DENOMINATIN_EXPIRED *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
timestamp: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
closing_amount: AmountNBO.t;
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
h_wire: FullPaytoHash.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module CoinLinkSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK *)
|
|
|
|
|
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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_COIN_LINK *)
|
|
|
|
|
type t = { nonce: PublicRefreshCoinNonceP.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveStatusRequestSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_RESERVE_STATUS_REQUEST *)
|
2026-02-05 17:03:53 +01:00
|
|
|
type t = { request_timestamp: TimestampNBO.t }
|
2025-10-08 21:17:03 +02:00
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveHistoryRequestSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_RESERVE_HISTORY_REQUEST *)
|
|
|
|
|
type t = {
|
|
|
|
|
history_fee: AmountNBO.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
request_timestamp: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseStatusRequestSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_REQUEST *)
|
|
|
|
|
type t = unit
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseStatusResponseSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_PURSE_STATUS_RESPONSE *)
|
|
|
|
|
type t = {
|
|
|
|
|
total_purse_amount: AmountNBO.t;
|
|
|
|
|
total_deposit_amount: AmountNBO.t;
|
|
|
|
|
max_deposit_fees: AmountNBO.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
purse_expiration: TimestampNBO.t;
|
|
|
|
|
status_timestamp: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE *)
|
|
|
|
|
type t = unit
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseRequestSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_CREATE *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
purse_expiration: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
merge_value_after_fees: AmountNBO.t;
|
|
|
|
|
h_contract_terms: PrivateContractHash.t;
|
|
|
|
|
min_age: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseDepositSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT *)
|
|
|
|
|
type t = {
|
|
|
|
|
coin_contribution: AmountNBO.t;
|
|
|
|
|
h_denom_pub: DenominationHash.t;
|
|
|
|
|
h_age_commitment: AgeCommitmentHash.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_exchange_base_url: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
module PurseDepositSignaturePS2 = struct
|
|
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT *)
|
|
|
|
|
type t = {
|
|
|
|
|
reserve_sig: ReserveSignatureP.t;
|
|
|
|
|
coin_contribution: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseDepositConfirmedSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_PURSE_DEPOSIT_CONFIRMED *)
|
|
|
|
|
type t = {
|
|
|
|
|
total_purse_amount: AmountNBO.t;
|
|
|
|
|
total_deposit_fees: AmountNBO.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
purse_expiration: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_PURSE_MERGE *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
merge_timestamp: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_MERGE *)
|
|
|
|
|
type t = {
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
|
|
|
|
merge_amount_after_fees: AmountNBO.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
merge_timestamp: TimestampNBO.t;
|
|
|
|
|
purse_expiration: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_ACCOUNT_SETUP *)
|
|
|
|
|
type t = { threshold: AmountNBO.t }
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module PurseMergeSuccessSignature = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_PURSE_MERGE_SUCCESS *)
|
|
|
|
|
type t = {
|
|
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
|
|
|
|
merge_amount_after_fees: AmountNBO.t;
|
2026-02-05 17:03:53 +01:00
|
|
|
contract_time: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WAD_DATA *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
wad_execution_time: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
total_amount: AmountNBO.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_items: Hash_64_cstr.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_P2P_FEES *)
|
|
|
|
|
type t = {
|
2026-02-05 17:03:53 +01:00
|
|
|
start_date: TimestampNBO.t;
|
|
|
|
|
end_date: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
kyc_fee: AmountNBO.t;
|
|
|
|
|
purse_fee: AmountNBO.t;
|
|
|
|
|
account_history_fee: AmountNBO.t;
|
|
|
|
|
account_annual_fee: AmountNBO.t;
|
2025-10-08 21:38:30 +02:00
|
|
|
account_kyc_timeout: TimeRelativeNBO.t;
|
|
|
|
|
purse_timeout: TimeRelativeNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_CONFIRM_PURSE_REFUND *)
|
|
|
|
|
type t = {
|
|
|
|
|
purse_pub: PursePublicKey.t;
|
|
|
|
|
coin_pub: CoinSpendPublicKeyP.t;
|
|
|
|
|
refunded_amount: AmountNBO.t;
|
|
|
|
|
refund_fee: AmountNBO.t;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module AmlDecision = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_AML_DECISION *)
|
|
|
|
|
type t = {
|
2025-11-21 19:29:04 +01:00
|
|
|
h_justification: Hash_64_cstr.t;
|
2025-10-09 02:38:34 +02:00
|
|
|
decision_time: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
new_threshold: AmountNBO.t;
|
|
|
|
|
h_payto: NormalizedPaytoHash.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_kyc_requirements: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
new_state: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveOpen = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_OPEN *)
|
|
|
|
|
type t = {
|
|
|
|
|
reserve_payment: AmountNBO.t;
|
2025-10-09 02:38:34 +02:00
|
|
|
request_timestamp: TimestampNBO.t;
|
|
|
|
|
reserve_expiration: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
purse_limit: int;
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ReserveClose = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_RESERVE_CLOSE *)
|
|
|
|
|
type t = {
|
2025-10-09 02:38:34 +02:00
|
|
|
request_timestamp: TimestampNBO.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
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_WALLET_ATTEST_REQUEST *)
|
|
|
|
|
type t = {
|
2025-10-09 02:38:34 +02:00
|
|
|
request_timestamp: TimestampNBO.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_details: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
2025-12-07 05:43:04 +01:00
|
|
|
module ExchangeAttest = struct
|
2025-10-08 21:17:03 +02:00
|
|
|
(* purpose.purpose = TALER_SIGNATURE_EXCHANGE_RESERVE_ATTEST_DETAILS *)
|
|
|
|
|
type t = {
|
2025-10-09 02:38:34 +02:00
|
|
|
attest_timestamp: TimestampNBO.t;
|
|
|
|
|
expiration_time: TimestampNBO.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
reserve_pub: ReservePublicKeyP.t;
|
2025-11-21 19:29:04 +01:00
|
|
|
h_attributes: Hash_64_cstr.t;
|
2025-10-08 21:17:03 +02:00
|
|
|
}
|
|
|
|
|
end
|