Skip to content

Add Bitcoin network implementation #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devin-ai-integration[bot]
Copy link

Add Bitcoin Network Implementation

This PR adds Bitcoin as a new network to InterchainJS, including:

  1. Bitcoin Network Implementation:

    • Complete implementation in the networks/bitcoin folder
    • Support for multiple address types (P2PKH, P2WPKH, P2SH, P2WSH, P2TR)
    • Transaction signing and broadcasting
    • Message signing and verification
  2. Starship Integration:

    • Configuration for Bitcoin in Starship
    • Mock tests for Bitcoin functionality
  3. Documentation:

    • Comprehensive guide for adding new networks to InterchainJS
    • Detailed README for the Bitcoin network implementation
  4. GitHub Workflows:

    • Added Bitcoin tests to the E2E test workflow
    • Created a separate Bitcoin E2E test workflow

Implementation Details

The Bitcoin implementation follows a phased approach:

Phase 1 (Current PR)

  • RPC client for basic blockchain interaction
  • Transaction signing and broadcasting
  • Address generation and validation
  • Basic wallet functionality
  • Network configuration (mainnet, testnet, regtest, signet)

Phase 2 (Future Work)

  • Full PSBT support with proper serialization
  • Multi-signature transaction support
  • Advanced script types (P2SH, P2WSH, P2TR)
  • Modular signers for different signing methods

Phase 3 (Future Work)

  • Hardware wallet interface
  • Electrum / Esplora support for light clients
  • Custom script logic for advanced use cases

Libraries Used

  • @noble/curves/secp256k1: For ECDSA signing
  • @noble/hashes: For cryptographic hash functions (sha256, ripemd160)
  • @scure/bip32: For HD wallet derivation
  • @scure/base: For Base58 and Bech32 encoding

Note on Starship Integration

A separate PR to the Starship repository will be needed to add full Bitcoin support. The current implementation includes a placeholder configuration and mock tests.

Link to Devin run

https://app.devin.ai/sessions/b48dd06a7944481a9ea923c630b814e2

Requested by

Dan Lynch (pyramation@gmail.com)

Co-Authored-By: Dan Lynch <pyramation@gmail.com>
Copy link
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@Zetazzz
Copy link
Contributor

Zetazzz commented May 23, 2025

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

ok, please proceed to fix the bitcoin check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant