Skip to content

feat: CLI co-signing for multi-party transactions and docs - #168

Open
SIDDHANTCOOKIE wants to merge 1 commit into
feature/generalized-tx-mempool-rpcfrom
feature/generalized-tx-cli-docs
Open

SIDDHANTCOOKIE wants to merge 1 commit into
feature/generalized-tx-mempool-rpcfrom
feature/generalized-tx-cli-docs

Conversation

@SIDDHANTCOOKIE

Copy link
Copy Markdown
Member

Summary

PR 4 of the generalized transaction roadmap (stacked on #165). It makes multi-party transactions usable from the CLI and documents them.

Changes

  1. Co-signing CLI (main.py)

    • tx-sign <file>: signs a transaction stored as JSON in its wire format (Transaction.to_dict()), so co-signers just pass the file around. Before the first signature it fills in chain_id and each signer's nonce from the chain. After that the signed content is never changed.
    • tx-submit <file>: refuses files still missing a sender's or caller's signature, or with an invalid signature. Otherwise it validates and broadcasts through the existing submit_and_broadcast.
    • Files that aren't multi-party transactions (legacy format, no transfers/withdrawals/deposits/calls, invalid JSON) are refused with a clear message instead of crashing the CLI.
  2. README: a new "Generalized Transactions" section covering:

    • the components
    • the signer and nonce rules
    • strict pool conservation and explicit burns
    • fee_payer
    • the co-signing flow with an example swap file

    mc_getNonce is added to the RPC list.

Test Plan

  • Added tests/test_tx_file_cli.py (10 tests):
    • the first signer fills chain_id and nonces
    • nonces stay locked after the first signature
    • a non-signer is refused
    • a partially signed file can't be submitted
    • a tampered file is rejected
    • a fully signed file reaches the mempool and is broadcast
    • non-multi-party files are refused (3 cases)
    • a co-signed file is mined into a block, and both nonces advance
  • Full suite: 421 passed and 1 failed. The failure is tests/e2e/test_e2e_suite.py::TestTier4RealWorldScenarios::test_scenario_crowdfunding_multi_token, which hit the contract sandbox's 10 s execution timeout while the full suite was running ("Contract execution timed out"). It passes when run on its own (3/3). It doesn't touch main.py and is the same timing flake seen in test_contract_calls.

tx-sign signs a transaction stored in its wire format (JSON), filling in
chain_id and nonces before the first signature; tx-submit checks that every
sender and caller has signed before sending it. README documents
generalized transactions and the co-signing flow.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2
  • main
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: StabilityNexus/MiniChain/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a668d10b-4c91-4994-b374-998b3da2240a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SIDDHANTCOOKIE
SIDDHANTCOOKIE added this pull request to stack #158 October 21, 2026 06:58
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.

1 participant