LogoLogo
  • Welcome
    • Introducing Pico
  • Getting Started
    • Installation
    • Quick start
  • Writing Apps
    • Programs
    • Proving
    • Features
    • Advanced
      • Instances
      • ProverChain
      • Proving Backends
  • Integrating Coprocessors
    • Function-level
    • Application-level
Powered by GitBook
On this page
  • Work Flow
  • List of Syscalls
  • List of patches
Export as PDF
  1. Integrating Coprocessors

Function-level

Integrating specialized circuits within Pico

PreviousProving BackendsNextApplication-level

Last updated 24 days ago

Function-level coprocessors—commonly known as precompiles—are specialized circuits within Pico designed to optimize and streamline specific cryptographic operations and computational tasks. These precompiles handle operations such as elliptic curve arithmetic, hash functions, and signature verifications. In a general-purpose environment, these operations can be resource-intensive, but by offloading them to dedicated circuits, Pico significantly reduces computational costs, improves performance, and enhances scalability during proof generation and verification. Packaging these core operations into efficient, well-tested modules not only accelerates development cycles but also establishes a secure foundation for a wide range of zk-applications, including privacy-preserving transactions, rollups, and layer-2 scaling solutions.

Work Flow

Below is an example workflow of Keccak256 hash permutation precompile in Pico.

The Pico precompiles workflow involves several steps to efficiently execute and verify cryptographic operations. To illstrate how it works, we use Keccak-256 precompile as an example:

  1. Keccak256 Precompile: When a Keccak-256 hashing function is invoked, Pico’s Keccak256 precompile is triggered to handle the specific permutation operations. This specialized circuit, known internally as the keccak256_permute_syscall, is optimized for performance, minimizing overhead and improving provability.

  2. Rust Toolchain & ELF Generation: The Rust toolchain compiles your code, including the tiny-keccak patch, into an Executable and Linkable Format (ELF) file, which is the RISC0's support for zkVM executables.

By following this workflow, developers can perform cryptographic operations more efficiently and securely, taking full advantage of Pico’s precompile features to reduce proof overhead and streamline the development of ZK apps.

List of Syscalls

List of patches

Pico is currently supporting the following patches:

Patch Name
Github link
branch

tiny-keccak

https://github.com/brevis-network/tiny-keccak

sha2

https://github.com/brevis-network/hashes

sha3

https://github.com/brevis-network/hashes

curve25519-dalek

https://github.com/brevis-network/curve25519-dalek

bls12381

https://github.com/brevis-network/bls12_381

curve25519-dalek-ng

https://github.com/brevis-network/curve25519-dalek-ng

ed25519-consensus

https://github.com/brevis-network/ed25519-consensus

ecdsa-core

https://github.com/brevis-network/signatures

secp256k1

https://github.com/brevis-network/rust-secp256k1

substate-bn

https://github.com/brevis-network/bn

bigint

https://github.com/brevis-network/crypto-bigint

Developer Preparation: Developers begin by writing and preparing the necessary code, including the for cryptographic hashing functions. This library provides the core primitives needed for SHA2, SHA3, and Keccak-based operations.

Tiny-Keccak Patch: Pico uses a forked and zero-knowledge-compatible version of tiny-keccak (sourced from the public ). This patch optimizes hashing operations—particularly Keccak-256—to run efficiently within Pico.

Pico is currently supporting .

tiny-keccak patch
debris repository
these syscalls
pico-patch-v1.0.0-keccak-v2.0.2
pico-patch-v1.0.1-sha2-v0.10.8
pico-patch-v1.0.1-sha3-v0.10.8
pico-patch-v1.0.1-curve25519-dalek-v4.1.3
pico-patch-v1.0.1-bls12_381-v0.8.0
pico-patch-v1.0.1-curve25519-dalek-ng-v4.1.1
pico-patch-v1.0.1-ed25519-consensus-v2.1.0
pico-patch-v1.0.1-ecdsa-0.16.9
pico-patch-v1.0.1-secp256k1-v0.29.1
pico-patch-v1.0.1-bn-v0.6.0
pico-patch-v1.0.0-bigint-v0.6.0
Drawing