Bitcoin Interactions
Sign a message
Configurations
- Installing Dynamic
- Chains/Networks
- Authentication
- Wallets
- Setup Embedded Wallets
- Setup Branded Wallets
- Add Account Abstraction
- Using Wallets
- Accessing Wallets
- Connecting Wallets
- Interacting with wallets
- General Interactions
- EVM Interactions
- Bitcoin Interactions
- Solana Interactions
- Multi Asset UI
- Users / VC's
- Design
- Headless
- Onramps
- Bridges
Developer Dashboard
- SDK and API Keys
- Sandbox vs Live
- Analytics
- User Management
- Settings
- Admin
- Webhooks
- Configuring Social Providers
Tutorials
- Farcaster
- Features
- Frameworks
- Integrations
- Webhooks
Migrating to Dynamic
- Migrating to Dynamic
- Migration Tutorials
Troubleshooting
- Dynamic Doctor
- React Issues
- NextJS Issues
- Wallet Issues
- WalletConnect Issues
- Solved Issues
Bitcoin Interactions
Sign a message
In this example, we are going to sign a message for Bitcoin using the wallet connector.
import { useDynamicContext } from '@dynamic-labs/sdk-react-core';
import { isBitcoinConnector } from '@dynamic-labs/wallet-connector-core';
const SignMessageButton = () => {
const { primaryWallet } = useDynamicContext();
const signMessage = async () => {
if (!primaryWallet) return;
if (!isBitcoinConnector(primaryWallet.connector)) {
return;
}
const signature = await primaryWallet.connector.signMessage('example');
console.log('signature', signature);
};
return <button onClick={signMessage}>Sign message</button>;
};
Was this page helpful?