This application demonstrates BRC-100 wallet payment methods using the BSV SDK.
The app includes examples of:
- Identity-based payments: Send and receive payments using identity keys via MessageBox
- Address-based payments: Generate addresses and internalize transactions
- Payment verification: Fetch, verify, and internalize transactions from the blockchain
First, install dependencies:
npm iNote: This project requires tsx to be installed globally. If you don't have it installed, run:
npm install -g tsxThen run the development server:
npm run devThe application includes 4 demo steps you can run sequentially:
tsx index.ts 1This generates a wallet address associated with your BRC-100 wallet.
tsx index.ts 2 <txid>Example:
tsx index.ts 2 cafebabecafebabecafebabecafebabecafebabecafebabecafebabecafebabeThis fetches a transaction by ID, verifies it, and internalizes it as a payment.
The email address must be registered on the identity overlay using Social Cert for the example to work.
tsx index.ts 3 <email> <satoshis>Example:
tsx index.ts 3 test@deggen.com 1000This creates and sends an identity-based payment to a recipient via MessageBox.
tsx index.ts 4Note: Switch to the receiving side before running this last step. This retrieves and accepts incoming identity-based payments from MessageBox if you are running the wallet with the keys associated with the email used in step 3.
getAddress()- Generate a BRC-100 wallet addresscreateOutboundTxToIdentity()- Create identity-based payment to a recipientacceptIdentityBasedPayment()- Accept incoming identity-based payments from MessageBoxinternalizeATransaction()- Internalize and verify address-based payments