Environment: add Sapling.Core

Co-authored-by: Marc Beunardeau's avatarMarc beunardeau <[email protected]>
Co-authored-by: Mehdi Bouaziz's avatarMehdi Bouaziz <[email protected]>
parent 8d0325da
......@@ -2,6 +2,7 @@
(name tezos_protocol_environment)
(public_name tezos-protocol-environment)
(libraries tezos-base
sapling
tezos-protocol-environment-sigs
tezos-micheline)
(flags (:standard -open Tezos_base__TzPervasives
......
......@@ -71,6 +71,7 @@ module type V1 = sig
and type (+'m, 'pr, 'p, 'q, 'i, 'o) RPC_service.t =
('m, 'pr, 'p, 'q, 'i, 'o) RPC_service.t
and type Error_monad.shell_error = Error_monad.error
and module Sapling.Core = Sapling.Core.Baker
type error += Ecoproto_error of Error_monad.error
......@@ -783,6 +784,10 @@ struct
Lwt.return_ok (Some v)
end
module Sapling = struct
module Core = Sapling.Core.Baker
end
module Micheline = struct
include Micheline
......
......@@ -71,6 +71,7 @@ module type V1 = sig
and type (+'m, 'pr, 'p, 'q, 'i, 'o) RPC_service.t =
('m, 'pr, 'p, 'q, 'i, 'o) RPC_service.t
and type Error_monad.shell_error = Error_monad.error
and module Sapling.Core = Sapling.Core.Baker
type error += Ecoproto_error of Error_monad.error
......
......@@ -49,6 +49,7 @@
v1/operation_list_list_hash.mli
v1/protocol_hash.mli
v1/context_hash.mli
v1/sapling.mli
;; Tezos specifics
v1/micheline.mli
......
module Core : sig
module Ciphertext : sig
type t
val encoding : t Data_encoding.t
end
module Commitment : sig
type t
val encoding : t Data_encoding.t
end
module CV : sig
type t
val encoding : t Data_encoding.t
end
module Hash : sig
type t
val compare : t -> t -> int
val encoding : t Data_encoding.t
val to_bytes : t -> Bytes.t
val of_bytes_exn : Bytes.t -> t
val uncommitted : t
val merkle_hash : height:int -> t -> t -> t
val of_commitment : Commitment.t -> t
val to_commitment : t -> Commitment.t
end
module Nullifier : sig
type t
val encoding : t Data_encoding.t
val compare : t -> t -> int
end
module UTXO : sig
type rk
type spend_proof
type spend_sig
type output_proof
type input = {
cv_i : CV.t;
nf : Nullifier.t;
rk : rk;
proof_i : spend_proof;
signature : spend_sig;
}
val input_encoding : input Data_encoding.t
type output = {
cv_o : CV.t;
cm : Commitment.t;
proof_o : output_proof;
ciphertext : Ciphertext.t;
}
val output_encoding : output Data_encoding.t
type binding_sig
type transaction = {
inputs : input list;
outputs : output list;
binding_sig : binding_sig;
balance : Int64.t;
root : Hash.t;
}
val transaction_encoding : transaction Data_encoding.t
val binding_sig_encoding : binding_sig Data_encoding.t
end
module Verification : sig
type t
val init : unit -> t
val free : t -> unit
val check_spend : t -> UTXO.input -> Hash.t -> string -> bool
val check_output : t -> UTXO.output -> bool
val final_check : t -> UTXO.transaction -> string -> bool
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment