Remove Signer
The "Remove Signer" component allows the Owner to remove a signer from a multisig wallet.
Features
- Collects source secret key, signers public address, and removes signer.
- Upon Submission, The removed signers weight and thresholds are set to 0.
- Provides a straightforward way to remove signers from a multi-signature wallet.
Additional Resources
Signatures serve as authorization for transactions within the network. Every transaction must be authorized by at least one public key to be considered valid, and typically, this authorization comes from the source account's signature. In certain cases, transactions may require multiple signatures, a concept we'll explore further in the section covering multisignature (multisig) setups.
Review the documentation on thresholds below, you can permanently lock yourself out of the account
C#
Install the Pakana.Stellar.Components NuGet package via the NuGet Package Manager Console.
.Net8.0 or greater is required.
dotnet add package Pakana.Stellar.Components
StellarSDK Dependency will install automatically
<pakana.stellar.components.Pages.RemoveSigner/>
@page "/RemoveSigner"
@rendermode InteractiveAuto
@using Microsoft.JSInterop
<h2>Remove Signer from Stellar Account</h2>
<div>
<input type="text" id="accountSecretmine" placeholder="Enter account secret key">
<input type="text" id="signerPublicKeymine" placeholder="Enter signer public key to remove">
<button onclick="removeSigner()">Remove Signer</button>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/stellar-sdk/11.2.2/stellar-sdk.js"></script>
<script src="your-file-path/removeSigner.js"></script>
Javascript
We've provided simple HTML and JavaScript that can be used in your project as partial-components or be customized and integrated into your existing codebase.
*Current Version as of 2024-24-02*
<script src="https://cdnjs.cloudflare.com/ajax/libs/stellar-sdk/11.2.2/stellar-sdk.js"></script>
<script>
function removeSigner() {
const accountSecret = document.getElementById('accountSecret').value;
if (!accountSecret) {
alert('Please enter a valid secret key.');
return;
}
const signerPublicKey =
document.getElementById('signerPublicKey').value;
const StellarSdk = window.StellarSdk;
const server = new StellarSdk.Horizon.Server('https://horizontestnet.stellar.org');
const sourceKeys = StellarSdk.Keypair.fromSecret(accountSecret);
server.loadAccount(sourceKeys.publicKey())
.then(account => {
const transaction = new StellarSdk.TransactionBuilder(account, {
fee: StellarSdk.BASE_FEE,
networkPassphrase: StellarSdk.Networks.TESTNET
})
.addOperation(StellarSdk.Operation.setOptions({
signer: {
ed25519PublicKey: signerPublicKey,
weight: 0 // Setting the weight to 0 removes the
signer
}
}))
.setTimeout(180)
.build();
transaction.sign(sourceKeys);
return server.submitTransaction(transaction);
})
.then(result => {
console.log('Success! Results:', result);
alert('Signer removed successfully!');
})
.catch(error => {
console.error('Something went wrong!', error);
alert('Failed to remove signer. Error: ' + error.message);
});
}
</script>
<body>
<h2>Remove Signer from Stellar Account</h2>
<div>
<input type="text" id="accountSecret" placeholder="Enter account secret
key">
<input type="text" id="signerPublicKey" placeholder="Enter signer public key
to remove">
<button onclick="removeSigner()">Remove Signer</button>
</div>
</body>