What is Marlin?
Marlin is a verifiable computing protocol leveraging TEEs to allow complex workloads (like DeFi strategies, automation tasks or AI models) to be deployed over a decentralized cloud. It allows both smart contract calls and web2 APIs to be used to rent instances or execute serverless functions. As a result, Marlin can be used as a coprocessor to scale blockchain applications. The compute network is also referred to as Oyster (named after the protocol upgrade that introduced TEE-based general purpose computing).
Kalypso, an illustrative app built on Oyster, is a circuit-agnostic ZK proof marketplace. It connects users who wish to delegate the compute, power and time-intensive task of ZK proof generation to specialized hardware operators who wish to increase resource efficiency. The matching engine for Kalypso is deployed on an Oyster node. This not only enables the matching and cancellation of orders with very low-latency, but also provides Kalypso the unique ability to support use cases involving private inputs.
More information on the Oyster and Kalypso protocols can be found at the links below:
📄️ Oyster In Depth
Oyster is a sub-network of Marlin that specializes in offering TEE-based coprocessors.
📄️ Kalypso In Depth
Increasing number of developers are looking to leverage developments in ZK cryptography to build scaling solutions (validity rollups), coprocessors, bridges, gaming engines, payment apps, identity solutions and more. However, generation of ZK proof, like mining, is energy and compute-intensive which requires powerful machines which ultimately leads to high costs or poor response time for users.
Advantages
Marlin enhances the capabilities of blockchains in various ways:
- Performance scaling: Marlin boosts the effective throughput of blockchains by allowing computations to happen off-chain in dedicated nodes. The computations are still verifiable on-chain ensuring correctness.
- Off-chain data access and relay: Marlin allows programs to reliably access off-chain data using APIs, expose HTTPS endpoints to operate web 2 services and invoke smart contract transactions upon defined events.
- Chain abstraction: The middleware is compatible with any blockchain provided the relay and verification contracts are deployed on that chain. As it can support code written in any language and can also host backends, Marlin makes the blockchain transparent for users and developers alike.
Developer Guides
Smart contracts can delegate computations to Marlin by posting jobs on to a relay contract. Results are posted back on-chain along with an enclave attestation or ZK proof to prove that computations were carried out correctly. The Developer Guides for Oyster Serverless and Kalypso contain detailed steps and tutorials on how to use Marlin as a TEE or ZK coprocessor.
📄️ Serverless
Oyster Serverless allows users to execute functions without having to go through the process of renting managing an Instance themselves. Users only pay for the time it takes to execute the function. The Serverless protocol requires a set of Instances to always be on standby, ensuring that Requests are served on-demand. These Instances function as shared resources, effectively being 'rented' by multiple users simultaneously.
📄️ Proof Requests
Proof Requests on Kalypso can be placed by using the kalypso-sdk npm package. The sections below assume kalypso-sdk has already been installed and configured.
Oyster Serverless uses a common pool of nodes to execute jobs. It saves developers/protocols the hassle of leasing an exclusive instance, allowing them to only pay for the time it takes to perform the operation. While it provides a range of Instance Types, there can exist use cases where the standardized nodes or time limits made available by Serverless are insufficient. In such cases, developers can rent one or more Isolated Instances.
AI on Marlin
Isolated Instances provide the same TEE-based isolation and confidentiality guarantess as Serverless, and can be used in conjuction with relay contracts or web2 APIs for similar interactive experiences.
The Tutorials section under Developer Guides provides examples on how to deploy LLMs in an Oyster Isolated Instance.
📄️ Quickstart
Get started with Oyster Instances as an user.
📄️ Tutorials
This section will walk you through some hands-on tutorials to rent an Instance on the Oyster marketplace to accomplish certain tasks:
Join the Network
The Marlin network consists of different kinds of hardware:
- Servers (like Amazon EC2)
- Servers with confidential computing support (like Intel SGX, AWS Nitro Enclaves)
- GPUs (like NVIDIA H100s)
- GPUs with confidential computing support (like NVIDIA H100s)
While Kalypso accepts any hardware suitable to generate ZK proofs for a given circuit, Oyster only accepts confidential computing instances. As a permissionless network, anyone can join as a node operator on Marlin. More information on the requirements and steps to join Oyster or Kalypso is available in the Run Nodes section.
📄️ Oyster
Decentralized backends and off-chain services
📄️ Kalypso
Running your own kalypso prover
Distinctive Features
Broadly speaking, some advantages of Marlin over alternate decentralized cloud or ZK coprocessing solutions include:
- Tamper resistance: Many decentralized cloud solutions offer vanilla servers which technically allow malicious node operators to manipulate the execution of programs and deliver incorrect results. Marlin’s confidential computing and ZK solution makes the execution tamper resistant.
- Data confidentiality: Similar to the point above, many decentralized cloud and ZK coprocessing solutions allow node operators to view data inputs. This prevents users from sending data or outsourcing programs they wouldn’t like to publicly share. Marlin’s confidential computing solution prevents node operators from snooping into programs or any data sent to them by users.
- Circuit agnostic: Most ZK coprocessors are designed for certain environments, RISC-V, WASM or MIPS and can only process programs written in compatible languages. Yet others are designed for specific use cases like accessing blockchain history. Marlin’s ZK proof marketplace is circuit and thus language-agnostic, allowing nodes to choose which circuits they would like to support.
Summary
Users can access Marlin through one of the following sub-networks:
- Oyster Isolated Instances - Allows confidential computing instances to be rented individually for any amount of time like one would on AWS or GCP. It comes with monitoring and uptime guarantees, provides developers a dedicated instance and is billed for the entire time it is rented.
- Oyster Serverless - Allows jobs to be transparently outsourced to the sub-network without having to bother with picking an instance, renting and paying for it any longer than each execution of the job. It comes with monitoring and uptime guarantees and the sub-network’s nodes are shared amongst all the sub-network’s users. The protocol pays for the nodes to be on standby and is compensated upon every task delegated by users.
- Kalypso - Allows ZK proofs to be generated for any circuit listed on the marketplace. The protocol pays for the nodes to be on standby and is compensated for every proof delegated by users.
Each of these sub-networks have their own sub-protocol, use cases and set of guarantees. Open-source contributions towards the specs of protocol upgrades, implementation of new features and tooling, or documentation are welcome!
📄️ Get Involved
Learn more about Marlin's community channels and how you can contribute to the network.