Repository navigation
What's New (summary)
- Confidential Token (new crate
stellar-confidential): SEP-41 tokens with private balances and transfers. Balances are Pedersen commitments on the Grumpkin curve, every operation that consumes private state carries an UltraHonk proof verified cross-contract, and auditors recover amounts through per-transfer ECDH. The crate ships the token, an auditor key registry, a verification key registry, and a compliance extension (freezing, SACauthorized()passthrough, external authorization policy, clawback). Noir circuits with pinned verification keys live inpackages/confidential/circuits, andexamples/confidentialhas a compliant token, an allowlist policy, and a factory. - Fungible and non-fungible contract types:
Compose<(...)>selects the contract type by listing the extensions a token is made of; invalid combinations fail to compile with a diagnostic naming the offending pair- total supply tracking is an opt-in
TotalSupplyextension Cappedis a contract type that enforces the cap on every mint path- Allowlist and Blocklist can be combined
- non-fungible Votes works with Enumerable and Consecutive, and Consecutive works with Royalties
- RWA:
- seven compliance modules ported from T-REX: country allow, country restrict, initial lockup period, max balance, supply limit, time-windowed transfer limits, and transfer allow, each with an example under
examples/rwa/ - batch operations, muxed address support, and mint pause
- recovery and identity registry fixes
- seven compliance modules ported from T-REX: country allow, country restrict, initial lockup period, max balance, supply limit, time-windowed transfer limits, and transfer allow, each with an example under
- Vault: deposits that mint zero shares and redemptions that return zero assets are rejected; the virtual supply is bounded and reported in
max_depositandmax_mint. - Smart Accounts: the signed digest binds the smart account address; spending-limit history is capped at the reachable ledger entry limit; new smart account factory example.
- Contract Utils: Grumpkin curve arithmetic;
Wadgainsln,exp,powiandpowf;I256mul_divrecovers from phantom overflow. - Fee Abstraction:
Eagerconsumes the whole approval and requires a balance-conserving fee token. - Error codes are unique across all packages, and each package owns a disjoint range (see
Architecture.md).
Breaking Changes
- Smart Accounts: signers commit to
sha256(AuthDigestPreimage { account, signature_payload, context_rule_ids }.to_xdr()), andDelegatedsigners authorize__check_authwith the preimage struct. Off-chain signing flows must be updated; see the migration guide inpackages/accounts/README.md. - Total supply: fungible tokens track the total supply only with the
TotalSupplyextension (RWA,VaultandCappedrequire it), and the counter moved out of instance storage. Tokens upgraded from v0.7.x must migrate it withmigrate_total_supply(seeexamples/upgradeable/v2). - Minting: mint through the selected contract type,
<Self as FungibleToken>::ContractType::mint(...). Calling a primitive such asBase::mintdirectly still compiles but skips the contract type's bookkeeping (supply counter, cap, voting units, enumeration). - RWA compliance: the
CanTransferandCanCreatehooks are removed.Transferred,CreatedandDestroyedboth enforce the rule (by panicking) and update module state, and module hooks receiveAccountSnapshots. - Error codes: most
#[contracterror]codes changed. Clients and tests that match on numeric codes must be updated. - Non-fungible:
get_approvedpanics withNonExistentTokenfor a nonexistent token instead of returningNone.
Security
- Smart Accounts: a
Delegatedsigner that is the contract of a context being authorized is rejected withDelegatedSignerIsContextContract, and a smart account can no longer be its ownDelegatedsigner (SelfDelegatedSigner).
What's Changed (detailed)
- Library conventions by @ozgunozerk in #689
- improve skill by @ozgunozerk in #691
- Power function for float raised by float by @ozgunozerk in #693
- apply fix for approve_for_all by @ozgunozerk in #695
- RWA: fix IRS event and max registries limit by @brozorec in #696
- rwa forced transfer fix by @ozgunozerk in #714
- mint pause mechanisms for rwa storage by @ozgunozerk in #717
- feat(confidential): noir primitives library for confidential token circuits by @brozorec in #712
- feat(confidential): register circuit by @brozorec in #715
- remove operator from freeze event by @ozgunozerk in #719
- compliance module restructure by @ozgunozerk in #723
- feat(crypto): Grumpkin affine point arithmetic by @brozorec in #729
- feat(confidential): Noir withdraw circuit by @brozorec in #727
- Country Compliance Module by @ozgunozerk in #724
- supply and balance compliance modules by @ozgunozerk in #726
- feat(confidential): verifier registry trait by @brozorec in #734
- feat(confidential): auditor key registry by @brozorec in #733
- feat(confidential): Noir transfer circuit by @brozorec in #728
- feat(confidential): Noir set_operator circuit by @brozorec in #730
- feat(confidential): Noir operator_transfer circuit by @brozorec in #731
- feat(confidential): Noir revoke_operator circuit by @brozorec in #732
- rwa compliance small fixes by @ozgunozerk in #737
- feat(confidential): wrapper contract + compliance extension by @brozorec in #735
- doc improvement by @ozgunozerk in #739
- fix(accounts): rm event fields from docstrings by @brozorec in #741
- fixed point todo items by @ozgunozerk in #740
- fix(confidential): event emission and non-canonical encodings by @brozorec in #746
- time limit transfer compliance module by @ozgunozerk in #745
- transfer restrict by @ozgunozerk in #747
- Bump
soroban_sdkand docs fixes by @brozorec in #749 - Rwa initial lockup by @ozgunozerk in #748
- doc fix for onchain id event by @ozgunozerk in #751
- improve checked consistency by @ozgunozerk in #754
- Fix events docstrings by @brozorec in #755
- zero transfer fix by @ozgunozerk in #759
- max balance fail on recovery fix by @ozgunozerk in #760
- remove event assertion crate by @ozgunozerk in #763
- Confidential Token Docs by @brozorec in #756
- Bind register proof to the registering account (audit L-06) by @brozorec in #775
- Gate the spender through the compliance policy (audit L-01) by @brozorec in #776
- Validate Grumpkin point inputs at the public API (audit L-05) by @brozorec in #777
- Match the on-chain Poseidon2 sponge on empty input (audit L-04) by @brozorec in #779
- Clarify registration-time auditor selection (audit L-02) by @brozorec in #780
- Pin the circuit toolchain and document proving flags (audit N-01, N-05) by @brozorec in #788
- Confidential token documentation accuracy fixes (audit N-06, N-09, N-10, N-11) by @brozorec in #789
- Rename verifier
vkidentifiers toverification_key(audit N-02) by @brozorec in #791 - Pass typed payload structs to confidential token hooks (audit N-04) by @brozorec in #790
- Derive the withdraw auditor checkpoint pad from the second sponge squeeze (audit N-07) by @brozorec in #792
- ci: make required check report on docs-only PRs by @brozorec in #797
- Add INDEXER.md indexing/recovery specification (audit N-08) by @brozorec in #794
- Bind the ECDH shared secret to the full shared point (audit L-03) by @brozorec in #778
- preset for supply limit by @ozgunozerk in #799
- M 01 by @ozgunozerk in #801
- fix broken rustdoc links across the workspace by @ozgunozerk in #806
- exp wad boundaries by @ozgunozerk in #808
- cannot remove/change identity with non-zero balance by @ozgunozerk in #803
- Document RWA compliance limitations and correct burn error listing (audits L-08, N-18) by @brozorec in #804
- [N-13] - reduce duplicate calls by @ozgunozerk in #814
- fix(sac-admin-generic): correct off-by-one in mint/clawback arg indices by @brozorec in #811
- doc burn behavior for lock and frozen by @ozgunozerk in #818
- eager prune for lockup by @ozgunozerk in #810
- chore: bump soroban-sdk to 27.0.2 by @brozorec in #816
- refresh recipient TTL on every transfer (N-16) by @brozorec in #812
- Rename ambiguous
txsubscript totransferin confidential module (N-03) by @brozorec in #815 - docs(weighted-threshold): document required operation ordering for signer weight and threshold updates by @brozorec in #819
- Confidential Token: specify the client SDK layer by @brozorec in #822
- fix 0 voting period by @ozgunozerk in #835
- fix error doc links by @ozgunozerk in #831
- fix(ci): rewrap comments for indent-aware rustfmt by @brozorec in #862
- 512 bit support by @ozgunozerk in #851
- Rwa batch by @ozgunozerk in #841
- feat(confidential): escrow commitment blindings to the sender-auditor by @brozorec in #853
- feat(confidential): make revoke_spender proofless by @brozorec in #854
- feat(confidential): add compliance clawback by @brozorec in #855
- fix: cap spending history at the reachable ledger entry limit by @yigitcangokmen in #848
- Rwa muxed support by @ozgunozerk in #857
- carry freeze status on 0 balance recovery by @ozgunozerk in #871
- Confidential Token: Clawback proof bindings by @brozorec in #872
- fee-abstraction: consume the whole eager approval by @brozorec in #873
- Confidential Token: docs refactor by @brozorec in #869
- Smart account: auth payload digest by @brozorec in #868
- uniform contract type composition via Compose by @ozgunozerk in #821
- make votes work with enumerable and consecutive by @ozgunozerk in #878
- consecutive and royalty support by @ozgunozerk in #879
- feat(examples): add smart account factory example by @ericglau in #867
- allowlist/blocklist remove mutual exclusivity by @ozgunozerk in #881
- Feat/optional total supply by @ozgunozerk in #795
- Vault: reject deposits that mint zero shares by @brozorec in #883
- capped extension by @ozgunozerk in #885
- better comments to prevent incorrect bug submission by @ozgunozerk in #899
- vault virtual supply bound by @ozgunozerk in #895
- Confidential Token: wire up Ultrahonk verifier by @brozorec in #820
- chore: bump soroban-sdk to P28 by @brozorec in #866
- Route minting through the contract type with mint override traits by @ozgunozerk in #911
- Merge release into main by @brozorec in #918
- Make Capped a contract type that enforces the cap on every mint path by @ozgunozerk in #913
- [L-05] Vault: reject redeeming shares for zero assets by @ozgunozerk in #921
- Fee abstraction: restrict Eager to balance-conserving fee tokens by @brozorec in #919
- Confidential token: crate split by @brozorec in #922
- Fee abstraction: extend moved token entries on swap-and-pop removal by @brozorec in #917
- Make contract error codes unique across packages by @brozorec in #928
- [L-06] IRS: keep a recovery target's identity until the tokens arrive by @ozgunozerk in #924
- Vault: report the virtual supply bound in max_deposit and max_mint by @ozgunozerk in #915
- [L-02] Fix misleading documentation by @ozgunozerk in #932
- Fungible: migration path for the total supply moved out of instance storage by @ozgunozerk in #933
- NFT: get_approved panics with NonExistentToken for nonexistent tokens by @ozgunozerk in #935
- Governor: enforce overridden settings and outcome rule, split into three traits by @ozgunozerk in #938
- fix: spell out BytesN<64> in confidential contracttype fields by @brozorec in #940
- Confidential token: compliant token, allowlist policy, and factory examples by @brozorec in #941
- get approved existence override for consecutive by @ozgunozerk in #944
- Confidential Token: pass G and H to
multi_scalar_mulas witnesses by @brozorec in #945 - Confidential Token: use the crates.io release of the UltraHonk verifier by @brozorec in #943
- Revert "Governor: enforce overridden settings and outcome rule, split into three traits" by @brozorec in #948
- Smart account: reject cyclic delegated signers (GHSA)
New Contributors
- @yigitcangokmen made their first contribution in #848
- @ericglau made their first contribution in #867
Full Changelog: v0.7.1...v0.8.0