Synapse SDK is a TypeScript SDK for interacting with the Filecoin Onchain Cloud - a smart-contract based marketplace for storage and other services in the Filecoin ecosystem. It provides a high-level API for interacting with the system. Additionally, it offers a low-level API for direct interaction with the underlying smart contracts and storage providers.
The SDK integrates with four key components of the Filecoin Onchain Cloud:
PDPVerifier : Proof verification contract powered by (PDP)
Filecoin Pay : Payment layer contract powered by (Filecoin Pay)
Filecoin Warm Storage Service : Business logic contract powered by (WarmStorage)
Service Providers : Service providers are the actors that safeguard the data stored in the Filecoin Onchain Cloud powered by the Curio Storage software
The SDK provides two primary components:
synapse.payments - Token operations, service authorizations, and payment rail settlements
synapse.storage - Data upload, download, and storage context management
The main Synapse class exposes this simple interface for all operations:
The [[broadcastTransaction]] is the only method which allows updating
the blockchain, but it is usually accessed by a [[Signer]], since a
private key must be used to sign the transaction before it can be
broadcast.
Provider;
SynapseAPI.getSigner(): ethers.Signer
getSigner():
import ethers
ethers.
export Signer
A Signer represents an account on the Ethereum Blockchain, and is most often
backed by a private key represented by a mnemonic or residing on a Hardware Wallet.
The API remains abstract though, so that it can deal with more advanced exotic
Signing entities, such as Smart Contract Wallets or Virtual Wallets (where the
private key may not be known).
These limits are enforced by the blockchain contracts. The SDK will validate metadata before submission and throw descriptive errors if limits are exceeded.
Understanding PieceCID is essential for working with Filecoin storage, as it serves as the unique identifier for your uploaded data.
PieceCID is Filecoin’s native content address identifier, a variant of CID. When you upload data, the SDK calculates a PieceCID—an identifier that:
Uniquely identifies your bytes, regardless of size, in a short string form
Enables retrieval from any provider storing those bytes
Contains embedded size information
Format Recognition:
PieceCID: Starts with bafkzcib, 64-65 characters - this is what Synapse SDK uses
LegacyPieceCID: Starts with baga6ea4seaq, 64 characters - for compatibility with other Filecoin services
PieceCID is also known as “CommP” or “Piece Commitment” in Filecoin documentation. The SDK exclusively uses PieceCID (v2 format) for all operations—you receive a PieceCID when uploading and use it for downloads.
LegacyPieceCID (v1 format) conversion utilities are provided for interoperability with other Filecoin services that may still use the older format. See PieceCID Utilities for conversion functions.
Technical Reference: See FRC-0069 for the complete specification of PieceCID (“v2 Piece CID”) and its relationship to LegacyPieceCID (“v1 Piece CID”). Most Filecoin tooling currently uses v1, but the ecosystem is transitioning to v2.