Skip to content

Conversation

@runcomet
Copy link
Contributor

This PR implements crowdsourced decision deposits, enabling multiple contributors to collectively fund the decision deposit of a referendum. Previously, the decision deposit had to be paid in full by a single address, which could limit participation and concentrate power. This feature allows the deposit to be split among different addresses, up to a configurable maximum, democratizing the funding process while preserving the economic security guarantees of deposits.

Existing work from @bkchr and @PolkadotDom, with refinements to address edge cases. Configurable limits are set via the MaxDepositContributions parameter. The system uses efficient allocation where only the top N contributions are considered, automatically refunding lower contributions when higher ones arrive.

Contributions cannot be decreased once made to prevent griefing attacks, and monotonic replacement guarantees contributions can only be replaced by higher amounts.

A new storage structure replaces the decision_deposit field in ReferendumStatus with a DecisionDeposit struct containing the collected deposit total, required track deposit amount, and a bounded vector of contributor-amount pairs sorted by amount.

This implementation closes #6041, fulfilling the requirement to consider only the n highest amounts paid while refunding lower ones, ensuring efficient use of contribution slots while enabling broad participation in governance.

@runcomet runcomet requested a review from a team as a code owner December 31, 2025 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pallet-referenda] Crowd Sourced Decision Deposit

3 participants