Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
292fa68
chore: update package and infos
ethicnology Nov 12, 2024
7877eaa
refactor: maintain codebase with new dependencies versions
ethicnology Nov 12, 2024
4702a9e
refactor: split test in dedicated directory
ethicnology Nov 12, 2024
2614c21
refactor: move error in dedicated file
ethicnology Nov 12, 2024
8d466d0
chore: flutter rust bridge
ethicnology Nov 12, 2024
42188c6
feat: flutter bindings
ethicnology Nov 12, 2024
cc8b024
feat: flutter example
ethicnology Nov 12, 2024
019eb70
chore: regenerate with 2.6.0 flutter rust bridge
ethicnology Nov 13, 2024
ebaeb52
chore: MIT license
ethicnology Nov 13, 2024
0baaa36
feat: xprv binding
ethicnology Nov 13, 2024
d96d028
tests: integration
ethicnology Nov 13, 2024
8b64a2d
docs: version and changelog
ethicnology Nov 13, 2024
63e8fb2
refactor: example
ethicnology Nov 13, 2024
c9faee3
docs: run integration tests
ethicnology Nov 13, 2024
cfc86c2
docs: update readme
ethicnology Nov 13, 2024
8b85cc9
chore: allow more than one version
ethicnology Nov 13, 2024
674072e
chore: bump version
ethicnology Nov 13, 2024
74fbfa4
chore: gitattributes
ethicnology Nov 13, 2024
c119173
feat: BIP85-DRNG-SHAKE256
ethicnology Nov 14, 2024
766a955
refactor: split functions across files and re-export
ethicnology Nov 14, 2024
5696e54
docs: update readme
ethicnology Nov 14, 2024
7d7e3f6
refactor: to_hex return hex string
ethicnology Nov 14, 2024
bf7b4df
feat: PWD Base64
ethicnology Nov 14, 2024
3278146
feat: pwd base85
ethicnology Nov 14, 2024
28e8e75
feat: code coverage
ethicnology Nov 14, 2024
97319ea
chore: gitattributes
ethicnology Nov 14, 2024
a215030
chore: update repo name
ethicnology Nov 14, 2024
993c54f
docs: coverage badge
ethicnology Nov 14, 2024
28b7c3c
refactor: rename index –> application number
ethicnology Nov 14, 2024
9be3ddc
docs: functions
ethicnology Nov 14, 2024
30a1076
docs: update badge
ethicnology Nov 14, 2024
d820f10
fix: incompatibility issues with other packages due to flutter_rust_b…
ethicnology Nov 19, 2024
e9194c7
refactor: rename
ethicnology Nov 20, 2024
92112c7
docs: update keywords
ethicnology Nov 20, 2024
aac11e3
chore: add my name to license
ethicnology Nov 20, 2024
0d10dfb
chore: update dart-bip85 version
ethicnology Nov 20, 2024
67ccc61
refactor: version
ethicnology Nov 20, 2024
5527ebd
chore: dependency from crates.io instead of local
ethicnology Nov 20, 2024
6412b2a
docs: update readme
ethicnology Nov 20, 2024
cc43903
chore: bump version
ethicnology Nov 20, 2024
5f80deb
feat: precompiled_binaries CI (cargokit)
ethicnology Nov 20, 2024
c897bc5
refactor: usePrecompiledBinaries true
ethicnology Nov 20, 2024
c1cd511
chore: regenerate with LibBip85 name
ethicnology Nov 21, 2024
9cf13b5
chore: remove initMock
ethicnology Nov 21, 2024
a552020
chore: downgrade to frb 2.0.0
ethicnology Nov 21, 2024
408d986
revert: usePrecompiledBinaries
ethicnology Nov 21, 2024
a90cf9e
chore: update version
ethicnology Nov 22, 2024
beee977
chore: load library from github instead of local
ethicnology Nov 22, 2024
2321b17
Revert "revert: usePrecompiledBinaries"
ethicnology Dec 19, 2024
e1bea65
fix: various infos
ethicnology Jan 14, 2025
90f0a04
refactor: ci
ethicnology Jan 23, 2025
8964f6e
feat: bindings for pwd64 and pwd85
ethicnology Jan 23, 2025
222a5f6
chore: codegen generate
ethicnology Jan 23, 2025
b402252
test: integration pwd64 and pwd85
ethicnology Jan 23, 2025
5eed58c
docs: update example
ethicnology Jan 23, 2025
f6b6b08
chore: bump version
ethicnology Jan 23, 2025
78c778a
Change the Bull Bitcoin logo (#1)
Science-G Mar 3, 2025
450d499
fix: sponsor url
ethicnology Mar 3, 2025
64ff2f2
upgrade: frb 2.9.0
i5hi Apr 28, 2025
4e1eb36
Merge pull request #2 from SatoshiPortal/frb-upgrade
ethicnology Apr 29, 2025
c364c3f
docs: bump version because flutter rust bridge minors are not compati…
ethicnology May 21, 2025
2bf238e
fix: Ubuntu 20.04 LTS runner was removed on 2025-04-15
ethicnology May 21, 2025
7559f61
feat: add Portuguese language support for mnemonics
ethicnology Aug 18, 2025
29ce11b
BREAKING CHANGES: implement `to_mnemonic_in` function and update `to_…
ethicnology Aug 19, 2025
4c97b92
chore: bump bip39 version
ethicnology Aug 19, 2025
fa14702
feat: add `bip39_mnemonic` dependency and re-export in bip85 to give …
ethicnology Aug 19, 2025
ed3babc
chore: frb generate
ethicnology Aug 19, 2025
e4aa36d
test: `toMnemonicIn` ensure each seed is validated by `bip39_mnemonic`
ethicnology Aug 19, 2025
ade0404
chore: update dependencies and Podfile configurations for macOS and i…
ethicnology Aug 19, 2025
c767730
ci: add Dart integration and Rust coverage workflows, update .gitigno…
ethicnology Aug 19, 2025
c88c994
docs: bump version to `3.0.0` update changelog and example
ethicnology Aug 19, 2025
20e016e
chore: update package recommendation to use `bip85_entropy` and bump …
ethicnology Oct 7, 2025
141dfe2
feat: add Nostr application (BIP85 9000') with nsec output
ethicnology May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* linguist-language=rust
28 changes: 28 additions & 0 deletions .github/workflows/dart-integration-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Dart Integration Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
integration-test:
runs-on: macos-15

steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- run: rustup target add aarch64-apple-ios

- name: Install FVM
run: |
curl -fsSL https://fvm.app/install.sh | bash
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH

- run: cd bindings/dart-bip85 && fvm install
- run: cd bindings/dart-bip85/example && fvm flutter pub get
- run: cd bindings/dart-bip85/example && fvm flutter test integration_test

60 changes: 60 additions & 0 deletions .github/workflows/precompiled_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
branches: [ master ]

name: Precompile Binaries
jobs:
Precompile:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Set RUSTFLAGS for macOS
if: (matrix.os == 'macOS-latest')
run: |
echo "RUSTFLAGS=-C link-arg=-undefined -C link-arg=dynamic_lookup" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=17.5" >> $GITHUB_ENV
echo "IPHONEOS_DEPLOYMENT_TARGET=17.5" >> $GITHUB_ENV

- name: Install Xcode Tools
if: (matrix.os == 'macOS-latest')
run: xcode-select --install || echo "Xcode tools already installed"

- name: Set up Android SDK
if: (matrix.os == 'ubuntu-latest')
uses: android-actions/setup-android@v3

- name: Install Specific NDK
if: (matrix.os == 'ubuntu-latest')
run: sdkmanager --install "ndk;25.1.8937393"
- name: Precompile (with iOS)
if: (matrix.os == 'macOS-latest')
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=ethicnology/rust-bip85
working-directory: bindings/dart-bip85/cargokit/build_tool
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }}

- name: Precompile (with Android)
if: (matrix.os == 'ubuntu-latest')
run: dart run build_tool precompile-binaries -v --manifest-dir=../../rust --repository=ethicnology/rust-bip85 --android-sdk-location=/usr/local/lib/android/sdk --android-ndk-version=25.1.8937393 --android-min-sdk-version=23
working-directory: bindings/dart-bip85/cargokit/build_tool
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }}

37 changes: 37 additions & 0 deletions .github/workflows/rust-coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Rust Coverage

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
coverage:
runs-on: ubuntu-latest
name: Coverage
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: llvm-tools-preview

- name: Test
run: cargo test
env:
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "${{ github.workspace }}/default_%m_%p.profraw"

- name: Collect coverage
run: |
curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.19/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar -xjf-
./grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --keep-only 'src/*' --ignore '**/tests.rs' -o coverage.lcov

- name: Submit coverage
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./coverage.lcov
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
Cargo.lock
.fvm/
26 changes: 17 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
[package]
name = "bip85"
version = "0.1.1"
authors = ["Rita Kitic <rikitau@protonmail.com>"]
name = "bip85_extended"
version = "1.2.0"
authors = [
"Rita Kitic <rikitau@protonmail.com>",
"Jules Azad EMERY <ethicnology@pm.me>",
]
description = "BIP-85 - deterministic entropy from bip32 keychains"
repository = "https://github.com/rikitau/rust-bip85"
repository = "https://github.com/ethicnology/rust-bip85"
readme = "README.md"
license = "MIT"
edition = "2018"
edition = "2021"
keywords = ["bitcoin", "bip", "bip85"]

[features]
default = ["mnemonic"]
Expand All @@ -20,6 +24,7 @@ italian = ["mnemonic", "bip39/italian"]
japanese = ["mnemonic", "bip39/japanese"]
korean = ["mnemonic", "bip39/korean"]
spanish = ["mnemonic", "bip39/spanish"]
portuguese = ["mnemonic", "bip39/portuguese"]

all-languages = [
"mnemonic",
Expand All @@ -30,14 +35,17 @@ all-languages = [
"italian",
"japanese",
"korean",
"spanish"
"spanish",
"portuguese",
]

[dependencies]
bitcoin = "0.26.0"
bip39 = { version = "1.0.1", optional = true }
bitcoin = "0.32.4"
bip39 = { version = "2.2.0", optional = true }
sha3 = "0.10.8"
base64 = "0.22.1"
base85 = "2.0.0"

[[example]]
name = "mnemonic"
required-features = ["japanese"]

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2020 Rita Kitic
Copyright (c) 2024 Jules Azad EMERY

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 28 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
# BIP-85 implementation in Rust
# BIP-85 Deterministic Entropy From BIP32 Keychains

[BIP-85](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki) - deterministic entropy from bip32 keychains.
[![codecov](https://codecov.io/gh/ethicnology/rust-bip85/graph/badge.svg?token=2YN9UI47KT)](https://codecov.io/gh/ethicnology/rust-bip85)

Derives entropy from the extended private key according to
[BIP-85](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki).
Derives entropy from the extended private key according to [BIP-85](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki).

Try it [online](https://rikitau.github.io/wasm-bip85/) with WASM magic!
This work is sponsored by [Bull Bitcoin](https://bullbitcoin.com) [<img
align="right"
src="https://github.com/ethicnology/rust-bip85/blob/master/bindings/dart-bip85/bullbitcoin.png"
width=100
title="Sponsor"
alt="Sponsor"
/>](https://bullbitcoin.com)

# Examples

There are a few [examples](https://github.com/rikitau/rust-bip85/tree/master/examples)
in the repository.
## Features
- [x] [BIP39 mnemonic](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-BIP39)
- [x] [WIF](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-HDSeed_WIF)
- [x] [XPRV](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-XPRV)
- [x] [HEX](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#hex)
- [x] [DRNG](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#bip85-drng)
- [x] [PWD base64](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-PWD_BASE64)
- [x] [PWD base85](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-PWD_BASE85)
- [ ] [DICE](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#user-content-DICE)
- [x] [Nostr](https://github.com/bitcoin/bips/blob/master/bip-0085.mediawiki#nostr)

Running examples:

## Flutter bindings
Thanks to flutter_rust_bridge, I've ported this rust library to [dart-bip85](https://pub.dev/packages/bip85) for flutter applications.

## Examples
There are a few examples in the `examples/` folder.

Running examples:
```sh
cargo run --example simple
```
Expand All @@ -22,7 +40,7 @@ cargo run --example simple
cargo run --example mnemonic --features japanese
```

# Optional features
## Optional features

By default the library can derive entropy in any format specified by the standard except
mnemonics. To use mnemonics enable feature "mnemonic".
Expand Down
3 changes: 3 additions & 0 deletions bindings/dart-bip85/.fvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"flutter": "3.35.0"
}
29 changes: 29 additions & 0 deletions bindings/dart-bip85/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
build/
42 changes: 42 additions & 0 deletions bindings/dart-bip85/.metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This file tracks properties of this Flutter project.
# Used by Flutter tool to assess capabilities and perform upgrades etc.
#
# This file should be version controlled and should not be manually edited.

version:
revision: "603104015dd692ea3403755b55d07813d5cf8965"
channel: "stable"

project_type: plugin_ffi

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: android
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: ios
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: linux
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: macos
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965
- platform: windows
create_revision: 603104015dd692ea3403755b55d07813d5cf8965
base_revision: 603104015dd692ea3403755b55d07813d5cf8965

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
34 changes: 34 additions & 0 deletions bindings/dart-bip85/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## 3.0.0

- Recommend `bip85_entropy` which is compatible with all platforms (dart native) and is more developers friendly instead of this bindings from rust package `bip85_extended`
- feat: `toMnemonicIn` generates the mnemonic for all the languages available in bip39 spec
- BREAKING CHANGE: `toMnemonic` return the words of the mnemonic as a `List<String>` instead of a `String` this change is justified by the fact that the `rust-bip39` dependency does not use ideographic spaces instead of ASCII space for japanese mnemonic as expected in the specification/test vectors.
- ci: integration test in dart
- refactor: set `fvm` in the repo with flutter `3.35.0`



## 2.0.0

- Upgrade: flutter_rust_bridge 2.9.0

## 1.0.3

- Improve precompiled binaries
- Bindings for PWD64 and PWD85
- Update docs

## 1.0.1

- Downgrade Flutter_Rust_Bridge version to ^2.0.0 to avoid incompatibility issues with other packages

## 1.0.2

- Publish bip85-extended to crates.io to avoid import issues
- Update readme

## 1.0.0

- Initial version


21 changes: 21 additions & 0 deletions bindings/dart-bip85/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 J. Azad EMERY a.k.a. ethicnology

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading