Skip to content

Commit 998732c

Browse files
authored
docs: licenses and dev docs (#481)
# Description - Prividium developer considerations - ZK Stack & Prividium licenses ## Linked Issues N/A ## Additional context
1 parent c1b3556 commit 998732c

24 files changed

+320
-581
lines changed

content/10.zk-stack/35.prividium/00.overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ while still **anchoring every transaction to Ethereum** for security and finalit
77

88
Sensitive data stays entirely off the public chain, but each state update is verified on Ethereum using zero-knowledge proofs.
99

10+
:display_partial{path="/zk-stack/prividium/_partials/_license-callout"}
11+
1012
This design solves a core challenge in enterprise blockchain adoption:
1113
**how to maintain privacy and control without giving up interoperability with the broader Ethereum ecosystem**.
1214

content/10.zk-stack/35.prividium/06.deployment.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ description: Learn where to deploy each Prividium™ component.
66
This page outlines the recommended deployment model for running a Prividium™ chain in production.
77
Components are grouped by trust boundary and network tier, following enterprise best practices for security, scalability, and maintainability.
88

9+
:display_partial{path="/zk-stack/prividium/_partials/_license-callout"}
10+
911
### DMZ / API Gateway Tier
1012

1113
**Components:**
@@ -64,10 +66,3 @@ Unauthorized requests are filtered before reaching internal systems.
6466
- **Private consensus logic:** Sequencer and Prover run in a non-routable subnet. Only internal services can communicate with them.
6567
- **Outbound-only proof posting:** The relayer submits proofs to ZKsync Gateway without opening any inbound ports.
6668
- **Data-at-rest controls:** Databases and blob stores are isolated and regularly backed up to support compliance and disaster recovery.
67-
68-
## Running a **Prividium™** Chain
69-
70-
To run a local Prividium™ chain, go through the [Run Prividium™ Chain](/zk-stack/prividium/run-prividium-chain) page.
71-
72-
For a full example application running on Prividium™,
73-
check out this [example escrow application](https://github.com/JackHamer09/interop-escrow-double-zero/tree/single-chain-demo).

content/10.zk-stack/35.prividium/10.run-prividium-chain.md

Lines changed: 0 additions & 72 deletions
This file was deleted.
Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,53 @@
11
---
22
title: Proxy RPC API
3-
description: Learn about the Prividium™ Proxy RPC API.
3+
description: Understand how the Prividium™ Proxy RPC enforces access control.
44
---
55

6-
In a standard rollup, there is a standard RPC API that provides full access
7-
to transaction data for users.
8-
With Prividium™, the Proxy RPC is an additional layer in between end users and the chain's standard RPC API.
6+
The Proxy RPC sits between end users and the chain's standard RPC API. It enforces transaction-level access control by filtering
7+
all blockchain interactions before they reach the sequencer.
98

10-
The purpose of the Proxy RPC API is to filter blockchain transactions and wallet interactions.
11-
It serves as an intermediary between web apps/wallets
12-
and blockchain data while enforcing transaction-level access control.
9+
:display_partial{path="/zk-stack/prividium/_partials/_license-callout"}
1310

14-
Access to the standard RPC should remain private.
15-
We highly recommend implementing a secure firewall around the standard RPC API.
16-
Only the Proxy RPC API endpoint should be publicly shared.
11+
## How It Works
1712

18-
## Setting up the Proxy
13+
The Proxy RPC validates every request against the [Permissions API](/zk-stack/prividium/permissions-overview):
1914

20-
To set up the legacy Proxy, you can follow the instructions in the [local setup guide](/zk-stack/prividium/run-prividium-chain#proxy-rpc-api).
15+
1. User submits a transaction or query through the Proxy RPC
16+
2. Proxy validates the user's JWT and wallet address
17+
3. Proxy checks permissions for the requested contract function
18+
4. Authorized requests proceed to the standard RPC; unauthorized requests return `401 Unauthorized`
2119

22-
The new implementation of the Proxy is not yet publicly available.
20+
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
21+
Keep the standard RPC endpoint private. Implement a firewall to restrict access. Only expose the Proxy RPC publicly.
22+
::
2323

2424
## Limitations
2525

26-
### Multicall contract methods
26+
### Multicall Contracts
2727

28-
Currently, [multicall](https://docs.chainstack.com/docs/http-batch-request-vs-multicall-contract#multicall-contract) contract methods
29-
cannot be used in any access policy,
30-
as it would enable bypassing the other access policy rules.
28+
[Multicall](https://docs.chainstack.com/docs/http-batch-request-vs-multicall-contract#multicall-contract) contract methods
29+
bypass individual function permission checks. The Proxy blocks multicall patterns to prevent policy circumvention.
3130

32-
### L1-L2 transactions
31+
### L1-L2 Transactions
3332

34-
L1-L2 transactions, also known as forced transactions, originate from Ethereum (the L1) and can be force included on the L2 chain.
35-
In a public chain, this mechanism helps ensure censorship resistance for users,
36-
and allows them to retain full control of their assets.
33+
Forced transactions originating from Ethereum (L1) can bypass the Proxy entirely. These transactions provide censorship resistance
34+
on public chains but create security risks for permissioned networks:
3735

38-
For Prividium™ chains though,
39-
forced transactions can also be a vector for deploying arbitrary contracts,
40-
performing arbitrary contract writes,
41-
and leaking data through blind attacks.
42-
The ZKsync protocol contracts have a way to
43-
[request arbitrary transaction](https://github.com/matter-labs/era-contracts/blob/29f9ff4bbe12dc133c852f81acd70e2b4139d6b2/l1-contracts/contracts/bridgehub/Bridgehub.sol#L216)
44-
to be executed from Ethereum,
45-
and it can be used to bypass the privacy configuration of a Prividium™ chain.
36+
- Deploy arbitrary contracts
37+
- Execute unauthorized writes
38+
- Leak data through blind attacks
4639

47-
Currently **L1-L2 transactions are not automatically disabled** in Prividium™ chains.
48-
Prividium™ chain operators can be protected against malicious use of these forced transactions by implementing [transaction filtering](/zk-stack/customizations/transaction-filtering).
49-
Note that for users, this means that the chain has the ability to censor transactions.
50-
It is the responsibility of the chain operator to decide how to implement this filtering.
40+
**Mitigation:**
41+
42+
L1-L2 transactions are **not automatically disabled**.
43+
Chain operators can implement [transaction filtering](/zk-stack/customizations/transaction-filtering) to control forced transaction behavior.
44+
45+
The [`PrividiumTransactionFilterer`](https://github.com/matter-labs/era-contracts/blob/zksync-os-stable/l1-contracts/contracts/transactionFilterer/PrividiumTransactionFilterer.sol)
46+
contract provides an allowlist-based filter:
47+
48+
- Allowlisted addresses execute unrestricted forced transactions
49+
- Other addresses can only transfer ETH or ERC-20 tokens
50+
51+
::callout{icon="i-heroicons-light-bulb"}
52+
Enabling transaction filtering grants the chain operator censorship capability. Document your filtering policy for users.
53+
::

content/10.zk-stack/35.prividium/30.permissions-overview.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@ title: Permissions Overview
33
description: Learn about the Prividium™ Permissioning API and Selective Disclosure.
44
---
55

6-
::callout{icon="i-heroicons-light-bulb"}
7-
The permissioning and selective disclosure systems are not yet publicly available.
8-
This documentation serves as a preview.
9-
::
10-
116
Prividium™ offers flexible and customizable ways for chain operators to have granular control over access to reading onchain data or calling contracts.
127
There are two systems used to manage this control: the [permissions API](#permissions-api), and [selective disclosure](#selective-disclosure).
138

9+
:display_partial{path="/zk-stack/prividium/_partials/_license-callout"}
10+
1411
## Permissions API
1512

1613
The permissions API is a layer in between the standard RPC API and the Proxy RPC API that controls **who** can call certain functions in a contract.

content/10.zk-stack/35.prividium/40.sdk.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ title: Prividium™ SDK
33
description: Get started with the Prividium™ SDK.
44
---
55

6+
::callout{icon="i-heroicons-light-bulb"}
7+
Unlike other Prividium™ components, the [Prividium™ SDK](/zk-stack/prividium/sdk) is distributed under the MIT License.
8+
::
9+
610
The [Prividium™ SDK](https://www.npmjs.com/package/prividium) is a TypeScript SDK for integrating with Prividium™'s authorization system.
711
It provides a seamless authentication flow and secure RPC communication for applications running on a Prividium™, including:
812

content/10.zk-stack/35.prividium/50.explorer.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: Private Block Explorer
33
description: Learn about the Prividium™ Block Explorer.
44
---
5+
::callout{icon="i-heroicons-light-bulb"}
6+
The private block explorer is [under a commercial license](/zk-stack/prividium/license) and requires a license agreement or sandbox license to be used.
7+
::
58

69
Like the RPC layer, the block explorer is split into to two versions with the Prividium™ framework:
710
one public-facing and one internal.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Developer Considerations
3+
description: Key differences when building on Prividium™ chains.
4+
---
5+
6+
Prividium™ chains enforce authentication and permissions at the RPC layer. Standard Web3 patterns require adaptation.
7+
8+
## Authentication Required
9+
10+
Every RPC interaction requires authentication. Unauthenticated requests fail.
11+
12+
1. **Users authenticate** via OAuth 2.0 (OIDC providers or crypto-native SIWE).
13+
1. **Applications register** as OAuth clients in the Admin Panel.
14+
1. **Scripts authenticate** programmatically via the Permissions API.
15+
16+
::callout{icon="i-heroicons-light-bulb"}
17+
Use the [Prividium™ SDK](/zk-stack/prividium/sdk) to manage authentication flows.
18+
::
19+
20+
## Contract Deployment
21+
22+
Deploying contracts requires explicit permissions granted by a chain administrator.
23+
24+
1. **Request deployment permissions** from your network administrator.
25+
1. **Authenticate** before deployment using the CLI proxy, manual token injection, or Foundry headers.
26+
1. **Configure function permissions** in the Admin Panel immediately after deployment. All functions default to **Forbidden**.
27+
28+
## Dual RPC Endpoints
29+
30+
Prividium™ uses separate RPC endpoints depending on the use case.
31+
32+
| Endpoint | Authentication | Used by |
33+
|----------|----------------|---------|
34+
| `/rpc` (Proxy RPC) | Bearer token in header | Browser wallets (MetaMask, etc.) |
35+
| `/wallet/{token}` (User RPC) | Token embedded in URL | Scripts (Viem, Ethers.js) |
36+
37+
## Transaction Workflow
38+
39+
Sending transactions via browser wallets (MetaMask, etc.) requires additional steps compared to public chains.
40+
41+
1. **Pre-fetch parameters:** Retrieve nonce, gas estimate, and gas price using an authenticated client.
42+
1. **Enable wallet token:** Call `enableWalletToken()` from the Prividium™ SDK before each transaction.
43+
1. **Send transaction:** Include pre-fetched values explicitly.
44+
45+
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
46+
Wallet tokens are transaction-specific and expire. Enable them immediately before sending.
47+
::
48+
49+
## Permission Model
50+
51+
All contract interactions check permissions defined in the Admin Panel.
52+
53+
- **Read functions:** Permissions checked on `eth_call`.
54+
- **Write functions:** Permissions checked on both simulation and execution.
55+
- **Default state:** All functions are **Forbidden** until configured.
56+
57+
Configure access rules using permission types like **All Users**, **Check Role**, or **Restrict Argument**.
58+
59+
## Key Differences from Public Chains
60+
61+
| Aspect | Public Chain | Prividium™ |
62+
|--------|--------------|------------|
63+
| RPC Access | Open | Authenticated |
64+
| Contract Deployment | Permissionless | Requires permission |
65+
| Function Calls | Open | Permission-controlled |
66+
| Transaction Signing | Wallet only | Wallet + token enablement |
67+
| Network Configuration | Static RPC | User-specific RPC URLs |

0 commit comments

Comments
 (0)