Labyrinth
WhitepaperResearchGet Private Access
  • 🔭Labyrinth Overview
    • Introduction
    • Why Labyrinth?
    • Who can use Labyrinth?
    • Reward and Fee in Labyrinth
    • Compliance
  • ⭐Use Labyrinth web App
    • How to use the Labyrinth app?
  • 📦Labyrinth SDK
    • ❓What is Labyrinth SDK?
    • ⚒️Quickstart
      • Setup Environment
      • Initialization
      • Private Transactions
      • Balance And Transaction History
      • Protocol Integration
    • 1️⃣Getting Started
    • 🔐Shielded Account
    • 📈Transaction
    • ▶️Initializing SDK
    • 💰Balances And History
    • 📤Sending Transaction
    • 🔌Integrating with DeFi Protocols
    • Labyrinth fee structure
  • Compliance Solution
    • Overview of Compliance
    • How Compliance Works
  • 💻CLI
    • ▶️Running SeDe CLI
  • Technical Implementation
    • Cryptographic Primitives
    • Shielded Account
    • Shielded Address
    • Account Abstraction
    • 🔵Core Architecture
      • 💵Note
      • 🌲Merkle Tree
      • 🔀JoinSplits
      • 🛡️Shielded Transaction
    • 🔄Protocol Interoperability
  • Resource and support
    • Roadmap
    • FAQs
    • Whitepaper
    • Selective De-Anonymization Compliance Paper
  • Contact and socials
    • Labyrinth Website
    • Twitter
    • Discord
    • Contact Us
Powered by GitBook
On this page
  • Elliptic Curve Cryptography (ECC)
  • Zero-Knowledge Proofs (ZKPs)
  • Hashing Algorithm
  • Digital Signatures
  • Threshold Cryptography
  • Encryption Schemes
  1. Technical Implementation

Cryptographic Primitives

Cryptographic primitives used in Labyrinth

PreviousRunning SeDe CLINextShielded Account

Last updated 10 months ago

Elliptic Curve Cryptography (ECC)

Our protocol uses the ECC operations on a specific curve called the Baby JubJub Elliptic Curve. The reason for the choice of the curve is that it is specifically designed for use in the Zero Knowledge Proofs (ZKPs) which is the basis privacy facet of the protocol. Baby JubJub is defined in detail in.

Zero-Knowledge Proofs (ZKPs)

Labyrinth's whole privacy facet is centered around the extensive use of ZKPs. It uses a particular type of ZKPs called zkSNARK (Zero-Knowledge Succinct Argument Of Knowledge) attributed to its constant size of small proofs and faster verification. Specifically, we utilize the protocol for generating proof with such properties (zkSNARKs), which makes it a favorable choice for environments like smart contract platforms or blockchains.

Hashing Algorithm

The protocol requires the usage of hashing one or more variables at different stages. For any usage of hashing that appears inside a ZK circuit (i.e. needs to be proved), we utilize Poseidon Hash. Detailed information about it can be found in its . Our protocol specifically uses implementation as laid out .

Other than that, we use hashing algorithm, at places where it does not require any proving by using it in a ZK circuit.

Digital Signatures

The protocol uses a scheme where digital signatures are required and must be implemented in a circuit. We use an implementation of the Schnorr signature over the Baby JubJub curve with Poseidon as a choice for the hash function. Schnorr signatures are efficient and generate shorter signatures, hence a good choice for use in ZK applications.

Threshold Cryptography

A threshold cryptosystem is a cryptosystem that allows a group of entities to share a secret key in such a way that a particular size of subset of this group can perform cryptographic operations, such as encryption, decryption, and digital signatures.

If nnn is the number of entities involved and $t$ is the minimum subset size (t≤nt \leq nt≤n) to perform the cryptographic operation then the system is called (t,n)(t, n)(t,n)-threshold system. It is possible to define operations like (t,n)(t, n)(t,n)-encryption schemes and (t,n)(t, n)(t,n)-signature schemes.

It has multiple benefits over traditional cryptosystems, such as in terms of improved security, reduced risk of fraud, and increased fault tolerance.

Encryption Schemes

We mainly use two encryption schemes, depending on the contexts where the encryption algorithm needs to be executed.

is a fast stream cipher that has been standardized in . We use this encryption to encrypt transaction-related data. The resulting ciphertext is solely for use as a reference for the user to be able to use it to perform future transactions spending its assets.

is an asymmetric key encryption scheme that uses public key cryptography. It is based on the Diffie-Hellman key exchange protocol. The choice for this scheme (defined on Baby JubJub) in our protocol arises from the need for an in-circuit efficient encryption mechanism. We need this property for the provable El Gamal encryption of some transactions by users for compliance purposes.

EIP-2494
groth16
research paper
here in Circomlib
keccak256
Schnorr signature
chacha20poly1305
RFC 8439
El Gamal