> For the complete documentation index, see [llms.txt](https://docs.midnight.network/llms.txt)

# Compact standard library

**CompactStandardLibrary** ∙ [Detailed API reference](https://docs.midnight.network/compact/standard-library/exports.md)

This API provides standard types and circuits for use in Compact programs. Key parts of the API are:

* Common data types:

  <!-- -->

  * [`Maybe`](https://docs.midnight.network/compact/standard-library/exports.md#maybe)
  * [`Either`](https://docs.midnight.network/compact/standard-library/exports.md#either)
  * [`PublicAddress`](https://docs.midnight.network/compact/standard-library/exports.md#publicaddress)
  * [`MerkleTreeDigest`](https://docs.midnight.network/compact/standard-library/exports.md#merkletreedigest)
  * [`MerkleTreePathEntry`](https://docs.midnight.network/compact/standard-library/exports.md#merkletreepathentry)
  * [`MerkleTreePath`](https://docs.midnight.network/compact/standard-library/exports.md#merkletreepath)
  * [`ContractAddress`](https://docs.midnight.network/compact/standard-library/exports.md#contractaddress)
  * [`ZswapCoinPublicKey`](https://docs.midnight.network/compact/standard-library/exports.md#zswapcoinpublickey)
  * [`UserAddress`](https://docs.midnight.network/compact/standard-library/exports.md#useraddress)

* Coin management data types:

  <!-- -->

  * [`ShieldedCoinInfo`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedcoininfo)
  * [`QualifiedShieldedCoinInfo`](https://docs.midnight.network/compact/standard-library/exports.md#qualifiedshieldedcoininfo)
  * [`ShieldedSendResult`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedsendresult)

* Common functions:

  <!-- -->

  * [`some`](https://docs.midnight.network/compact/standard-library/exports.md#some)
  * [`none`](https://docs.midnight.network/compact/standard-library/exports.md#none)
  * [`left`](https://docs.midnight.network/compact/standard-library/exports.md#left)
  * [`right`](https://docs.midnight.network/compact/standard-library/exports.md#right)

* Hashing functions:

  <!-- -->

  * [`transientHash`](https://docs.midnight.network/compact/standard-library/exports.md#transienthash)
  * [`transientCommit`](https://docs.midnight.network/compact/standard-library/exports.md#transientcommit)
  * [`persistentHash`](https://docs.midnight.network/compact/standard-library/exports.md#persistenthash)
  * [`persistentCommit`](https://docs.midnight.network/compact/standard-library/exports.md#persistentcommit)
  * [`degradeToTransient`](https://docs.midnight.network/compact/standard-library/exports.md#degradetotransient)
  * [`upgradeFromTransient`](https://docs.midnight.network/compact/standard-library/exports.md#upgradefromtransient)
  * [`keccak256`](https://docs.midnight.network/compact/standard-library/exports.md#keccak256)
  * [`sha512`](https://docs.midnight.network/compact/standard-library/exports.md#sha512)

* Elliptic curve types and functions:

  <!-- -->

  * [`JubjubPoint`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubpoint)
  * [`JubjubScalar`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubscalar)
  * [`constructJubjubPoint`](https://docs.midnight.network/compact/standard-library/exports.md#constructjubjubpoint)
  * [`jubjubPointX`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubpointx)
  * [`jubjubPointY`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubpointy)
  * [`Secp256k1Point`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1point)
  * [`Secp256k1Base`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1base)
  * [`Secp256k1Scalar`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1scalar)
  * [`secp256k1PointX`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1pointx)
  * [`secp256k1PointY`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1pointy)
  * [`ecAdd`](https://docs.midnight.network/compact/standard-library/exports.md#ecadd)
  * [`ecNeg`](https://docs.midnight.network/compact/standard-library/exports.md#ecneg)
  * [`ecMul`](https://docs.midnight.network/compact/standard-library/exports.md#ecmul)
  * [`ecMulGenerator`](https://docs.midnight.network/compact/standard-library/exports.md#ecmulgenerator)
  * [`hashToCurve`](https://docs.midnight.network/compact/standard-library/exports.md#hashtocurve)

* Field arithmetic functions:

  <!-- -->

  * [`neg`](https://docs.midnight.network/compact/standard-library/exports.md#neg)
  * [`inv`](https://docs.midnight.network/compact/standard-library/exports.md#inv)

* Merkle tree functions:

  <!-- -->

  * [`merkleTreePathRoot`](https://docs.midnight.network/compact/standard-library/exports.md#merkletreepathroot)
  * [`merkleTreePathRootNoLeafHash`](https://docs.midnight.network/compact/standard-library/exports.md#merkletreepathrootnoleafhash)

* Coin management functions:

  <!-- -->

  * [`tokenType`](https://docs.midnight.network/compact/standard-library/exports.md#tokentype)
  * [`nativeToken`](https://docs.midnight.network/compact/standard-library/exports.md#nativetoken)
  * [`ownPublicKey`](https://docs.midnight.network/compact/standard-library/exports.md#ownpublickey)
  * [`createZswapInput`](https://docs.midnight.network/compact/standard-library/exports.md#createzswapinput)
  * [`createZswapOutput`](https://docs.midnight.network/compact/standard-library/exports.md#createzswapoutput)
  * [`mintShieldedToken`](https://docs.midnight.network/compact/standard-library/exports.md#mintshieldedtoken)
  * [`evolveNonce`](https://docs.midnight.network/compact/standard-library/exports.md#evolvenonce)
  * [`receiveShielded`](https://docs.midnight.network/compact/standard-library/exports.md#receiveshielded)
  * [`sendShielded`](https://docs.midnight.network/compact/standard-library/exports.md#sendshielded)
  * [`sendImmediateShielded`](https://docs.midnight.network/compact/standard-library/exports.md#sendimmediateshielded)
  * [`mergeCoin`](https://docs.midnight.network/compact/standard-library/exports.md#mergecoin)
  * [`mergeCoinImmediate`](https://docs.midnight.network/compact/standard-library/exports.md#mergecoinimmediate)
  * [`shieldedBurnAddress`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedburnaddress)
  * [`mintUnshieldedToken`](https://docs.midnight.network/compact/standard-library/exports.md#mintunshieldedtoken)
  * [`sendUnshielded`](https://docs.midnight.network/compact/standard-library/exports.md#sendunshielded)
  * [`receiveUnshielded`](https://docs.midnight.network/compact/standard-library/exports.md#receiveunshielded)
  * [`unshieldedBalance`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedbalance)
  * [`unshieldedBalanceLt`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedbalancelt)
  * [`unshieldedBalanceGte`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedbalancegte)
  * [`unshieldedBalanceGt`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedbalancegt)
  * [`unshieldedBalanceLte`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedbalancelte)

* Block time functions:

  <!-- -->

  * [`blockTimeLt`](https://docs.midnight.network/compact/standard-library/exports.md#blocktimelt)
  * [`blockTimeGte`](https://docs.midnight.network/compact/standard-library/exports.md#blocktimegte)
  * [`blockTimeGt`](https://docs.midnight.network/compact/standard-library/exports.md#blocktimegt)
  * [`blockTimeLte`](https://docs.midnight.network/compact/standard-library/exports.md#blocktimelte)

* Cryptographic signature types and functions:

  <!-- -->

  * [`JubjubSchnorrSignature`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubschnorrsignature)
  * [`jubjubSchnorrVerify`](https://docs.midnight.network/compact/standard-library/exports.md#jubjubschnorrverify)
  * [`Secp256k1EcdsaSignature`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1ecdsasignature)
  * [`secp256k1EcdsaVerify`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1ecdsaverify)
  * [`secp256k1EthereumAddress`](https://docs.midnight.network/compact/standard-library/exports.md#secp256k1ethereumaddress)

* Ledger fields:
  <!-- -->
  * [`kernel`](https://docs.midnight.network/compact/standard-library/exports.md#kernel) -- see [Ledger data types](https://docs.midnight.network/ledger-adt.mdx) for its operations

* [Events](https://docs.midnight.network/compact/standard-library/exports.md#events) that can be emitted with `emit`:

  <!-- -->

  * [`ShieldedSpend`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedspend), [`ShieldedReceive`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedreceive), [`ShieldedMint`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedmint), [`ShieldedBurn`](https://docs.midnight.network/compact/standard-library/exports.md#shieldedburn)
  * [`UnshieldedSpend`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedspend), [`UnshieldedReceive`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedreceive), [`UnshieldedMint`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedmint), [`UnshieldedBurn`](https://docs.midnight.network/compact/standard-library/exports.md#unshieldedburn)
  * [`Paused`](https://docs.midnight.network/compact/standard-library/exports.md#paused), [`Unpaused`](https://docs.midnight.network/compact/standard-library/exports.md#unpaused), [`Misc`](https://docs.midnight.network/compact/standard-library/exports.md#misc)
