Testnet · Mainnet coming soon

Require two of three keys after an unlock time

12 min read

View as Markdown
Contents

You build a shared vault that pays out only when two of three people sign, and only after a date fixed when the vault is created. You create a contract account with one function: it approves a transfer of the contract's notes when two of three configured keys sign that exact transfer and the transaction cannot execute before the configured unlock time. This is an example: unaudited and not for real funds.

How it works

  1. You choose three signer keys, an unlock time and a random salt, and the contract's one function commits their hash as its configuration. The contract is created by the transfer that first funds it, and from then on its notes move only when this function approves. The signers share the contract's nullifier key, which spending needs, and the secret of its receive key, which decrypts deposits and change.
  2. To spend, the app builds a transaction whose notBeforeTimestamp is the unlock time. Every PCASH transaction carries this field, and the network never executes a transaction in a block whose timestamp, the Ethereum block's timestamp, is earlier. The function requires the field to be at or after the unlock time, so the network's own check becomes the time lock.
  3. Two of the three signers sign a hash of the transaction's action and the contract's address. The action covers every field of the transaction, notBeforeTimestamp included, so the signatures approve this one transfer and nothing else.
  4. The app proves the transaction. The circuit checks the time bound and both signatures and returns the statement the network compares with the contract's installed function. The proof names a recent PCASH block and is valid for one hour after that block, so prove within the hour before the transaction should execute.
  5. The transaction is submitted. If it lands in a block before the unlock time, it fails and spends nothing: the chain does not hold it until later. It can be submitted again after the unlock, with a new proof once its hour has passed.

The circuit

The configuration commits the salt, the threshold, the three signer addresses in ascending order, and the unlock time. The salt keeps readers of the public contract from learning the signers or the date.

// poseidon(REFERENCE_CONFIGURATION_DOMAIN, salt, K, signer_0, signer_1, signer_2,
//          unlock_timestamp), signer addresses ascending. The salt hides the
// signers and the unlock time from readers of the published contract body.
pub fn configuration_commitment(
    configuration: Configuration,
    signer_addresses: [Field; N],
) -> Field {
    pcash_hash([
        REFERENCE_CONFIGURATION_DOMAIN,
        configuration.configuration_salt,
        K as Field,
        signer_addresses[0],
        signer_addresses[1],
        signer_addresses[2],
        configuration.unlock_timestamp,
    ])
}

The time lock. The circuit opens the transaction and requires its notBeforeTimestamp to be at or after the unlock time. The network treats a zero bound as no bound, so a zero fails here.

    // A zero lower bound is unconstrained, so it fails any nonzero unlock time.
    assert(
        timestamp_le(
            configuration.unlock_timestamp,
            private_value.not_before_timestamp,
        ),
        "transfer must not execute before the unlock time",
    );

The action. The circuit computes it from the transaction itself, so the signers approve exactly what executes. fee_paid selects the sponsored-transfer action, used when another account pays the network fee; the signers sign whichever action results.

    let action_commitment = contract_action_commitment(
        pcash_chain_id,
        private_value_commitment(private_value),
        fee_paid,
    );

What each signer signs: a hash of the action and the contract's address.

// What each signer signs, as in the multisig fixture. The action commitment
// carries the chain ID and every private-value field, `notBeforeTimestamp`
// included.
pub fn approval_digest(action_commitment: Field, account_address: Field) -> Field {
    pcash_hash(
        [REFERENCE_MULTISIG_APPROVAL_DOMAIN, action_commitment, account_address],
    )
}

The signers' addresses must be strictly ascending, which rules out listing one key twice and gives each signer set one configuration.

    // Ascending order makes the signers distinct and the commitment canonical.
    let mut addresses: [Field; N] = [0; N];
    for i in 0..N {
        addresses[i] = signers[i].ethereum_address();
    }
    for i in 1..N {
        assert(addresses[i - 1].lt(addresses[i]), "signers must be sorted ascending and distinct");
    }

Each of the two approvals names a signer and carries that signer's signature over the digest. The two must name different signers.

    let message: [u8; 32] = approval_digest(action_commitment, account_address).to_be_bytes();
    for a in 0..K {
        let index = approvals[a].signer_index;
        assert(index < N, "signer index must be below the signer count");
        Signature { signature: approvals[a].signature }.verify(message, signers[index]);
    }
    assert(
        approvals[0].signer_index != approvals[1].signer_index,
        "approval signers must be distinct",
    );

The function returns four values: the contract's address with its configuration, the action, the recent block and the event entry. The protocol kernel computes the same four from the installed function and the transaction, and the proof is valid only if they match. That match is what ties the configuration the circuit opened to the one the contract published.

    rule_statement(
        authorization_commitment(
            account_address,
            configuration_commitment(configuration, addresses),
        ),
        action_commitment,
        recent_pcash_block_hash,
        event_entry,
    )
The whole circuit
// Approves a contract-account transfer that two of three configured keys sign and that cannot execute before a configured unlock time.
// Example only: unaudited, not for real funds.

// Two checks in one function. The signature check is the multisig fixture's:
// two distinct configured signers sign the contract's address and the exact
// action commitment. The time lock is escrow reclaim's: the function requires
// the transaction's `notBeforeTimestamp` to be at or after the configured
// unlock time, and consensus never executes a transaction before its
// `notBeforeTimestamp`.

use pcash_protocol::authorization::statement::{
    authorization_commitment, contract_action_commitment, rule_statement, RULE_STATEMENT_LENGTH,
};
use pcash_protocol::ledger::private_value::{
    private_value_commitment, SmallPrivateValue as PrivateValue,
};
use pcash_protocol::primitives::hash::pcash_hash;
use pcash_protocol::primitives::range::timestamp_le;
use reference_rule_common::generated::reference_rule_constants::{
    REFERENCE_CONFIGURATION_DOMAIN, REFERENCE_MULTISIG_APPROVAL_DOMAIN,
};
use signature_common::secp256k1::{Secp256k1PubKey, Signature};

global N: u32 = 3;
global K: u32 = 2;

pub struct Configuration {
    pub configuration_salt: Field,
    pub unlock_timestamp: Field,
}

pub struct Approval {
    // Position of the signer in the ascending signer list.
    pub signer_index: u32,
    // r || s over the approval digest.
    pub signature: [u8; 64],
}

// poseidon(REFERENCE_CONFIGURATION_DOMAIN, salt, K, signer_0, signer_1, signer_2,
//          unlock_timestamp), signer addresses ascending. The salt hides the
// signers and the unlock time from readers of the published contract body.
pub fn configuration_commitment(
    configuration: Configuration,
    signer_addresses: [Field; N],
) -> Field {
    pcash_hash([
        REFERENCE_CONFIGURATION_DOMAIN,
        configuration.configuration_salt,
        K as Field,
        signer_addresses[0],
        signer_addresses[1],
        signer_addresses[2],
        configuration.unlock_timestamp,
    ])
}

// What each signer signs, as in the multisig fixture. The action commitment
// carries the chain ID and every private-value field, `notBeforeTimestamp`
// included.
pub fn approval_digest(action_commitment: Field, account_address: Field) -> Field {
    pcash_hash(
        [REFERENCE_MULTISIG_APPROVAL_DOMAIN, action_commitment, account_address],
    )
}

fn main(
    pcash_chain_id: Field,
    recent_pcash_block_hash: Field,
    // True in a sponsored transfer, where another account pays the network fee.
    // The signers sign the resulting action, so they choose the role.
    fee_paid: bool,
    configuration: Configuration,
    private_value: PrivateValue,
    account_address: Field,
    signers: [Secp256k1PubKey; N],
    approvals: [Approval; K],
    event_entry: Field,
) -> return_data [Field; RULE_STATEMENT_LENGTH] {
    // A zero lower bound is unconstrained, so it fails any nonzero unlock time.
    assert(
        timestamp_le(
            configuration.unlock_timestamp,
            private_value.not_before_timestamp,
        ),
        "transfer must not execute before the unlock time",
    );

    let action_commitment = contract_action_commitment(
        pcash_chain_id,
        private_value_commitment(private_value),
        fee_paid,
    );

    // Ascending order makes the signers distinct and the commitment canonical.
    let mut addresses: [Field; N] = [0; N];
    for i in 0..N {
        addresses[i] = signers[i].ethereum_address();
    }
    for i in 1..N {
        assert(addresses[i - 1].lt(addresses[i]), "signers must be sorted ascending and distinct");
    }

    let message: [u8; 32] = approval_digest(action_commitment, account_address).to_be_bytes();
    for a in 0..K {
        let index = approvals[a].signer_index;
        assert(index < N, "signer index must be below the signer count");
        Signature { signature: approvals[a].signature }.verify(message, signers[index]);
    }
    assert(
        approvals[0].signer_index != approvals[1].signer_index,
        "approval signers must be distinct",
    );

    rule_statement(
        authorization_commitment(
            account_address,
            configuration_commitment(configuration, addresses),
        ),
        action_commitment,
        recent_pcash_block_hash,
        event_entry,
    )
}

mod tests {
    use super::{Approval, Configuration, configuration_commitment, main};
    use pcash_protocol::authorization::statement::{
        assert_rule_statement, authorization_commitment, contract_action_commitment,
        RULE_STATEMENT_LENGTH,
    };
    use pcash_protocol::ledger::private_value::{
        private_value_commitment, SmallPrivateValue as PrivateValue,
    };
    use reference_rule_common::test_support::{
        small_transaction, TEST_PCASH_CHAIN_ID, TEST_RECENT_BLOCK,
    };
    use signature_common::secp256k1::Secp256k1PubKey;

    global CONTRACT: Field = 0x3333333333333333333333333333333333333333;
    global UNLOCK: Field = 1800000000;
    global CONFIGURATION: Configuration =
        Configuration { configuration_salt: 0x5a17, unlock_timestamp: UNLOCK };

    // Private keys 0xb0b, 0xca401 and 0xa11ce, in ascending address order.
    global SIGNER_ADDRESSES: [Field; 3] = [
        0x0376aac07ad725e01357b1725b5cec61ae10473c,
        0x0f89f1868af3b14a5eca86ed9a5404a742a11454,
        0xe05fcc23807536bee418f142d19fa0d21bb0cff7,
    ];
    global SIGNERS: [Secp256k1PubKey; 3] = [
        Secp256k1PubKey {
            x: [
                0x5d, 0x45, 0xcb, 0x81, 0xaa, 0x76, 0x5d, 0x69, 0xca, 0x52, 0xe3, 0x86, 0x94, 0x91,
                0xec, 0xf0, 0xe8, 0xfd, 0xf6, 0xa6, 0x3d, 0x64, 0xe6, 0x5b, 0x52, 0x13, 0x64, 0x7e,
                0xe4, 0x97, 0x3a, 0xe5,
            ],
            y: [
                0xa4, 0xa4, 0xa3, 0x2b, 0x51, 0xa7, 0x6d, 0x77, 0x77, 0x35, 0x17, 0xe7, 0xc1, 0x03,
                0xa7, 0xdc, 0xfd, 0xab, 0x36, 0xfe, 0x3c, 0xaf, 0xa2, 0xbd, 0xb1, 0x7f, 0x82, 0xb1,
                0x2f, 0xd0, 0x19, 0xdb,
            ],
        },
        Secp256k1PubKey {
            x: [
                0xc3, 0xbb, 0x02, 0x67, 0x3c, 0x15, 0xe3, 0x50, 0xc1, 0xa1, 0x0d, 0x91, 0xa9, 0xa7,
                0x8f, 0x63, 0xee, 0x0b, 0x4b, 0x3f, 0x3e, 0x46, 0x11, 0xe0, 0x6d, 0x40, 0xc2, 0x45,
                0x30, 0x8b, 0xd6, 0x13,
            ],
            y: [
                0x87, 0x76, 0x1c, 0x15, 0x01, 0xdc, 0x74, 0x57, 0x6c, 0xcc, 0x7d, 0x9f, 0x5b, 0x2a,
                0x6a, 0xd5, 0xe5, 0x14, 0x46, 0x41, 0x2c, 0xf7, 0x6e, 0xb9, 0x6f, 0x78, 0x38, 0x0c,
                0xd7, 0xc1, 0xa0, 0xab,
            ],
        },
        Secp256k1PubKey {
            x: [
                0xa6, 0x4d, 0xb4, 0x1e, 0x29, 0x68, 0xc8, 0x49, 0xc2, 0xa5, 0x61, 0x5b, 0xa0, 0xd6,
                0xe8, 0x16, 0x73, 0x4a, 0x6d, 0x3e, 0x6e, 0xa6, 0xec, 0xd6, 0xf3, 0xac, 0xb7, 0xd5,
                0x9d, 0xaa, 0x91, 0x02,
            ],
            y: [
                0xe7, 0xaf, 0x12, 0xd6, 0xe0, 0x72, 0x38, 0xe7, 0xd5, 0xf5, 0xf6, 0xe9, 0xd6, 0xa5,
                0x29, 0x83, 0x3a, 0x30, 0xf7, 0x38, 0x50, 0x75, 0xfd, 0x74, 0x02, 0x9d, 0xb8, 0x00,
                0x9a, 0x5a, 0xce, 0x9a,
            ],
        },
    ];

    // Each signer's signature over the approval digest of `transfer()` on CONTRACT.
    global SIGNATURES: [[u8; 64]; 3] = [
        [
            0xbb, 0x32, 0x4a, 0x73, 0x20, 0xb9, 0xda, 0x0b, 0x5e, 0xb7, 0x7e, 0x4e, 0xe1, 0x6a,
            0x99, 0xc3, 0xb3, 0xca, 0xdd, 0x2c, 0x40, 0x79, 0xf5, 0x9a, 0x41, 0xa9, 0xaf, 0xbf,
            0x2e, 0x28, 0x27, 0x64, 0x30, 0xc0, 0xcc, 0xbd, 0x82, 0x1d, 0xa8, 0xf2, 0x14, 0xb0,
            0x28, 0xe2, 0x17, 0x05, 0x6f, 0x76, 0x7a, 0x54, 0xe1, 0xc9, 0x14, 0xce, 0xaa, 0xd2,
            0x49, 0xa0, 0xfb, 0x99, 0x4f, 0x91, 0x01, 0xd7,
        ],
        [
            0x8f, 0xe8, 0xbc, 0xd5, 0x74, 0x44, 0x54, 0x02, 0x8e, 0x85, 0x1b, 0xfa, 0xa7, 0x19,
            0xfb, 0xe4, 0x0f, 0xae, 0xe6, 0x48, 0xc9, 0x80, 0x3b, 0xfa, 0xd4, 0x0c, 0x85, 0xf1,
            0xf5, 0xef, 0x5e, 0x86, 0x52, 0x6b, 0x42, 0xb7, 0xff, 0xb7, 0x89, 0x2d, 0x48, 0x5c,
            0xa9, 0x79, 0xbc, 0x91, 0x28, 0xc8, 0x91, 0xe0, 0x96, 0x80, 0x6f, 0xd4, 0x4f, 0xbf,
            0x96, 0x5c, 0x79, 0x4d, 0x1c, 0xb6, 0x8e, 0x39,
        ],
        [
            0xe7, 0x1c, 0x9d, 0xbf, 0x9c, 0x50, 0x22, 0x61, 0x70, 0x67, 0x4b, 0x8d, 0x35, 0x99,
            0x09, 0x48, 0x1b, 0xcb, 0x29, 0x36, 0x09, 0x32, 0xfd, 0x75, 0xd6, 0xe1, 0xe2, 0xa9,
            0x49, 0x9c, 0xb2, 0xe8, 0x58, 0x61, 0x83, 0x94, 0xd3, 0xc2, 0xc2, 0xc9, 0xa0, 0x88,
            0x33, 0x5b, 0x4d, 0xc8, 0x7c, 0x3e, 0x77, 0x32, 0xcd, 0x53, 0xe6, 0xd1, 0x33, 0x8f,
            0x66, 0x6b, 0x1e, 0x56, 0xaa, 0x0e, 0x4f, 0xe1,
        ],
    ];

    // A transfer whose lower bound is exactly the unlock time.
    fn transfer() -> PrivateValue {
        let mut private_value = small_transaction(0, 1900000000);
        private_value.not_before_timestamp = UNLOCK;
        private_value
    }

    fn approval(signer_index: u32) -> Approval {
        Approval { signer_index, signature: SIGNATURES[signer_index] }
    }

    fn run(
        configuration: Configuration,
        private_value: PrivateValue,
        approvals: [Approval; 2],
    ) -> [Field; RULE_STATEMENT_LENGTH] {
        main(
            TEST_PCASH_CHAIN_ID,
            TEST_RECENT_BLOCK,
            false,
            configuration,
            private_value,
            CONTRACT,
            SIGNERS,
            approvals,
            0,
        )
    }

    // Frozen: the SDK's referenceConfigurationCommitment(0x5a17,
    // [2, ...SIGNER_ADDRESSES, UNLOCK]), which client.ts installs.
    #[test]
    fn configuration_commitment_matches_the_sdk() {
        assert(
            configuration_commitment(CONFIGURATION, SIGNER_ADDRESSES)
                == 0x27970ea4656fd64dc221a5791372fbfaf7f485121c0dd79ee64c530b667aeeb5,
        );
    }

    #[test]
    fn two_signers_approve_at_the_unlock_time() {
        assert_rule_statement(
            run(CONFIGURATION, transfer(), [approval(0), approval(2)]),
            authorization_commitment(
                CONTRACT,
                0x27970ea4656fd64dc221a5791372fbfaf7f485121c0dd79ee64c530b667aeeb5,
            ),
            contract_action_commitment(
                TEST_PCASH_CHAIN_ID,
                private_value_commitment(transfer()),
                false,
            ),
            TEST_RECENT_BLOCK,
            0,
        );
    }

    #[test]
    fn any_two_of_the_three_approve() {
        let _ = run(CONFIGURATION, transfer(), [approval(1), approval(0)]);
        let _ = run(CONFIGURATION, transfer(), [approval(2), approval(1)]);
    }

    #[test(should_fail_with = "approval signers must be distinct")]
    fn one_signer_cannot_approve_twice() {
        let _ = run(CONFIGURATION, transfer(), [approval(0), approval(0)]);
    }

    // Signer 0's signature presented as signer 1's.
    #[test(should_fail_with = "signature must be valid")]
    fn one_signature_cannot_stand_for_a_second_signer() {
        let forged = Approval { signer_index: 1, signature: SIGNATURES[0] };
        let _ = run(CONFIGURATION, transfer(), [approval(0), forged]);
    }

    // The same two approvals, against an unlock one second after the
    // transfer's lower bound.
    #[test(should_fail_with = "transfer must not execute before the unlock time")]
    fn rejects_a_transfer_before_the_unlock_time() {
        let mut configuration = CONFIGURATION;
        configuration.unlock_timestamp = UNLOCK + 1;
        let _ = run(configuration, transfer(), [approval(0), approval(2)]);
    }

    // The approvals sign the lower bound, so a prover cannot move it.
    #[test(should_fail_with = "signature must be valid")]
    fn rejects_a_lower_bound_the_signers_did_not_sign() {
        let mut private_value = transfer();
        private_value.not_before_timestamp = UNLOCK + 1;
        let _ = run(CONFIGURATION, private_value, [approval(0), approval(2)]);
    }
}

Use it from an app

createContract builds the contract's body, which the app attaches to the transfer that first funds the contract. spendAfterUnlock builds a transfer from one contract note with the unlock time as its notBeforeTimestamp, asks two signers to sign the digest, and proves the transaction with the SDK's browser prover. The signers sign a hash rather than readable terms, so each should rebuild the digest from the transfer they mean to approve before signing.

// Sketch: create the two-of-three, time-locked contract and spend from it after the unlock.
// Example only: unaudited, not for real funds.

import type { AccountProofResult } from "@pcash/sdk/browser";
import type { Prover } from "@pcash/sdk/browser-prover";
import { buildContractFunctionCall, fm, privateValueMap, snapshotFromAccountProof, type TransferInputNote } from "@pcash/sdk/builders";
import { referenceMultisigApprovalDigest } from "@pcash/sdk/fixtures";
import { buildContractBody, functionSelector, nullifierKeyCommitment, transferActionCommitment, type NativeBurn } from "@pcash/sdk/protocol";
import { referenceConfigurationCommitment } from "@pcash/sdk/rules";
import { field32 } from "@pcash/sdk/utils";

const SELECTOR = functionSelector(0);

export interface TimelockedMultisig {
  nkRoot: bigint; // shared privately by the signers; the body publishes only its commitment
  receiveKey: Uint8Array; // ML-KEM-768 public key; the signers hold its secret to read deposits and change
  applicationVkHash: bigint; // VK hash of the compiled `example_multisig_timelock` circuit
  signers: readonly { address: bigint; pubX: Uint8Array; pubY: Uint8Array }[]; // three, ascending by address
  unlockTimestamp: bigint;
  configurationSalt: bigint;
}

// The contract body and address. Publish the body by attaching it to the transfer that funds
// the contract, `accountCreation: { kind: "contract", body }`, as marketplace's publishOffer.ts does.
export function createContract(vault: TimelockedMultisig) {
  const configurationCommitment = referenceConfigurationCommitment(vault.configurationSalt, [
    2n, ...vault.signers.map((signer) => signer.address), vault.unlockTimestamp,
  ]);
  return buildContractBody({
    nullifierKey: { publishesNkRoot: false, nullifierKeyCommitment: nullifierKeyCommitment(vault.nkRoot) },
    mlKemPublicKey: vault.receiveKey, // buildContractFunctionCall encrypts change to it
    functions: [{ selector: SELECTOR, applicationVkHash: vault.applicationVkHash, configurationCommitment }],
  });
}

// Spend one contract note to `recipient`. Build and prove at most an hour before the
// transaction executes: its recent block must still be in the window then.
export async function spendAfterUnlock(vault: TimelockedMultisig, p: {
  chainId: bigint;
  accountProof: Extract<AccountProofResult, { status: "present" }>;
  input: TransferInputNote; // a contract note whose siblings open under accountProof's block
  recipient: bigint; recipientReceiveKey: Uint8Array; amount: bigint; burn: NativeBurn; validUntilTimestamp: bigint;
  // Two distinct signers' 64-byte r||s signatures over `digest`.
  collectApprovals: (digest: Uint8Array) => Promise<readonly { signerIndex: number; signature: Uint8Array }[]>;
  prover: Prover;
  circuitUrl: string;
}): Promise<Uint8Array> {
  const call = buildContractFunctionCall({
    chainId: p.chainId, contract: createContract(vault).contract, selector: SELECTOR, nkRoot: vault.nkRoot,
    recipientAddress: p.recipient, paymentAmount: p.amount, recipientReceiveKey: p.recipientReceiveKey,
    inputs: [p.input],
    ...snapshotFromAccountProof(p.accountProof),
    accountIndex: Number(p.accountProof.account.index),
    accountSiblings: p.accountProof.accountSiblings,
    openFeeAmount: 0n, burn: p.burn, issuanceOwnerCommitment: 0n,
    notBeforeTimestamp: vault.unlockTimestamp, // the lowest bound the function accepts
    validUntilTimestamp: p.validUntilTimestamp,
  });
  // The contract pays its own fee, so this is the transfer action, not the sponsored one.
  const action = transferActionCommitment(call.pcashChainId, call.privateValueCommitment);
  const approvals = await p.collectApprovals(field32(referenceMultisigApprovalDigest(action, call.contractAddress)));
  const bytes = (value: Uint8Array) => Array.from(value, String);
  const proof = await p.prover.proveTransfer({
    authorizationWitnessMap: {
      pcash_chain_id: fm(call.pcashChainId),
      recent_pcash_block_hash: fm(call.recentPcashBlockHash),
      fee_paid: false,
      configuration: { configuration_salt: fm(vault.configurationSalt), unlock_timestamp: fm(vault.unlockTimestamp) },
      private_value: privateValueMap(call.transaction),
      account_address: fm(call.contractAddress),
      signers: vault.signers.map((signer) => ({ x: bytes(signer.pubX), y: bytes(signer.pubY) })),
      approvals: approvals.map((a) => ({ signer_index: String(a.signerIndex), signature: bytes(a.signature) })),
      event_entry: fm(call.eventOpening.eventEntry),
    },
    buildKernelWitnessMap: call.buildKernelWitnessMap,
    expectedPublicInputs: call.publicInputs,
    authorizationCircuitUrl: p.circuitUrl,
    authorizationLabel: "multisig time-lock function",
  });
  return call.encodeTransaction(proof.proof);
}

Limits

  • The unlock time is a floor, not a schedule. Nothing executes the transfer when the time comes; someone has to submit it.
  • A transaction included before the unlock time fails and spends nothing. A PCASH node's mempool holds such a transaction until its bound while its proof is still valid, but one posted to Ethereum directly too early fails.
  • A proof is valid for one hour after its recent block. Signatures can be collected earlier, but this client builds a fresh transaction for each proof, so a retry needs new signatures.
  • Signers approve an opaque hash. A wallet cannot show them what they are signing.
  • The signers, the unlock time and the function can never change. Losing two keys, or the nullifier key the signers share, locks the funds for good.
  • One unlock time covers everything the contract holds. There is no vesting schedule.
  • The client spends native PCASH and pays the fee from the contract. Moving a token needs another account to pay the fee; the circuit allows that through fee_paid, but the client does not build it.

Run the tests

Run nargo test --program-dir examples/multisig-timelock; just test-examples-noir runs every example's tests.

Further reading: the rule statement, action commitments, the recent block window and time bounds, and contract-account creation.