Skip to content
All articles
Guides

Can't Merge a Stellar Account With Extra Signers? Check the Thresholds

Extra signers do not stop a Stellar account merge. What they can change is who has to sign it: how weights and thresholds work, what a failed merge's result code tells you, and what a multisig close needs from you.

Updated 7 min read

A wallet or another tool may have added a second key to your Stellar account, and now you want to close it. It is easy to assume that key is what stops the merge, but the network removes an account's signers itself when it merges the account. What an extra signer can change is who has to sign the merge, and that depends on the account's thresholds.

If a merge already failed, its result code tells you which problem you have. op_has_sub_entries means something other than a signer is still on the account: a trustline, an open offer or a data entry. op_bad_auth or tx_bad_auth means the signatures on the transaction did not carry enough weight, and that is where signers and thresholds come in.

This guide is one of five on the things that keep a Stellar account open. The others cover claimable balances, trustlines, open offers and data entries.

What an extra signer is

Every Stellar account starts with one signer, its master key: the key pair whose public key is the account address. A SetOptions operation can add more signers, each with a weight. Most are ordinary keys, the kind a wallet holds. There are also special kinds: a hash(x) signer, which is satisfied by revealing a secret value; a pre-authorized transaction signer, which allows one exact transaction; and a signed-payload signer.

Each extra signer counts as a subentry of the account, like a trustline or an offer, and locks one base reserve of 0.5 XLM while it exists (checked on ). That reserve comes back either way, whether you remove the signer or the merge removes it with the account.

Weights and thresholds

An account has three thresholds: low, medium and high. Every operation belongs to one of them. A transaction is authorized when the signers who signed it add up to at least the threshold its operations need.

The two operations that matter for a close both need the high threshold: SetOptions when it changes signers or thresholds, and AccountMerge itself.

On a fresh account the master key has weight 1 and every threshold is 0, so the master key alone can do anything. A multisig setup raises the thresholds and adds signers so that no single key is enough. For example, three keys of weight 1 with a high threshold of 2 means any two of them must sign a merge.

Signers do not block the merge

The network refuses to merge an account that still holds subentries, and reports op_has_sub_entries when it does. Signers are the exception. The check compares the account's subentry count with its number of signers and lets the merge through when the two match, which means every subentry left is a signer. The merge then deletes those signers along with the account.

So you do not have to remove an extra signer before merging. If op_has_sub_entries comes back, look for a trustline, an offer or a data entry instead. The guides linked above cover each one.

Thresholds decide who can sign the merge

AccountMerge needs the high threshold. On a fresh account that threshold is 0, so the master key signs the merge alone and an extra signer changes nothing.

If the thresholds were raised, a merge signed by a key whose weight is below the high threshold fails with op_bad_auth, or with tx_bad_auth when the signatures do not reach the threshold the transaction itself needs. The other signers then have to sign too, until their weights add up to the high threshold. This is how an extra signer can stand in the way of a close: the merge cannot happen without the keys the thresholds require, and you may no longer have them.

How LumenWipe handles it

The analyze screen shows how many extra signers the account has. When it has any, or when its medium or high threshold is above 1, the plan includes a step called "Remove extra signers". That step sets each other signer's weight to 0, which removes it, and then resets the thresholds to 0, 1 and 1, so the master key alone can authorize what follows. The merge would remove the signers anyway. LumenWipe removes them earlier so that a single key can sign every remaining step, rather than collecting several signatures on each transaction of the close.

The order is the same for every account. If no single key of the account can sign every step, the extra signers are removed first, in a transaction of their own. Any claimable balances you chose to claim come next, in their own transaction, with any trustline a claim needs added just before it. Once those are confirmed, LumenWipe builds the close itself, which removes the extra signers if that did not happen first, then clears data entries, cancels open offers, converts, returns or sends each remaining balance, removes the trustlines and merges the account last. A close with more than 100 operations is split into several transactions in that same order.

When the signer removal runs first, the master key must be one of the keys that sign it. After it is confirmed, the master key alone signs the rest of the close. That transaction does not close the account: if a later step is refused, the account stays open under its master key alone. The step says this on the plan, so you see it before you sign.

For a multisig account, the review screen says how many of the account's keys must sign and on how many transactions. Those keys must sign during the close. While you sign, the signing screen shows the weight collected so far, the weight still needed and which signers have not signed yet.

The special signer types each have a rule:

  • A hash(x) signer is satisfied by entering its secret value in the browser, only on the step that removes that signer.
  • A pre-authorized transaction signer is used by submitting that exact transaction in the browser. It is not a signature.
  • A signed-payload signer cannot sign in LumenWipe, and its weight does not count toward the threshold.

When LumenWipe stops

LumenWipe does not build a removal it knows cannot be authorized. The analyze screen shows a blocker instead in two cases.

  • The master key has weight 0. Removing the other signers would leave no key able to authorize anything on the account, ever, so LumenWipe refuses to do it.
  • The signers that can sign in LumenWipe do not add up to the high threshold. The blocker states the weight they can reach and the weight the high threshold requires.

In both cases the account's current signers have to change its setup first, outside LumenWipe, for example by giving the master key weight or lowering the high threshold.

Before you start

  • Find out who added each extra signer. If it belongs to a service you still use, closing the account takes away the access that signer gave.
  • Gather the keys you will need before you open the close. The review screen tells you how many.
  • If you hold only the master key and the thresholds are above its weight, you cannot close the account alone.

Start a close

Open LumenWipe and enter the account. The analyze screen lists the extra signers and any blocker, and the review screen shows how many keys have to sign before anything is built.

account-blockerssignersmultisigaccount-mergestellar

Next step

Enter the account to see its extra signers and, for a multisig account, how many keys have to sign before anything is built.

Analyze an account

Related