feat: collateralized permissionless saving circles#182
Open
RonTuretzky wants to merge 2 commits into
Open
Conversation
Adds a variant of the saving circle that removes the trust bound of the baseline ROSCA. Members complete a first 'collateral cycle' of deposits without withdrawing (accruing one whole pot of locked collateral each), which fully secures the second 'payout cycle' against defaults: any missed deposit is covered from the delinquent member's own collateral, so the recipient is always paid in full and honest members never subsidize a defaulter, for any number of defaulters. Eliminating this credit risk is what lets membership be opened permissionlessly (no owner, no invites). - docs/collateralized-permissionless-circles.md: formal spec extending the Deckstacking model, with the Collateral-first design (Variant A) plus two alternatives (rolling-bond, insured under-collateral) and a proof that the baseline's (n-t) recovery bound becomes an unconditional n. - src/interfaces/ICollateralSavingCircles.sol + src/contracts/CollateralSavingCircles.sol - test/unit/CollateralSavingCirclesUnit.t.sol: happy path, default-absorbed- by-collateral safety, safe abort, permissionless membership.
…ess chit) Stress-tests Variants A-C against the Indian chit fund (Chit Funds Act 1982) and the bidding-ROSCA literature, and folds the findings back into the model: - Risk anatomy: only prized members carry credit-theft risk; non-prized default is claim forfeiture, absorbed by removal + substitution (Act ss.28-30) or resizing (Lemma 5.3). A/B collateralize everyone for the worst case and overpay ~4x vs the outstanding-credit parabola K(j) = (j+1)(n-1-j)m (Cor. 5.2). - Backports: prize-time (JIT) collateral replacing B's uniform bond (I1), release-at-prize refund schedule for A (I2), substitution = any-round permissionless leave for every variant (I3). - Variant D 'foremanless chit': sealed-bid 2k/k commit-reveal reverse auction (Deckstacking-robust, MEV-aware), bid discount withheld as first-loss security so price substitutes for cash collateral (withheld + coll = residual, Theorem D3), dividends as endogenous interest, capital within n*m of the theoretical floor (D4), rotation as the no-bid degenerate case. - Warning: auction + under-collateralization (C) is an adverse-selection engine; excluded (s.5.5). - No-free-lunch trilemma (Prop. 5.4): unconditional safety + anonymous membership + same-asset net credit - pick two; the foreman's vetting is where unsecured credit comes from.
Contributor
Author
|
Follow-up commit (49529df): stress-tested the model against chit funds & the reverse-auction (bidding-ROSCA) literature — it changed the spec. TL;DR of what the chit-fund lens (Chit Funds Act 1982; Besley–Coate–Loury 1993; Kovsted–Lyk-Jensen 1999) surfaced:
Spec-only change ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a collateralized, permissionless variant of the saving circle that removes the trust bound present in the current
SavingCirclesdesign, together with a formal specification and a full unit-test suite.It is a direct response to the design question: what mechanism lets membership be opened permissionlessly — anyone joins, anyone leaves — without an honest member ever subsidizing a defaulter?
The idea (Variant A — "collateral-first")
A circle runs exactly two cycles of
nrounds:rounds 0..n-1): everyone deposits the per-round amountm, but nobody withdraws. Each member'sndeposits accrue into a locked collateral balance ofn·m— one whole pot. This is the "complete the first full circle without withdrawing" phase.rounds n..2n-1): a normal ROSCA. Each round the slot's occupant withdraws the full potn·m. If any member fails to deposit, the shortfall is drawn from that member's own locked collateral, so the recipient is always paid in full.Because every member's collateral (
n·m) is at least its maximum possible unmet obligation, an honest member never loses funds regardless of how many others default. Eliminating this credit risk is precisely what makes membership safe to open permissionlessly: there is no owner, no EIP-712 invite, and no frozen cohort. If the collateral cycle finishes under-funded, anyone canabortand everyone is refunded — no payout can have occurred yet, so no one is harmed.What changed vs. the baseline
The baseline
SavingCirclescan only guarantee an honest saver recovers(n − t)·munder an adversary controllingtsavers (its Bounded-recovery theorem). The residualt·mis the unsecured credit an early recipient can walk away with, and it is why the baseline must gate entry with owner-signed invites and freeze the cohort atstart. This variant drivest → 0: the guarantee becomes an unconditionaln·m, so the door can be opened.Contents
docs/collateralized-permissionless-circles.md— a formal spec extending the Deckstacking / Bartoletti–Zunino model used in the project's specification. It gives the extended contract state and SOS transition rules (Deposit, Lock, Withdraw, Cover, Join, Leave), proves fund conservation, payout uniqueness, and the Collateral-Safety theorem (no trust threshold), and sketches two neighbouring designs:(n−1)·mlump bond posted at join, enabling any-round permissionless join/leave (no cycle-0 latency).α·mcollateral (α ≪ n) plus a mutual insurance buffer and late-slot placement, trading unconditional safety for capital efficiency.K(j)=(j+1)(n−1−j)m; fix is prize-time (JIT) collateral. Variant D composes a sealed-bid reverse auction (Deckstacking-robust2k/kcommit-reveal; the winning discount is withheld as first-loss security, sowithheld + lock = residual— Theorem D3) with substitution-based any-round join/leave; dividends give patient members endogenous interest; capital is withinn·mof the theoretical floor (D4). Also: a proof-sketched trilemma (safety / anonymity / same-asset credit — pick two) and a warning that the auction must not be combined with under-collateralized Variant C (adverse selection, §5.5).src/interfaces/ICollateralSavingCircles.sol+src/contracts/CollateralSavingCircles.sol— upgradeable implementation of Variant A (lump-of-collateral-by-accrual form), following repo conventions (interface holds errors/events/structs,@inheritdoc,ReentrancyGuard,SafeERC20, admin-managed token allow-list).test/unit/CollateralSavingCirclesUnit.t.sol— 11 unit tests: full happy path (net-zero for all), a total defaulter with recipients still made whole and honest members losing nothing, partial default slashing only the defaulter, safeabortof an incomplete collateral cycle, and permissionless create/join/start plus parameter/guard checks.Testing
Notes / scope
SavingCircles/AutomaticSavingCirclescontracts.Formal model and rationale in full:
docs/collateralized-permissionless-circles.md.