Skip to content

Smart Wallet: Architecture

To build an application that uses Smart Wallet features, it is useful to understand how different application components interact with each other. The diagram below provides a high-level picture.

    graph LR
        WalletLibrary["Smart Wallet API Library"]
        subgraph Client["Client Application"]
            WalletLibrary
        end

        Indexer["Cardano Data Indexer"]

        WalletBackend["Smart Wallet Backend Services"]

        ZKProver["ZK Prover Service"]

        subgraph Cardano["Cardano Blockchain"]
            SC["Wallet Smart Contract"]
        end

        Cardano --> Indexer
        Indexer --> WalletBackend

        WalletLibrary <--> WalletBackend
        WalletLibrary <--> ZKProver

        WalletBackend --> SC

To integrate the Smart Wallet into a client application, developers could either use Smart Wallet Backend and ZK Prover APIs directly, or utilize the Smart Wallet API library provided by zkFold (in TypeScript or Kotlin). Additionally, developers should consider whether they want to deploy their own instance of ZK Prover Service or use the ones provided by zkFold.

Components

Smart Wallet API Library

The library provides a set of APIs to be used by wallet apps. This component is also responsible for any client-side logic, such as key management and proof generation from Web2 authentication tokens. The library comes in two flavours: for browsers in TypeScript and for mobile devices in Kotlin.

Smart Wallet Backend Services

This component performs the off-chain computations for the Smart Wallet transactions. It receives the transaction data from the application and builds the transaction. It can also submit transactions to the blockchain and send email notifications to the recipients.

ZK Prover Service

ZK Prover Service is a backend infrastructure component that provides zero-knowledge proof generation API. This component is open-sourced and can be set up on your infrastructure. Alternatively, we provide it as a service (currently, free of charge).