1. Overview
  2. Docs
Module type
Class type

This module allows the creation Sapling transactions: shield, unshield and transfer. Because Sapling uses an UTXO model, it is necessary for the client to maintain locally the set of unspent outputs for each viewing key, for each smart contract. This operation is called scanning. This local cache is updated downloading from the node only the difference from the last scanned state.

module Shielded_tez : sig ... end

This module is used to represent any shielded token to avoid confusing it with Tez.

module Shielded_tez_contract_input : sig ... end

Actual input to a smart contract handling Sapling transactions

module Account : sig ... end

Account corresponding to a contract and a viewing key

module Contract_state : sig ... end

State of a contract, potentially involving several viewing keys

module Client_state : sig ... end

shield ~message ~dst tez cstate anti-replay returns a transaction shielding tez tez to a sapling address dst using a sapling storage cstate and the anti-replay string.

unshield ~src_name ~src ~dst ~backdst stez cstate storage returns a transaction unshielding stez shielded tokens from a sapling wallet src to a transparent tezos address dst, sending the change back to backdst and using a Sapling storage cstate and a anti-replay string. The transaction is refused if there is an insufficient amount of shielded tez in the wallet src, the error is raised with src_name.

transfer ~message ~src ~dst ~backdst amount cstate anti-replay creates a Sapling transaction of amount shielded tez from Sapling wallet src to Sapling address dst, sending the change to backdst, using a Sapling storage cstate and a anti-replay string. ~message is a message that will be uploaded encrypted on chain.