Skip to content

Implemented Multi-Signature Wallet Support#451

Merged
truthixify merged 8 commits intoDistinctCodes:mainfrom
Sandijigs:Implement_Multi-Signature_Wallet_Support
Jan 30, 2026
Merged

Implemented Multi-Signature Wallet Support#451
truthixify merged 8 commits intoDistinctCodes:mainfrom
Sandijigs:Implement_Multi-Signature_Wallet_Support

Conversation

@Sandijigs
Copy link
Contributor

Description

Enhanced the access control system with advanced multi-signature operations for critical administrative functions, significantly improving security for high-value operations.

fixes issue #425

Changes Made

  • Enhanced Multisig Structures: Added tiered signature thresholds (standard, critical, emergency) with automatic proposal classification
  • Time-Locked Operations: Implemented mandatory delay periods (24h default) for critical operations requiring multisig approval
  • Emergency Procedures: Added emergency override mechanisms with higher signature thresholds (requiring all admins)
  • Comprehensive Proposal Management: Full lifecycle support with approval, rejection, cancellation, and automatic expiration
  • Signature Validation: Prevents duplicate approvals, validates thresholds, tracks rejections
  • Proposal Cleanup: Automatic expiration after 7 days with manual cleanup capability

Files Modified

  • contracts/access_control/src/types.rs - Added ProposalType enum, enhanced MultiSigConfig and PendingProposal structures
  • contracts/access_control/src/errors.rs - Added 18 multisig-specific error codes
  • contracts/access_control/src/access_control.rs - Implemented enhanced proposal workflow with 10+ new functions
  • contracts/access_control/src/lib.rs - Added 9 new public endpoints
  • contracts/access_control/src/access_control_tests.rs - Added 20+ comprehensive test cases
  • contracts/manage_hub/src/lib.rs - Added integration documentation

Key Features

✅ Tiered signature thresholds (2/3/4 for standard/critical/emergency operations)
✅ Time-locked critical operations with configurable delays
✅ Emergency mode with highest approval requirements
✅ Proposal rejection mechanism with auto-rejection threshold
✅ Comprehensive statistics tracking (created/executed/rejected/expired)
✅ Automatic cleanup of expired proposals

Testing

  • All code compiles successfully
  • 20+ new test cases covering all scenarios
  • Comprehensive validation of thresholds, time-locks, and workflows

Security Improvements

  • Multi-admin consensus required for critical operations
  • Time delays prevent hasty high-impact changes
  • Emergency procedures require maximum oversight
  • Duplicate approval prevention
  • Automatic expiration prevents stale proposals

Example Usage

// Initialize with 5 admins, requiring 3 for standard ops
initialize_multisig(&env, admins, 3, None);
// Auto-calculates: critical_threshold=4, emergency_threshold=5

// Critical operation (needs 4 approvals + 24h delay)
let proposal_id = create_proposal(&env, admin1, 
    ProposalAction::UpdateConfig(new_config));

Closes #425

@vercel
Copy link

vercel bot commented Jan 28, 2026

@Sandijigs is attempting to deploy a commit to the naijabuz's projects Team on Vercel.

A member of the Team first needs to authorize it.

- Add missing Ledger trait import to access_control_tests
- Remove unused mut keywords on admins and ms_config variables
- Add clippy allow attribute for update_multisig_config_full function
- Import LedgerInfo from soroban_sdk::testutils instead of soroban_sdk::ledger
- Update all LedgerInfo references to use the correct import
Remove unnecessary reference operators for generic args in contains() calls
…l version

- Add time advancement past time-lock for critical proposals (AddAdmin, BatchBlacklist, Pause)
- Fix protocol version from 20 to 22 to resolve InternalError
- Critical proposals require both critical_threshold AND time-lock to pass before execution
Previous version 22 was still too old for the host
@Sandijigs
Copy link
Contributor Author

Hi @truthixify , please help review and merge , All conflict has been resolved

@truthixify truthixify merged commit e003e71 into DistinctCodes:main Jan 30, 2026
4 of 5 checks passed
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.

CONTRACTS: Implement Multi-Signature Wallet Support

2 participants