Private Keys
Web wallets (user-controlled)
import { connect } from '@stacks/connect';
// Users connect their wallet
const response = await connect();
console.log('Connected addresses:', response.addresses);
// The wallet handles all cryptographic operations
// when signing transactions or messagesLocal accounts (application-controlled)
import { makeSTXTokenTransfer } from '@stacks/transactions';
// Your application controls the private key
const privateKey = 'your-private-key-here';
const txOptions = {
recipient: 'ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM',
amount: 1000000n,
senderKey: privateKey, // Direct private key usage
network: 'testnet',
};
const transaction = await makeSTXTokenTransfer(txOptions);
// Transaction is signed programmaticallyWorking with private keys
Generating random private keys
Private key formats
Wallet generation with seed phrases
1
2
3
Last updated
Was this helpful?