On-chain philanthropy with the Swiss Zakat Foundation
CipherPhi runs two Soroban contracts and two Foundation multisigs on Stellar testnet. A payout needs two of three signers and an approved recipient.
Aladdin Battikh10 min read
Updated

CipherPhi separates the key that sets the rules from the key that approves a payout, and lets neither reach the money alone.
The architecture is at revision 5 in the public repository.1 Its two contracts run on Stellar testnet with Circle's testnet USDC, built reproducibly from that repository, unaudited and holding no real funds.2 The build is submitted to the Stellar Community Fund #46 Build Award on the Open Track, filed on 8 November 2026, with the community vote from 23 November to 3 December. The system moves zakat for the Swiss Zakat Foundation, a federally supervised Swiss foundation collecting and redistributing zakat since its founding deed of 6 July 2021, audited annually.3 The institution works. What is being built is the rail underneath it.
What changed since the first design
The first design had three contracts and three key sets. Revision 4 dropped one of each.
Payout approval used to be a separate attestation contract that verified an eligibility signature, called by a single distributor key. Revision 4 replaced both with a Foundation 2-of-3 multisig that the network checks directly. A Swiss foundation already signs by joint signature of two (Kollektivunterschrift zu zweien), so the chain now enforces the rule the Foundation already works under, rather than one written for it. Revision 5 added a recipient allow-list to the pool.
| REVISION | WHAT IT CHANGED |
|---|---|
| 1 | The design as submitted to SCF #45 |
| 2 | An internal pre-implementation security review folded in |
| 3 | A platform correction on Stellar transaction ordering, and monitoring made concrete |
| 4 | Architecture locked. Payout approval by a Foundation multisig checked by the network, replacing the attestation contract and the distributor key |
| 5 | A recipient allow-list on zakat_pool, so a payout can only reach an address governance approved |
One contract holds funds
One contract holds funds. The other is consulted by it and can never move anything.
| COMPONENT | RESPONSIBILITY | HOLDS FUNDS |
|---|---|---|
zakat_pool | Custody, the eight category balances per asset, and the only two functions that move value | Yes |
policy | Shariah parameters and the allocation over a contribution | No |
| Approval multisig | A Foundation 2-of-3 Stellar account that authorises each payout | No |
| Governance multisig | A Foundation 2-of-3 Stellar account, on separate keys, that sets the rules under a timelock | No |
THE SPLIT LINE IS VALUE, NOT TIDINESS. THE COMPONENT MOST LIKELY TO CHANGE, A REFINEMENT TO THE SHARIAH PARAMETERS, SITS IN THE ONE CONTRACT THAT HOLDS NO MONEY.
The cross-contract call is a place where a wrong answer can enter, so the pool treats policy as untrusted input. An allocation is rejected unless the returned vector has exactly eight elements, every element is zero or positive, and they sum exactly to the amount received. Checking only the sum would not be enough. A split of the shape [amount + x, -x, 0, ...] sums correctly, passes checked arithmetic, and leaves total custody intact while silently crediting one category from another's beneficiaries. policy makes no call to the pool, so no defect in it reaches the money.
Payout approval crosses no contract boundary at all. The pool requires the approval account's authorisation, and the network enforces the account's threshold. The audit scope is two Wasm binaries.
Approval is a signature the network checks
A treasury multisig lets one quorum both set the rules and spend. CipherPhi gives those powers to two accounts on separate keys.
Access control ranks first in the OWASP Smart Contract Top 10 for 2026, derived from 2025 incident data.4 The category covers privilege concentration and insufficient separation of duties, so separation is the control worth paying for, and paying for it means enforcing it on the ledger rather than in a policy document.
distribute(recipient, asset, amount, category) requires auth from the approval multisig over all four arguments. The network refuses that auth unless two of the three signers signed, for this pool, on this network, unexpired, and not used before. Whoever submits the transaction cannot change any argument: a changed argument is a call nobody signed.
| ROLE | HOLDS | CAN | CANNOT |
|---|---|---|---|
| Governance | Foundation 2-of-3 multisig | Pause contributions. Under the timelock: change the split and parameters, repoint policy, approve an asset, approve or remove a recipient, replace the approval multisig | Move funds. Approve a payout |
| Approval multisig | Foundation 2-of-3 multisig, separate keys | Approve a payout to an approved recipient. Remove a recipient at once. Cancel any pending change | Change policy. Approve a recipient |
| Delivery team | No key on mainnet | Build transactions, run the indexer, monitor and alert the signers | Sign anything on mainnet |
The approval multisig's three seats are the Foundation's Executive Director, the Shariah authority, and an independent signer the Foundation appoints. The delivery team holds no seat on either account on mainnet.
The old design bound each attestation to a pool sequence number, so attestations executed in order and one abandoned stranded every attestation signed after it. Soroban authorisation entries carry their own single-use nonce and expiry, so approvals are now independent. They execute in any order, and one that is abandoned blocks nothing.
Stolen keys pay only approved recipients
THE DESIGN ASSUMES ONE KEY IS EVENTUALLY COMPROMISED.
One stolen approval key produces nothing, because a payout needs two. Stolen governance keys produce a proposal rather than a payout: the only route to the funds is replacing the approval multisig, which waits out the timelock in public and which the approval multisig can cancel.
Revision 5 closes the case of two stolen approval keys. Before it, two approval signers could pay any address. Now a payout can only reach a recipient that governance approved, at deployment or under the timelock, so stolen approval keys cannot pay an address the thief picks. The approval multisig can also remove a recipient at once, which voids every approval signed for it before the removal. That power gives the approval signers nothing they lack today, since they can already refuse to sign, and governance does not hold it, so a stolen governance quorum cannot use removals to freeze payouts.
What waits seven days, and what does not
| ACTION | TIMING | WHY |
|---|---|---|
| Change the split or a Shariah parameter | Seven-day timelock | Methodology change, visible to donors before it applies |
| Approve or remove a recipient | Seven-day timelock | The set of addresses a payout can reach |
Repoint policy or replace the approval multisig | Seven-day timelock | The change is visible before it takes effect, and the approval multisig can cancel it |
| Approve an asset | Seven-day timelock | Adds eight category buckets and a new custody surface |
| Pause contributions | Immediate | A brake that takes a week is not a brake |
| Remove a recipient, by the approval multisig | Immediate | An address that is no longer safe to pay must stop being payable now |
EACH DELAYED CHANGE EMITS AN EVENT AT PROPOSAL, AT EXECUTION AND AT CANCELLATION. A TIMELOCK NOBODY OBSERVES IS A DELAY RATHER THAN A CONTROL, SO THE DELIVERY TEAM WATCHES EVERY ONE AND ESCALATES TO THE SIGNERS.
The timelock is counted in ledgers, at least 120,960, which is seven days at Stellar's five-second target close. Payouts cannot be paused. A thief holding two approval keys pays out in one transaction that a pause could not reliably precede, and a payout pause would hand a stolen governance quorum a way to freeze the funds.
Custody cannot change at all. A Soroban contract is mutable only if it compiles in an upgrade entry point, so a contract omitting update_current_contract_wasm is immutable by construction.5 zakat_pool omits it, because code that can be silently replaced over donor funds is an admin key by another name. The cost is that a custody defect cannot be patched in place. It is paid by a new deployment with a published address and a migration a donor can watch, which is how revision 5 itself reached testnet.
What a donor can check
A donor can verify that their category was paid to a recipient the Foundation approved, after two of three Foundation signers approved that payout.
They cannot verify that their individual coins reached a named person. Zakat is pooled by construction, and the eight-category split is what the methodology operates on, so per-donor tracing to an individual recipient would be a fiction dressed as cryptography. Category-level delivery with a network-checked approval on every disbursement is the strongest true claim available.
Every figure a donor sees resolves to a ledger event carrying the transaction hash that produced it. The pool moves USDC through the Stellar Asset Contract, which implements the SEP-41 token interface, so asset movements surface as standardised transfer events whether they originate from a payment operation or a contract call.6 The interface reading those events can go down, and if it does the donor flow goes down with it. It cannot go wrong quietly, because the record it renders is not a record it holds.
What runs on testnet
| CONTRACT | ADDRESS |
|---|---|
zakat_pool | CAQE5Q…6HIN |
policy | CDU322…M47I |
Both multisigs are 2-of-3 accounts with the master key at weight zero, and the pool has one approved recipient, a test partner. Every key is a test key, and the policy split is a placeholder the Shariah authority has not validated. The Wasm hashes are in the repository, and a reviewer can rebuild them from source inside the pinned build image.2
What this does not cover
| NOT COVERED | WHY NOT, AND WHAT WOULD CHANGE IT |
|---|---|
| Mainnet | Nothing is deployed on mainnet. The trigger is a completed security review and the deployment preconditions below |
| Independent audit | Review is requested through the SCF Soroban Audit Bank and has not started.7 Programme rules put a twenty business day window on resolving critical, high and medium findings, and publish the report once resolution is verified.8 The report is published with the mainnet deployment |
| Validated Shariah parameters | The testnet split is a placeholder. No mainnet distribution occurs until the Shariah authority validates the parameter set and it is matched against what the contract holds |
| Signer identities | The mainnet pool deploys with contributions paused, and governance resumes them only after both accounts are read from the ledger and match the design. Holder identities and custody method are published with the mainnet deployment, because whose key a signer is cannot be proven from the ledger |
| The applications | The donor, partner and admin applications are closed source. The guarantees above do not depend on them. A signer decoder, published before security review, lets a signer check what they approve independently of any application |
| Individual-recipient payouts | The pilot pays a vetted partner organisation directly, removing every live dependency between the pool and the recipient. The Stellar Disbursement Platform is the planned rail,9 triggered by expansion beyond partner organisations |
| Standing Shariah board | One qualified advisor validates the pilot parameter set. A board is planned for scale, triggered by the first distribution beyond the pilot partner |
| Bug bounty and formal verification | Neither at launch. A bounty with no live value to protect attracts noise rather than researchers, so the trigger is a pool balance large enough to be worth attacking |
| Issuer freeze | USDC on Stellar is issued with authorisation revocable, so the issuer can freeze a holder's balance including a contract's, with no remediation in CipherPhi's bytecode.1 Accepted at pilot size: the response is to pause contributions and escalate to the issuer, and issuer flags are reviewed when approving any asset |
The next checkable thing is the security review of the revision 5 contracts. Until then the testnet deployment shows the design runs, not that it is safe, and the architecture is the document a reviewer should hold it to.
Sources
Footnotes
-
CIPHERPHI ARCHITECTURE, REVISION 5. github.com
-
CIPHERPHI SMART CONTRACTS, TESTNET DEPLOYMENT. github.com
-
SWISS ZAKAT FOUNDATION. zakat.ch
-
OWASP SMART CONTRACT TOP 10 FOR 2026. scs.owasp.org
-
STELLAR DEVELOPER DOCS, UPGRADING CONTRACTS. developers.stellar.org
-
STELLAR DEVELOPER DOCS, STELLAR ASSET CONTRACT AND SEP-41. developers.stellar.org
-
SOROBAN SECURITY AUDIT BANK. stellar.org
-
SCF HANDBOOK, AUDIT BANK OFFICIAL RULES. stellar.gitbook.io
-
STELLAR DISBURSEMENT PLATFORM. developers.stellar.org