This commit is contained in:
swrup 2025-10-07 00:47:46 +02:00
parent 86be1c51a5
commit cccebea04b

View file

@ -51,6 +51,14 @@ module Hash_code = struct
record (fun hash -> { hash }) |+ field (bytes 64) (fun t -> t.hash) |> sealr
end
module Short_hash_code = struct
type t = { hash: string }
let bin =
let open Bin in
record (fun hash -> { hash }) |+ field (bytes 32) (fun t -> t.hash) |> sealr
end
module Denomination_hash = struct
type t = { hash: Hash_code.t }
@ -91,6 +99,30 @@ module Merchant_wire_hash = struct
|> sealr
end
module Full_payto_hash = struct
(* Hash over a full payto://-URI, including receiver-name
(and possibly BIC and other optional fields). *)
type t = { hash: Short_hash_code.t }
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Short_hash_code.bin (fun t -> t.hash)
|> sealr
end
module Normalized_payto_hash = struct
(* Hash over a normalized payto://-URI, including all optional
fields and also with account-part canonicalized (so no BIC). *)
type t = { hash: Short_hash_code.t }
let bin =
let open Bin in
record (fun hash -> { hash })
|+ field Short_hash_code.bin (fun t -> t.hash)
|> sealr
end
(* -- Signatures -- *)
module Purpose = struct