Skip to content
All insights

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.

PartnershipSmart ContractsPayments

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.

REVISIONWHAT IT CHANGED
1The design as submitted to SCF #45
2An internal pre-implementation security review folded in
3A platform correction on Stellar transaction ordering, and monitoring made concrete
4Architecture locked. Payout approval by a Foundation multisig checked by the network, replacing the attestation contract and the distributor key
5A 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.

COMPONENTRESPONSIBILITYHOLDS FUNDS
zakat_poolCustody, the eight category balances per asset, and the only two functions that move valueYes
policyShariah parameters and the allocation over a contributionNo
Approval multisigA Foundation 2-of-3 Stellar account that authorises each payoutNo
Governance multisigA Foundation 2-of-3 Stellar account, on separate keys, that sets the rules under a timelockNo

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.

ROLEHOLDSCANCANNOT
GovernanceFoundation 2-of-3 multisigPause contributions. Under the timelock: change the split and parameters, repoint policy, approve an asset, approve or remove a recipient, replace the approval multisigMove funds. Approve a payout
Approval multisigFoundation 2-of-3 multisig, separate keysApprove a payout to an approved recipient. Remove a recipient at once. Cancel any pending changeChange policy. Approve a recipient
Delivery teamNo key on mainnetBuild transactions, run the indexer, monitor and alert the signersSign 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

ACTIONTIMINGWHY
Change the split or a Shariah parameterSeven-day timelockMethodology change, visible to donors before it applies
Approve or remove a recipientSeven-day timelockThe set of addresses a payout can reach
Repoint policy or replace the approval multisigSeven-day timelockThe change is visible before it takes effect, and the approval multisig can cancel it
Approve an assetSeven-day timelockAdds eight category buckets and a new custody surface
Pause contributionsImmediateA brake that takes a week is not a brake
Remove a recipient, by the approval multisigImmediateAn 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

CONTRACTADDRESS
zakat_poolCAQE5Q…6HIN
policyCDU322…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 COVEREDWHY NOT, AND WHAT WOULD CHANGE IT
MainnetNothing is deployed on mainnet. The trigger is a completed security review and the deployment preconditions below
Independent auditReview 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 parametersThe 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 identitiesThe 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 applicationsThe 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 payoutsThe 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 boardOne 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 verificationNeither 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 freezeUSDC 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.

Footnotes

  1. CIPHERPHI ARCHITECTURE, REVISION 5. github.com

  2. CIPHERPHI SMART CONTRACTS, TESTNET DEPLOYMENT. github.com

  3. SWISS ZAKAT FOUNDATION. zakat.ch

  4. OWASP SMART CONTRACT TOP 10 FOR 2026. scs.owasp.org

  5. STELLAR DEVELOPER DOCS, UPGRADING CONTRACTS. developers.stellar.org

  6. STELLAR DEVELOPER DOCS, STELLAR ASSET CONTRACT AND SEP-41. developers.stellar.org

  7. SOROBAN SECURITY AUDIT BANK. stellar.org

  8. SCF HANDBOOK, AUDIT BANK OFFICIAL RULES. stellar.gitbook.io

  9. STELLAR DISBURSEMENT PLATFORM. developers.stellar.org