MCPcopy Index your code
hub / github.com/NovaCrypto/BIP44

github.com/NovaCrypto/BIP44 @0.0.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.0.2 ↗ · + Follow
93 symbols 426 edges 15 files 0 documented · 0% updated 7y ago★ 441 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Download Build Status codecov

Install

Repository:

repositories {
    maven {
        url 'https://dl.bintray.com/novacrypto/BIP/'
    }
}

Add dependency:

dependencies {
    compile 'io.github.novacrypto:BIP44:0.0.2'
}

Usage

Fluent construction

AddressIndex addressIndex = purpose(44)
                                .coinType(2)
                                .account(1)
                                .external()
                                .address(5);

To string

String path = purpose(44)
                  .coinType(2)
                  .account(1)
                  .external()
                  .address(5)
                  .toString(); //"m/44'/2'/1'/0/5"

Deriving

Using NovaCrypto/BIP32Derivation keys.

From root

Derive<YourKeyType> derive = new CkdFunctionDerive<>((parent, childIndex) -> {/*your CKD function*/}, yourRootKey);
YourKeyType ketAtPath = derive.derive(addressIndex, AddressIndex.DERIVATION);

Account from root

Account account = purpose(44)
                  .coinType(2)
                  .account(1);
YourKeyType addressKey = derive
                  .derive(account, Account.DERIVATION);

From account private

YourKeyType addressKey = accountPrivateKey
                  .derive(addressIndex, AddressIndex.DERIVATION_FROM_ACCOUNT);

From account public

YourKeyType addressKey = accountPublicKey
                  .derive(addressIndex, AddressIndex.DERIVATION_FROM_ACCOUNT);

Deriving from NovaCrypto BIP32

Using NovaCrypto/BIP32 keys, which implement Derive<> directly:

WIP

!!! Note that BIP32 is a work in progress and you shouldn't use this just yet for any main net transactions. !!!

From root

PrivateKey addressKey = rootPrivateKey
                  .derive(addressIndex, AddressIndex.DERIVATION);

Account from root

Account account = purpose(44)
                  .coinType(2)
                  .account(1);
PrivateKey addressKey = rootPrivateKey
                  .derive(account, Account.DERIVATION);

From account private

PrivateKey addressKey = accountPrivateKey
                  .derive(addressIndex, AddressIndex.DERIVATION_FROM_ACCOUNT);

From account public

PublicKey addressKey = accountPublicKey
                  .derive(addressIndex, AddressIndex.DERIVATION_FROM_ACCOUNT);

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 77
Class 15
Interface 1

Languages

Java100%

Modules by API surface

src/test/java/io/github/novacrypto/DeriveFromAccountTests.java10 symbols
src/test/java/io/github/novacrypto/CoinTypeTests.java9 symbols
src/test/java/io/github/novacrypto/AddressIndexTests.java9 symbols
src/test/java/io/github/novacrypto/AccountTests.java9 symbols
src/test/java/io/github/novacrypto/ChangeTests.java8 symbols
src/main/java/io/github/novacrypto/bip44/Account.java7 symbols
src/test/java/io/github/novacrypto/PurposeTests.java6 symbols
src/test/java/io/github/novacrypto/DeriveFromRootTests.java6 symbols
src/main/java/io/github/novacrypto/bip44/Purpose.java6 symbols
src/main/java/io/github/novacrypto/bip44/CoinType.java6 symbols
src/main/java/io/github/novacrypto/bip44/Change.java6 symbols
src/main/java/io/github/novacrypto/bip44/AddressIndex.java5 symbols

For agents

$ claude mcp add BIP44 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page