What is the Runes Protocol?
The Runes protocol is a fungible token protocol built on Bitcoin that allows for the creation and transfer of tokens directly on the Bitcoin blockchain. Unlike other token standards, Runes leverages Bitcoin's native UTXO model for efficient and secure token transfers.
Key Features
Native Bitcoin
Tokens exist on the Bitcoin mainnet without requiring a separate layer
UTXO-based
Leverages Bitcoin's proven UTXO model for better efficiency
No Off-chain Dependencies
All data is stored on the Bitcoin blockchain
Fungible Tokens
Perfect for reward and incentive systems
Setting Up Bitcoin Node
Option 1: Run Your Own Bitcoin Node
Use the provided setup script to deploy a Bitcoin Core node with Runes support:
#!/bin/bash # Download and run the setup script curl -sSL https://raw.githubusercontent.com/OWASP-BLT/BLT-Bacon/main/setup_bacon_node.sh | bash # Or manually: git clone https://github.com/OWASP-BLT/BLT-Bacon.git cd BLT-Bacon chmod +x setup_bacon_node.sh ./setup_bacon_node.sh
Option 2: Use a Bitcoin Node Service
Connect to a third-party Bitcoin node provider:
// Configure with external node
const bacon = new BaconSDK({
blockchain: 'bitcoin',
network: 'mainnet',
rpc: {
url: 'https://your-bitcoin-node.com',
username: 'your_username',
password: 'your_password'
}
});
Bitcoin Node Configuration
Essential settings in bitcoin.conf:
server=1 daemon=1 txindex=1 rpcuser=yourusername rpcpassword=yourpassword rpcallowip=127.0.0.1 rpcport=8332 addresstype=bech32 # Runes-specific settings enablerunes=1 runesindex=1
Creating BACON Tokens on Bitcoin
Initialize Token
Create your BACON token on Bitcoin:
const { BitcoinRunes } = require('@blt-bacon/bitcoin');
const runes = new BitcoinRunes({
network: 'mainnet',
rpcUrl: process.env.BITCOIN_RPC_URL,
rpcUser: process.env.BITCOIN_RPC_USER,
rpcPassword: process.env.BITCOIN_RPC_PASSWORD
});
// Create BACON token
const tokenId = await runes.createToken({
name: 'BACON',
symbol: 'BACON',
decimals: 8,
supply: 21000000, // Total supply
description: 'Blockchain Assisted Contribution Network Token'
});
Mint Tokens
Mint BACON tokens for distribution:
// Mint tokens to treasury wallet
await runes.mint({
tokenId: 'BACON',
amount: 1000000,
destination: treasuryAddress
});
// Check balance
const balance = await runes.getBalance(treasuryAddress, 'BACON');
console.log(`Treasury balance: ${balance} BACON`);
Distribute Rewards
Send BACON tokens as rewards:
// Transfer tokens to contributor
await runes.transfer({
tokenId: 'BACON',
from: treasuryAddress,
to: contributorAddress,
amount: 100,
memo: 'Reward for fixing bug #123'
});
// Batch transfer for multiple recipients
await runes.batchTransfer({
tokenId: 'BACON',
from: treasuryAddress,
transfers: [
{ to: address1, amount: 50 },
{ to: address2, amount: 75 },
{ to: address3, amount: 100 }
]
});
Bitcoin Features Integration
Schnorr Signatures
Enhanced privacy and efficiency with Schnorr signatures
// Use Schnorr signatures
const tx = await runes.createTransaction({
signatureType: 'schnorr',
outputs: [{
address: recipientAddress,
amount: 100,
tokenId: 'BACON'
}]
});
Taproot Integration
Leverage Taproot for complex smart contracts
// Taproot contract
const contract = await runes.createTaprootContract({
conditions: {
minContributions: 5,
timelock: '30 days'
},
reward: { amount: 500 }
});
Lightning Network
Fast, low-cost transfers via Lightning Network
// Lightning payment
const lightning = await runes.connectLightning({
nodeUrl: process.env.LIGHTNING_NODE_URL
});
await lightning.sendPayment({
amount: 25
});
Fee Management
Optimize transaction fees dynamically
const bacon = new BaconSDK({
blockchain: 'bitcoin',
fees: {
strategy: 'dynamic',
priority: 'medium',
maxFeeRate: 50
}
});
Security Best Practices
Wallet Security
- Use hardware wallets for treasury management
- Implement multi-signature requirements
- Keep private keys encrypted and secure
- Use separate hot and cold wallets
Transaction Security
- Verify all addresses before sending
- Use RBF for stuck transactions
- Monitor for double-spend attempts
- Implement rate limiting on rewards
Node Security
- Keep Bitcoin Core updated
- Enable firewall and restrict RPC access
- Regular backups of wallet.dat
- Monitor node health and sync status
Audit Trail
- Log all reward distributions
- Maintain transaction history
- Regular audit of token balances
- Implement fraud detection
Ready to Use Bitcoin?
Start rewarding contributors with Bitcoin-based BACON tokens