-
Notifications
You must be signed in to change notification settings - Fork 80
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
Dhanraj30
wants to merge
2
commits into
stellar:main
Choose a base branch
from
Dhanraj30:add-working-with-multisig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 \ | ||
--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 | ||
``` | ||
|
||
--- |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.