Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Working with Multisig section to the cookbook #1677

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions cookbook/working-with-multisig.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: Working with Multisig
hide_table_of_contents: false
description: Create multisig accounts and sign transactions on the Stellar ledger
---

### Working with Multisig

**Multisig Overview**
Multisig accounts provide an additional layer of security by requiring multiple signatures to authorize a transaction. This feature is particularly useful for organizations or groups where multiple parties must agree before any funds can be moved.

---

#### Creating a Multisig Account

To create a multisig account on the Stellar ledger, use the `stellar account create` command with the desired thresholds. Here's how to do it:

```bash
stellar account create \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command doesn't exist.

--source S... \
--network testnet \
--threshold 2 \
--signer S1...,S2...,S3...
```

**Parameters:**

- `--threshold`: The number of signatures required to authorize a transaction.
- `--signer`: The public keys of the signers involved in the multisig account.

:::note
Ensure that the total number of signers is greater than or equal to the threshold to allow successful transaction signing.
:::

---

#### Signing Transactions with Multisig

Once you have a multisig account set up, you can sign transactions using the keys of the signers. Here’s an example of how to sign a transaction with multiple keys:

1. Create the transaction that requires multisig signing:

```bash
stellar transaction create \
--source S... \
--network testnet \
--amount 10 \
--destination D...
```

2. Sign the transaction with the required number of signers:

```bash
stellar transaction sign \
--transaction [TRANSACTION_HASH] \
--signer S1... \
--network testnet
```

Repeat this step for each signer until you have the required number of signatures.

3. Submit the signed transaction:

```bash
stellar transaction submit \
--transaction [TRANSACTION_HASH] \
--network testnet
```

---
Loading