From 906a9e44ec5994ff79cd211641784da855e5eee5 Mon Sep 17 00:00:00 2001 From: nijoe1 Date: Wed, 3 Jun 2026 11:37:42 +0300 Subject: [PATCH] chore(docs): update latest pricing changes --- .../docs/cookbooks/payments-and-storage.mdx | 48 +++++--- .../storage/storage-costs.mdx | 105 +++++++++++++----- docs/src/content/docs/introduction/about.mdx | 30 ++--- 3 files changed, 127 insertions(+), 56 deletions(-) diff --git a/docs/src/content/docs/cookbooks/payments-and-storage.mdx b/docs/src/content/docs/cookbooks/payments-and-storage.mdx index 16a027825..4b049788a 100644 --- a/docs/src/content/docs/cookbooks/payments-and-storage.mdx +++ b/docs/src/content/docs/cookbooks/payments-and-storage.mdx @@ -8,8 +8,8 @@ sidebar: :::tip[What You'll Learn] - The mental model: deposit USDFC, FWSS handles payments to storage providers -- How much storage costs (pricing, floors, CDN) -- What payment rails are and why each dataset has up to three +- How much storage costs (pricing, fees, CDN) +- What payment rails are and why each data set has up to three - What happens if your account runs low on funds ::: @@ -41,35 +41,51 @@ This cookbook explains the underlying payment model. For practical code: ## Pricing +Two recurring rates apply per data set: + | Component | Cost | Notes | | -------------- | -------------------- | ------------------------------------------------------- | -| **Storage** | $2.50/TiB/month | Minimum $0.06/month per dataset (~24.567 GiB threshold) | -| **Sybil fee** | 0.1 USDFC (one-time) | Per new dataset creation; prevents state-growth spam | -| **CDN egress** | $14/TiB downloaded | 1 USDFC top-up ≈ 71.5 GiB of downloads | -| **CDN setup** | 1 USDFC (one-time) | Per dataset; reusing existing datasets incurs no cost | +| **Storage** | $2.50/TiB/month per copy | Charged only while pieces exist. Empty data sets are free | +| **Proving Service** | $0.024/data set/month | Flat per-data-set fee, added on top of the storage rate | +| **CDN egress** | up to $0.014/GiB downloaded | Optional, via Filecoin Beam. About half this when served from cache | :::note "Month" always means exactly **30 days = 86,400 epochs** throughout the system. Filecoin epochs are ~30 seconds each. ::: -### Floor Pricing +Each on-chain operation also pays a small one-time fee to the storage provider, covering the gas it spends on your behalf: + +| Operation | Fee | +| -------------- | -------------------- | +| **Create data set** | $0.025 | +| **Add pieces** | $0.0005 + $0.0003 per piece | +| **Schedule piece removals** | $0.002 per call | +| **Terminate service** | $0.00112 (user-initiated only) | + +These are fractions of a cent. They are drawn from a ~$0.10 lockup reserve held while the data set is active, not billed separately on each call. See [Storage Costs: How the fees and lockup work](/developer-guides/storage/storage-costs/#how-the-fees-and-lockup-work) for the mechanics. + +:::caution[SDK pricing update in progress] +The per-operation fees and the additive proving fee are live in the Warm Storage contract, but the SDK cost APIs (`getUploadCosts()`, `prepare()`) are still being updated to surface them, tracked in [synapse-sdk#763](https://github.com/FilOzone/synapse-sdk/issues/763). Until that lands, returned `rate` and `depositNeeded` values reflect the previous model. +::: + +### Proving Fee -Every dataset has a minimum monthly charge of **$0.06/month**, regardless of size. This compensates storage providers for the overhead of maintaining a dataset. Files under ~24.567 GiB all pay this same floor rate. Above that threshold, the natural rate (`bytes/TiB × $2.50/month`) takes over. +The monthly cost of an active data set is `(bytes / TiB) × $2.50 + $0.024`. There is no minimum floor: a data set with no pieces costs nothing, and the rate activates when the first piece is added. Earlier pricing used a single $0.06/month minimum. The flat proving fee replaces it as an additive per-data-set charge. -### Dataset Creation Costs +### Data Set Creation Costs -Creating a new dataset requires minimum available funds to cover the initial lockup plus the sybil fee: +Creating a data set locks a small lifecycle reserve. The storage rate starts at zero and is set automatically when you add data: | Scenario | Minimum Funds Required | | -------- | ---------------------- | -| No CDN | 0.16 USDFC (0.06 floor lockup + 0.10 sybil fee) | -| With CDN | 1.16 USDFC (0.06 floor + 0.10 sybil + 0.70 CDN + 0.30 cache miss) | +| No CDN | ~0.10 USDFC (lifecycle reserve lockup) | +| With CDN | ~1.10 USDFC (0.10 reserve + 0.70 CDN egress + 0.30 cache-miss) | -The storage rate starts at zero when a dataset is created and is set automatically when you add data. +One-time fees such as the $0.025 creation fee are drawn from the lifecycle reserve, not added on top of these amounts. ## Payment Rails -For each dataset, FWSS creates payment channels called **rails** that stream funds from your account to the storage provider. A dataset can have up to three rails: +For each data set, FWSS creates payment channels called **rails** that stream funds from your account to the storage provider. A data set can have up to three rails: | Rail | Type | Purpose | | -------------- | --------- | ---------------------------------------- | @@ -77,11 +93,11 @@ For each dataset, FWSS creates payment channels called **rails** that stream fun | **CDN rail** | Fixed | 0.7 USDFC lockup for CDN egress credits | | **Cache miss** | Fixed | 0.3 USDFC lockup for cache miss credits | -Every dataset gets a PDP rail. CDN and cache miss rails are added only when CDN is enabled. +Every data set gets a PDP rail, which also holds the ~$0.10 lifecycle reserve that one-time fees draw from. CDN and cache miss rails are added only when CDN is enabled. FWSS enforces a **30-day lockup period**: your account must always have enough funds to cover at least 30 days of storage at the current rate. Think of it as a security deposit. The funds aren't spent upfront, but they're reserved so providers are guaranteed payment even if you stop topping up. -When you add data to an existing dataset, FWSS automatically adjusts the rail's payment rate. The SDK calculates the correct deposit amount for you via `getUploadCosts()` and `prepare()`. +When you add data to an existing data set, FWSS automatically adjusts the rail's payment rate. The SDK calculates the correct deposit amount for you via `getUploadCosts()` and `prepare()`. ## Operator Approval diff --git a/docs/src/content/docs/developer-guides/storage/storage-costs.mdx b/docs/src/content/docs/developer-guides/storage/storage-costs.mdx index 0b3d427ec..b28a47957 100644 --- a/docs/src/content/docs/developer-guides/storage/storage-costs.mdx +++ b/docs/src/content/docs/developer-guides/storage/storage-costs.mdx @@ -19,22 +19,38 @@ An **epoch** is Filecoin's block time, which is 30 seconds. Storage costs are ca ## Pricing Components +Pricing has two recurring rates and a set of small one-time fees. + +### Recurring rates + | Component | Cost | Notes | | -------------- | ------------------ | -------------------------------------------------------- | -| **Storage** | $2.50/TiB/month | Minimum $0.06/month per data set (~24.567 GiB threshold) | -| **Sybil Fee** | 0.1 USDFC (one-time) | Per new data set creation; prevents state-growth spam | -| **CDN Egress** | $14/TiB downloaded | 1 USDFC top-up ≈ 71.5 GiB of downloads | -| **CDN Setup** | 1 USDFC (one-time) | Per data set; reusing existing data sets incurs no cost | +| **Storage** | $2.50/TiB/month per copy | Charged only while pieces exist. Empty data sets are free. | +| **Proving Service** | $0.024/data set/month | Flat per-data-set fee, added on top of the storage rate. | +| **CDN egress** | up to $0.014/GiB downloaded | Optional, via Filecoin Beam. About half this when served from cache. | :::note[Be aware] -Per month means **per 30 days** here, not calendar month like a traditional storage service. +"Month" means **30 days** here (86,400 epochs), not a calendar month. ::: -**Pricing Logic:** -- Storage **< 24.567 GiB**: Minimum $0.06/month applies -- Storage **≥ 24.567 GiB**: Actual cost `(bytes / TiB) × $2.50/month` -- CDN data sets require 1 USDFC setup on first creation only -- CDN egress credits can be topped up anytime +The monthly rate for an active data set is `(bytes / TiB) × $2.50 + $0.024`. There is no minimum floor. + +### One-time fees + +Each on-chain operation pays a small fee to the storage provider, covering the gas that provider spends on your behalf: + +| Operation | Fee | +| -------------- | ------------------ | +| **Create data set** | $0.025 | +| **Add pieces** | $0.0005 + $0.0003 per piece | +| **Schedule piece removals** | $0.002 per call | +| **Terminate service** | $0.00112 (user-initiated only) | + +These are fractions of a cent. Think of them like gas: negligible for normal use, only adding up at very high operation volumes. They are paid from a small lockup reserve (~$0.10) held while the data set is active, not billed separately on every call. See [How the fees and lockup work](#how-the-fees-and-lockup-work) below. + +:::note[CDN setup] +Enabling CDN adds two refundable lockups on first use: ~0.7 USDFC for egress credits and ~0.3 USDFC for cache-miss credits. Reusing an existing CDN data set incurs no new setup. These are lockups, not fees, and are returned when the rail is finalized. +::: ### Real-World Cost Examples @@ -44,17 +60,25 @@ These examples use plain arithmetic for clarity. For programmatic cost calculati ```ts twoslash // @lib: esnext,dom -// 48.82 MiB less than 24.567 GiB threshold -// Price is $0.06/month -const PRICE_PER_MONTH = 0.06; -const months = 24; -const PRICE_FOR_24_MONTHS = PRICE_PER_MONTH * 24; // 1.44 USDFC +// 48.82 MiB is tiny, so the storage rate is negligible. +// The recurring cost is dominated by the flat proving fee. +const STORAGE_PRICE_PER_TIB_PER_MONTH = 2.5; +const PROVING_FEE_PER_MONTH = 0.024; + +const storageTiB = 48.82 / 1024 / 1024; // ≈ 0.0000466 TiB +const storageCostPerMonth = storageTiB * STORAGE_PRICE_PER_TIB_PER_MONTH; // ≈ $0.00012 + +// Per copy, per month +const costPerMonth = storageCostPerMonth + PROVING_FEE_PER_MONTH; // ≈ 0.0241 USDFC +const costFor24Months = costPerMonth * 24; // ≈ 0.578 USDFC ``` -| Duration | Total Cost | +| Duration | Per copy | | --------- | ---------- | -| 1 month | 0.06 USDFC | -| 24 months | 1.44 USDFC | +| 1 month | ≈ 0.024 USDFC | +| 24 months | ≈ 0.58 USDFC | + +The default 2-copy configuration roughly doubles the recurring cost. One-time fees apply once: $0.025 to create the data set plus the per-batch add-pieces fee. --- @@ -66,7 +90,8 @@ const PRICE_FOR_24_MONTHS = PRICE_PER_MONTH * 24; // 1.44 USDFC ```ts twoslash // @lib: esnext,dom const STORAGE_PRICE_PER_TIB_PER_MONTH = 2.5; // $2.50/TiB/month -const CDN_EGRESS_PRICE_PER_TIB = 14; // $14/TiB downloaded +const PROVING_FEE_PER_MONTH = 0.024; // flat per-data-set +const CDN_EGRESS_PRICE_PER_TIB = 14; // up to $14/TiB on a cache miss const storageMiB = 100_000; const egressMiB = 100_000; @@ -79,27 +104,55 @@ const egressTiB = egressMiB / 1024 / 1024; // Storage cost per month: 0.0953 TiB × $2.50 ≈ $0.238/month const storageCostPerMonth = storageTiB * STORAGE_PRICE_PER_TIB_PER_MONTH; -// Egress cost per month: 0.0953 TiB × $14 ≈ $1.334/month +// Egress cost per month (worst case, all cache misses): 0.0953 TiB × $14 ≈ $1.334/month const egressCostPerMonth = egressTiB * CDN_EGRESS_PRICE_PER_TIB; -// Total cost per month: $0.238/month + $1.334/month ≈ $1.572/month -const totalCostPerMonth = storageCostPerMonth + egressCostPerMonth; +// Total cost per month: $0.238 + $0.024 proving + $1.334 egress ≈ $1.596/month +const totalCostPerMonth = storageCostPerMonth + PROVING_FEE_PER_MONTH + egressCostPerMonth; -// Total cost for 24 months: $1.572/month × 24 ≈ $37.728 +// Total cost for 24 months: $1.596/month × 24 ≈ $38.30 const totalCostFor24Months = totalCostPerMonth * 24; ``` | Cost Component | Per Month | 24 Months | | -------------- | ---------------- | ----------------- | | Storage | ≈ 0.238 USDFC | ≈ 5.71 USDFC | +| Proving Service | ≈ 0.024 USDFC | ≈ 0.576 USDFC | | CDN Egress | ≈ 1.334 USDFC | ≈ 32.016 USDFC | -| **Total** | **≈ 1.572 USDFC** | **≈ 37.728 USDFC** | +| **Total** | **≈ 1.596 USDFC** | **≈ 38.30 USDFC** | + +Egress here is the worst case where every byte is a cache miss. When content is served from the Filecoin Beam cache, egress is roughly half this. + +## How the fees and lockup work + +Most developers can stop at the tables above. This section explains the mechanics behind the per-operation fees and the lockup reserve for anyone who needs the detail. + +**The proving fee is additive, not a floor.** Earlier pricing used a single monthly minimum. The rate is now `(bytes / TiB) × $2.50 + $0.024`, so storage scales with size and the proving fee is a flat addition per data set. A data set with no pieces pays nothing until the first piece is added. + +**Add-pieces pricing scales with batch size.** Each `addPieces` call costs `$0.0005 + $0.0003 × N`, where `N` is the number of pieces in the batch. The base fee is shared across the batch, so adding many pieces in one call is cheaper per piece than adding them one at a time. When estimating the cost of a single piece, assume the single-piece price (`$0.0008`); batching only makes it cheaper. + +**Fees are paid from a small lockup reserve, not billed per call.** When a data set is created, ~$0.10 of USDFC is locked as a lifecycle reserve on the data set's payment rail. One-time fees are drawn from this reserve as operations happen, and the reserve is topped back up toward its target as it is drawn down. You see ~$0.10 of additional locked USDFC while the data set is active. It is refunded when the rail is finalized. + +
+Why the reserve exists: wind-down after termination + +Filecoin Pay does not allow raising a rail's fixed lockup once the rail has been terminated. The lifecycle reserve gives you headroom to run wind-down operations (such as scheduling piece removals) after termination, when the reserve can no longer be refilled. + +If you expect to need more wind-down operations than the reserve covers, fund the reserve before terminating. User-initiated termination charges the $0.00112 termination fee and makes a best-effort top-up of the reserve. Provider-initiated termination charges no fee and does not top up, so those data sets are limited to whatever was in the reserve at termination. + +For the full lockup model (streaming versus fixed lockup, rail settlement, finalization), see the [Filecoin Pay spec](https://github.com/FilOzone/filecoin-pay/blob/main/SPEC.md). The [Payments & Storage cookbook](/cookbooks/payments-and-storage/) covers the same mechanics in SDK terms, though its pricing figures predate this update. + +
## Querying Upload Costs +:::caution[SDK pricing update in progress] +The per-operation fees and the additive proving fee above are live in the Warm Storage contract. The SDK cost APIs (`getUploadCosts()`, `prepare()`) are still being updated to surface them, tracked in [synapse-sdk#763](https://github.com/FilOzone/synapse-sdk/issues/763). Until that lands, the returned `rate` and `depositNeeded` values reflect the previous model and may not include every new fee. +::: + Use `getUploadCosts()` to preview costs without executing any transaction. This is useful for displaying pricing in a UI or letting users confirm before proceeding. -Getting the costs for uploading to an existing dataset: +Getting the costs for uploading to an existing data set: ```ts twoslash // @lib: esnext,dom @@ -124,7 +177,7 @@ const costs2 = await synapse.storage.getUploadCosts({ // Accurate for above-floor datasets, overestimates for floor-priced ones ``` -Getting the costs for uploading to a new dataset: +Getting the costs for uploading to a new data set: ```ts twoslash // @lib: esnext,dom diff --git a/docs/src/content/docs/introduction/about.mdx b/docs/src/content/docs/introduction/about.mdx index 4eeb375dc..b57a35c3b 100644 --- a/docs/src/content/docs/introduction/about.mdx +++ b/docs/src/content/docs/introduction/about.mdx @@ -26,7 +26,7 @@ FOC addresses this next-generation demand by creating composable onchain service ### Key Properties -At its core, Filecoin Onchain Cloud delivers cloud-grade performance and usability with verifiable onchain properties: +Filecoin Onchain Cloud combines cloud-grade performance with verifiable onchain properties: - 🔑 **Ownership** — Data, payments, and service logic belong to users and developers, not intermediaries. - 🔍 **Verifiability** — Every transaction, proof, and interaction is recorded, auditable, and cryptographically verifiable on the Filecoin blockchain. @@ -36,38 +36,40 @@ This design allows Filecoin to move beyond static data storage — offering real ### Core Components -The Filecoin Onchain Cloud offers foundational components that together create an onchain verifiable, service-oriented cloud stack. Today, the building blocks includes: +The Filecoin Onchain Cloud's components together form an onchain-verifiable, service-oriented cloud stack. Today, the building blocks include: -- [**Filecoin Warm Storage Service (FWSS)**](https://github.com/FilOzone/filecoin-services) — The operational layer providing fast, persistent, and verifiable data storage backed by Proof of Data Possession, powered by Filecoin's world storage providers. +- [**Filecoin Warm Storage Service (FWSS)**](https://github.com/FilOzone/filecoin-services) — The operational layer providing fast, persistent, and verifiable data storage backed by Proof of Data Possession, across Filecoin's global storage providers. - [**Proof of Data Possession (PDP)**](https://github.com/FilOzone/pdp) — The cryptographic storage proof ensuring data storage integrity and availability. - [**Filecoin Pay**](https://github.com/FilOzone/filecoin-pay) — The financial settlement engine that enables programmable payments for onchain services. -- [**Filecoin Beam**](https://docs.filbeam.com/) — Available as an add-on, a retrieval and delivery layer that ensures global accessibility of stored data. +- [**Filecoin Beam**](https://docs.filbeam.com/) — Available as an add-on, a retrieval and delivery layer that serves stored data globally. -Each of these components works independently yet integrates seamlessly through onchain smart contracts and the [**Synapse SDK**](https://github.com/FilOzone/synapse-sdk), forming a cohesive, modular system. Together, they deliver the core properties of a next-generation decentralized cloud: verifiability, programmability, and composability. +Each component works independently but connects through onchain smart contracts and the [**Synapse SDK**](https://github.com/FilOzone/synapse-sdk). Together they provide the core properties of a decentralized cloud: verifiability, programmability, and composability. ### Key Products -The **Filecoin Onchain Cloud** is not just an infrastructure layer — it’s a platform for innovation. -By exposing verifiable storage, retrieval, and payment capabilities as onchain services, FOC empowers developers to build entirely new products and workflows to expand the functionality of the Onchain Cloud and bring Filecoin closer to becoming a **modular, decentralized cloud** ecosystem. +By exposing verifiable storage, retrieval, and payment capabilities as onchain services, FOC lets developers build products and workflows that extend the Onchain Cloud and move Filecoin toward a **modular, decentralized cloud**. #### Filecoin Pin -**Filecoin** Pin is a fully decentralized persistence layer for IPFS content using the global network of Filecoin storage providers with cryptographic guarantees. It brings **IPFS's filesystem structure to Filecoin Onchain Cloud** for developers building on IPFS who need trustless, economically-incentivized persistence for their content. +**Filecoin Pin** is a decentralized persistence layer for IPFS content, backed by the global network of Filecoin storage providers with cryptographic guarantees. It brings **IPFS's filesystem structure to Filecoin Onchain Cloud** for developers who need trustless, economically incentivized persistence for their content. [Learn more about Filecoin Pin →](https://docs.filecoin.io/builder-cookbook/filecoin-pin) -*More products will be built to extending the capability of the Filecoin Onchain Cloud.* +*More products will be built to extend the capabilities of the Filecoin Onchain Cloud.* ### Pricing -The **Filecoin Onchain Cloud (FOC)** offers transparent and verifiable pricing for its **Filecoin Warm Storage Service (FWSS)** and **Filecoin Beam** retrieval layer. -All payments are settled automatically through Filecoin Pay, ensuring on-chain accountability and proof-linked billing. +The **Filecoin Onchain Cloud (FOC)** prices its **Filecoin Warm Storage Service (FWSS)** and **Filecoin Beam** retrieval layer as follows. +Filecoin Pay settles all payments automatically, with onchain accountability and proof-linked billing. | **Service** | **Pricing** | **Description** | | ------- | --------- | -------------------- | -| **Base Storage & Retrival** | **$2.5/TiB/month/copy** (minimum 2 copies) | Redundant storage ensures durability and continuous PDP verification.
Minimum monthly charge of **0.06 USDFC**, covering roughly **24 GiB** of total data (two copies). | -| **Add-on Retrieval (Filecoin Beam)** | **Up to $0.014/GiB egress** | Charged for outbound data delivered via Filecoin Beam gateways or retrieval providers. | +| **Storage** | **$2.50/TiB/month/copy** (minimum 2 copies) | Redundant storage with continuous PDP verification. Empty data sets cost nothing, charges begin when the first piece is added. | +| **Proving Service** | **$0.024/data set/month** | Flat per-data-set fee for proof verification, added on top of the storage rate. | +| **Add-on Retrieval (Filecoin Beam)** | **Up to $0.014/GiB egress** | Outbound data delivered via Filecoin Beam. Roughly half this when served from cache, up to the full rate on a cache miss. | + +Beyond these recurring rates, each onchain operation (creating a data set, adding or removing pieces, terminating service) carries a small one-time fee paid to the storage provider to cover its gas. These fees are fractions of a cent and only matter at very high operation volumes. See [Storage Costs](/developer-guides/storage/storage-costs/) for the full breakdown. :::note[Verifiable Payment] -All storage and retrieval charges are denominated in **USDFC** (or supported ERC-20 tokens) and settled via **Filecoin Pay**. Every transaction is on-chain, auditable, and linked to verifiable service proofs. +All storage and retrieval charges are denominated in **USDFC** (or supported ERC-20 tokens) and settled via **Filecoin Pay**. Every transaction is onchain, auditable, and linked to verifiable service proofs. :::