Multisig & Governance
Beginner
30 minutes

Кошелек с мультиплексом (стиль Казначейства М-Н)

Require M out of N signatures to spend from a shared treasury

Problem

You need multiple parties to authorize a transaction for security (treasury, DAO, escrow).

Solution

ErgoScript's atLeast() function enables native threshold signatures. Require M of N parties to sign without revealing which M signed (Sigma Protocol privacy).

How It Works

  1. 1Define N public keys of potential signers
  2. 2Set threshold M (minimum required signatures)
  3. 3Use atLeast(M, [pk1, pk2, ..., pkN])
  4. 4Any M signers can authorize spending
  5. 5Sigma protocols ensure signer privacy - observers can't tell which M signed

Code Examples

{
  // Treasury requires 2 of 3 board members
  val member1 = PK("9f...")
  val member2 = PK("9g...")
  val member3 = PK("9h...")
  
  // AtLeast 2 must sign
  atLeast(2, Coll(
    proveDlog(member1),
    proveDlog(member2),
    proveDlog(member3)
  ))
}

Classic 2-of-3 multi-sig. Any two members can authorize. Sigma protocols hide which two signed.

Use Cases

  • DAO treasuries
  • Corporate wallets
  • Escrow services
  • Cold storage security
  • Inheritance planning
  • Grant disbursement

Security Considerations

  • !Store keys in separate secure locations
  • !Consider adding time-locks for large amounts
  • !Plan for key loss scenarios (recovery procedures)
  • !Test with small amounts first
  • !Document key holders and succession plan

Real-World Implementations

Ergo Foundation

Treasury management

Paideia

DAO treasury contracts

Level Up Your ErgoScript Skills

Get notified about new patterns, tutorials, and developer resources.

Follow for daily updates