@odysseygpt/bitcoin-address-verifier
v0.2.0
Published
A Bitcoin address verifier plugin for the BTC Staking platform.
Downloads
4
Readme
Bitcoin Address Verifier
A modular system for validating and generating Bitcoin contract addresses with plugin support.
Features
- 🧩 Plugin-based architecture for contract types
- 🔍 Automatic address generation from contract parameters
- 📦 Self-contained plugin system
Installation
npm install @unisat/bitcoin-address-verifier
# or
yarn add @unisat/bitcoin-address-verifierUsage
Basic Usage
import { verifyContract } from "./index";
const result = verifyContract("babylon:staking", {
stakerPk: "5092...",
covenantPks: ["5092...",],
finalityProviders: ["5092...",],
covenantThreshold: 1,
minUnbondingTime: 101,
stakingDuration: 144,
},{
address: "",
publicKey: ""
});
console.log(result);
Wallet Integration
// Use in PSBT signing
wallet.signPsbt(psbt, {
contracts: [{
id: 'babylon:staking',
params: { /* ... */ }
}]
});Plugin Development
Creating a New Plugin
- Run the generator:
yarn new:plugin- Follow the interactive prompts
Plugin Structure
plugins/
└── your-project/
└── contract-name/
├── index.ts # Main implementation
└── plugin.test.ts # Test casesExample Plugin
// plugins/example/timelock/index.ts
export default {
id: 'example:timelock',
version: '1.0.0',
verify(params, account) {
// Implementation here
},
};Contributing
Fork the repository
Create a new branch (git checkout -b feature/your-plugin)
Commit your changes (git commit -am 'Add new plugin')
Push to the branch (git push origin feature/your-plugin)
Open a Pull Request
Build Setup
# Install dependencies
yarn
# Build project
yarn build
# Run tests
yarn testProject Structure
bitcoin-contract-validator/
├── src/
│ ├── core-sdk/ # Core validation logic
│ ├── plugins/ # Plugin implementations
│ └── generated/ # Auto-generated registry
├── scripts/ # Generation scripts
└── test/ # Test cases