š The Only Solo Award-Winning Project @ Universiti Malaya Hackathon 2025
By Jien Weng
ZakatDAO is a pioneering decentralized platform designed to modernize and automate the distribution of zakat, ensuring transparency, Shariah-compliance, and community-driven governance. Recognized for its impactful and innovative approach at the Universiti Malaya Hackathon 2025, ZakatDAO leverages blockchain, DAO governance, and xAI prioritization to deliver a secure, efficient, and inclusive system for zakat management.
- Introduction
- Concept and Vision
- Objectives
- State-by-State Implementation
- Features
- Technical Architecture
- Governance Model
- xAI Integration for Prioritization
- Setup Instructions
- Usage Guide
- API Endpoints
- URL Guide
- Tech Stack
- Deployment Instructions
- Security Considerations
- Testing
- Monitoring
- Future Improvements
- Contact and Support
Zakat, one of the five pillars of Islam, mandates that Muslims donate a portion of their wealth to support those in need, categorized into eight asnaf (recipient groups) as defined by Islamic law. Traditional zakat distribution systems often face challenges such as lack of transparency, inefficiencies due to intermediaries, and limited accessibility for rural or underbanked communities. ZakatDAO addresses these issues by introducing a decentralized, blockchain-based platform that automates and democratizes zakat distribution while adhering to Shariah principles.
ZakatDAO integrates cutting-edge technologies:
- Blockchain: For immutable, transparent record-keeping.
- DAO Governance: For community-driven decision-making.
- xAI: For AI-powered recipient prioritization.
- E-Wallets and Vouchers: For accessible and inclusive disbursements.
The platform is designed to operate on a state-by-state basis, ensuring alignment with local Islamic councils while empowering donors and stakeholders to participate in governance.
Welcome to the ZakatDAO hub! Here you can find important resources to better understand the platform:
Else, please find it under the Documentations Folder.
ZakatDAO reimagines zakat distribution as a decentralized, community-driven process that leverages technology to uphold Islamic values. The platform aims to:
- Ensure Transparency: Every transaction, vote, and disbursement is recorded on an immutable blockchain ledger, publicly accessible to donors, recipients, and authorities.
- Uphold Shariah Compliance: The system adheres to Islamic principles, ensuring funds are distributed to the eight asnaf groups in a fair and compliant manner.
- Empower Communities: Through DAO governance, donors and state authorities collaborate to make decisions on fund allocation and policy changes.
- Enhance Accessibility: By integrating e-wallets (e.g., TNG, Boost, FPX) and QR code-enabled vouchers, ZakatDAO ensures that zakat reaches both urban and rural communities.
- Maximize Efficiency: AI-driven prioritization and smart contracts eliminate intermediaries, reducing costs and accelerating disbursements.
The vision is to create a global standard for zakat distribution that is transparent, inclusive, and technologically advanced, starting with a state-by-state rollout to align with local regulations and Islamic councils.
ZakatDAO is built with the following objectives:
- Transparency: Provide a publicly accessible blockchain ledger to track all donations, votes, and disbursements.
- Shariah Compliance: Ensure zakat funds are allocated to the eight asnaf groups as per Islamic law, with oversight from state Islamic councils.
- Decentralized Governance: Enable donors and state authorities to participate in decision-making through a DAO, with state councils holding 51% voting weight and donors 49%.
- Inclusivity: Support underbanked and rural communities through e-wallet integration and offline vouchers.
- Efficiency: Use xAI for recipient prioritization and smart contracts for automated disbursements, minimizing operational costs.
To ensure alignment with local regulations and Islamic governance, ZakatDAO will be implemented on a state-by-state basis, starting with a pilot in Malaysia. Each state will have its own instance of the platform, customized to integrate with local Islamic councils and e-wallet providers. Key aspects of the state-by-state approach include:
- Local Islamic Council Oversight: State Islamic councils will hold 51% of the voting weight in the DAO, ensuring Shariah compliance and regulatory alignment. Donors collectively hold 49%, empowering community participation while respecting authority.
- Customized E-Wallet Integration: Each state will integrate with locally popular e-wallets (e.g., TNG, Boost, FPX in Malaysia) to ensure accessibility.
- Localized Asnaf Prioritization: xAI models will be trained on state-specific data to prioritize recipients based on local socioeconomic conditions.
- State-Specific Blockchain Ledger: Each state will maintain its own blockchain ledger, ensuring data sovereignty and compliance with local laws.
- Phased Rollout: The pilot will begin in one state (e.g., Selangor, Malaysia), with learnings applied to subsequent states. Each state will have its own governance token (ZGT) and smart contracts.
This approach ensures scalability while respecting regional differences in governance and infrastructure.
- Donation: Contribute via e-wallets or FPX, with instant confirmation and voucher issuance.
- Transparency: View the live blockchain ledger of all transactions, including donations and disbursements.
- Voting: Participate in DAO governance by voting on fund allocation (e.g., education, healthcare) and policy proposals.
- Vouchers: Download digital or printable vouchers showing donation usage, redeemable at partner merchants.
- xAI Prioritization: Uses xAI models to score recipients based on need, ensuring fair and data-driven fund allocation.
- Hybrid Decision-Making: Combines xAI scores with donor and authority votes for disbursement decisions.
- Manual Override: Large or sensitive disbursements require DAO voting for approval.
- Smart Contracts: Transparent, community-driven voting via Solidity-based smart contracts.
- Multi-Signature: Large fund releases require multiple signatures from authorities and donors.
- Immutable Records: All governance decisions are recorded on-chain for auditability.
- E-Wallet Support: Integrates with TNG, Boost, FPX, and other local payment systems.
- Offline Vouchers: QR code-enabled vouchers for recipients without digital access, redeemable at partner merchants.
- Tracking: Donors and recipients can track disbursements and voucher usage in real-time.
ZakatDAO's architecture is modular and scalable, integrating multiple technologies to deliver a seamless experience.
- Flask Backend: Handles API requests, user authentication, and integration with smart contracts.
- Smart Contracts: Written in Solidity, deployed on Ethereum or Polygon for governance and token management.
- Blockchain Ledger: An immutable CSV-based ledger for transaction records, with block height and hash validation.
- DAO Governance System: Manages proposals, voting, and token-based governance.
- xAI Disbursement Engine: Uses xAI models to prioritize recipients based on socioeconomic data.
[User Interface] ā [Flask Backend] ā [Smart Contracts]
ā
[Blockchain Ledger] ā [DAO Voting] ā [ZGT Token System]
ā
[xAI Engine] ā [Disbursement System] ā [E-Wallet Integration]- Type: Non-transferable ERC-20 token.
- Purpose: Used for weighted voting in the DAO.
- Minting Rules:
- 1 ZGT per 10 RM donated (max 100 ZGT per donation).
- 50 ZGT bonus for first-time donors.
- 5 ZGT for voting in a proposal.
- 20 ZGT for approved proposals.
- State-Specific: Each state has its own ZGT instance.
- Voting Weight: State Islamic councils (51%) + Donors (49%).
- Approval Threshold: 60% weighted approval.
- Minimum Votes: 3 votes per proposal.
- Voting Period: 24 hours.
- Proposal Types:
- Disbursement proposals (e.g., fund allocation to specific asnaf).
- Allocation policy proposals (e.g., percentage changes for asnaf categories).
-
Structure:
{ "transaction_id": "tx{uuid}", "block_height": "n", "block_hash": "{hash}", "prev_block_hash": "{hash}", "transaction_type": "IN/OUT", "amount": "float", "timestamp": "ISO-8601", "signatures": ["validator1", "validator2"] }Validation: Chain integrity is verified via
/api/verify-chain.
ZakatDAO's governance is designed to balance authority oversight with community participation, implemented through a DAO with the following rules:
- Voting Weight:
- State Islamic councils: 51% (ensuring Shariah compliance and regulatory alignment).
- Donors: 49% (collective weight, proportional to ZGT holdings).
- Proposal Types:
- Disbursement Proposals: For specific fund allocations (e.g., 100,000 RM for education).
- Allocation Policy Proposals: For changing asnaf percentages or usage priorities.
- Voting Process:
- Proposals are created by admins atĀ
/dao/allocations/proposeĀ orĀ/proposal/<id>. - Voting is open for 24 hours, requiring a minimum of 3 votes and 60% weighted approval.
- Approved proposals are auto-executed via smart contracts.
- Proposals are created by admins atĀ
- Multi-Signature: Large disbursements require signatures from multiple validators (e.g., council members and top donors).
- Transparency: All votes and outcomes are recorded on the blockchain ledger.
This model ensures that state authorities maintain control while donors have a meaningful voice, fostering trust and collaboration.
ZakatDAO leverages xAI's advanced AI models to prioritize recipients, ensuring fair and data-driven disbursements. The xAI engine is integrated as follows:
- Data Inputs:
- Socioeconomic data (e.g., income, family size, location).
- Asnaf category (e.g., poor, needy, debtors).
- State-specific factors (e.g., cost of living, unemployment rates).
- Scoring Process:
- xAI models assign a priority score to each recipient based on need and eligibility.
- Scores are normalized to ensure fairness across asnaf groups.
- Hybrid Decision-Making:
- xAI scores are combined with DAO votes to determine final disbursements.
- For manual disbursements, xAI scores serve as recommendations, subject to DAO approval.
- State-Specific Customization:
- xAI models are trained on state-specific datasets to reflect local conditions.
- Regular retraining ensures models remain accurate and relevant.
- Transparency:
- Priority scores and AI decision logs are recorded on the blockchain for auditability.
By using xAI, ZakatDAO ensures that zakat funds are allocated to those who need them most, while maintaining transparency and community oversight.
To set up ZakatDAO locally, follow these steps:
-
Clone the Repository:
git clone https://github.com/JienWeng/ZakatDAO cd ZakatDAO -
Set Up Virtual Environment:
python -m venv venv source venv/bin/activate # For Unix/macOS venv\Scripts\activate # For Windows -
Install Dependencies:
chmod +x install_dependencies.sh ./install_dependencies.sh -
Configure Environment Variables: Create aĀ
.envĀ file in the root directory with the following:FLASK_SECRET_KEY=your-secret-key ALCHEMY_API_KEY=your-alchemy-api-key POLYGONSCAN_API_KEY=your-polygonscan-api-key PRIVATE_KEY=your-wallet-private-key -
Run the Application:
flask run
- Navigate toĀ
/donate. - Fill in donation details (amount, payment method).
- Receive a unique voucher code.
- Track donation status in the public ledger atĀ
/ledger.
- Log in as admin atĀ
/admin/login. - Review available funds atĀ
/admin. - Choose disbursement method:
- Manual:Ā
/disburse. - AI-Powered:Ā
/admin/ai-disbursement.
- Manual:Ā
- Monitor transactions atĀ
/ledger.
- Recipients receive a TNG voucher (digital or printable).
- Use the voucher at partner merchants via QR code.
- Transactions are logged inĀ
usage.csv. - View usage history atĀ
/voucher/<code>/usage.
GET /api/ledger.json
- Description: View all transactions.
- Query Params:
- type: IN/OUT
- user: Filter by user ID
- voucher: Filter by voucher code
- start_date: Filter from date (ISO-8601)
- end_date: Filter to date (ISO-8601)
- Response: JSON array of transactions
GET /voucher/<code>
- Description: Get voucher details and usage history.
- Response: JSON with voucher details and usage log
POST /api/disburse
- Description: Disburse funds to a recipient.
- Headers: Authorization: Bearer <token>
- Body:
- recipient_id: string
- amount: float
- zakat_type_id: int
- Response: JSON with transaction details
GET /api/verify-chain
- Description: Verify ledger integrity.
- Response: JSON with validation status and latest block
/: Home page./donate: Donation form./ledger: Public transaction ledger./voucher/<code>: View voucher details./voucher/<code>/usage: View voucher usage history.
/admin: Admin dashboard./admin/login: Admin login page./admin/logout: Admin logout./admin/recipients: Manage recipients./admin/ai-disbursement: AI-powered disbursement interface.
/proposal/<id>: View proposal details./proposal/<id>/vote: Cast vote on a proposal (requires authentication)./dao: DAO governance dashboard./dao/proposals: View all proposals./dao/allocations: View current allocation policies./dao/allocations/propose: Propose new allocation policy (admin only)./dao/vote/<id>: Cast vote on a proposal.
| Layer | Technology |
|---|---|
| Frontend | React.js, Tailwind CSS |
| Backend | Node.js / Flask (Python) |
| Blockchain Layer | Ethereum / Polygon |
| Smart Contracts | Solidity |
| AI Models | Python (scikit-learn, TensorFlow, xAI) |
| Off-chain Storage | IPFS |
| E-Wallet Support | TNG, Boost, FPX |
| Deployment | AWS, Docker |
-
Install Dependencies:
npm install --save-dev hardhat @nomiclabs/hardhat-waffle @nomiclabs/hardhat-etherscan dotenv -
Configure Network: UpdateĀ
hardhat.config.js:networks: { mumbai: { url: `https://polygon-mumbai.g.alchemy.com/v2/${process.env.ALCHEMY_API_KEY}`, accounts: [process.env.PRIVATE_KEY] } } -
Deploy Contract:
npx hardhat run scripts/deploy.js --network mumbai -
Verify on Polygonscan: The contract will be automatically verified. Check status atĀ https://mumbai.polygonscan.com/.
-
Install Dependencies:
pip install -r requirements.txt -
Set Environment Variables: EnsureĀ
.envĀ includes:FLASK_SECRET_KEY= ALCHEMY_API_KEY= POLYGONSCAN_API_KEY= -
Deploy with Docker:
docker build -t zakatdao . docker run -p 5000:5000 zakatdao
- Access Control: Admin authentication, donor verification, and vote weight validation.
- Smart Contract Security: Non-transferable tokens, owner-only minting, restricted transfers.
- Data Integrity: Blockchain verification, multi-signature transactions, chain integrity checks.
- Privacy: Recipient data is anonymized, and sensitive information is stored off-chain on IPFS.
npx hardhat test test/ZakatGovernanceToken.test.js
- Layer 2 Scaling: Transition to Optimism or Arbitrum for lower transaction costs.
- Enhanced xAI Models: Incorporate real-time data feeds for more accurate prioritization.
- Mobile App: Develop iOS and Android apps for donor and recipient access.
- Additional E-Wallets: Support international payment systems like PayPal or Alipay.
- Advanced Analytics: Provide donors with detailed impact reports and visualizations.
- Global Expansion: Expand the platform to reach people globally.
- Sadaqah Application: Apply to Sadaqah-based DAO for more general application.
- GitHub: Report issues atĀ https://github.com/JienWeng/ZakatDAO.
- Troubleshooting: Refer toĀ
TROUBLESHOOTING.mdĀ in the repository. - Email: ContactĀ laijienweng@gmail.comĀ for inquiries.
ZakatDAO is a community-driven initiative to revolutionize zakat distribution. Join us in building a transparent, inclusive, and Shariah-compliant future for zakat.
