Compare commits
15
Commits
0.0.2
...
f167b704bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f167b704bf | ||
|
|
c3d2c68860 | ||
|
|
785cd3f713 | ||
|
|
8dffe41150 | ||
|
|
21660b6c58 | ||
|
|
65b5c0713c | ||
|
|
baa2387f71 | ||
|
|
525621bb00 | ||
|
|
a80561a6c3 | ||
|
|
c8d2a4ad75 | ||
|
|
7af3fa0123 | ||
|
|
fd7484b140 | ||
|
|
eb0a92fb4d | ||
|
|
d752a56f2b | ||
|
|
8e5fe74f5c |
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 B.J. Dweck
|
||||||
|
|
||||||
|
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.
|
||||||
@@ -1,97 +1,31 @@
|
|||||||
# Rudefox Burrow
|
# Rudefox Burrow
|
||||||
|
|
||||||
Rudefox provides a pair of command line tools for the creation and management of Bitcoin wallets.
|
*Offline Bitcoin Seed Generation and Wallet Tool*
|
||||||
|
|
||||||
+ Use `burrow` on an air-gapped single-board computer, like a Raspberry Pi, to generate new seed words, obtain addresses and extended public keys from existing seed words and sign PSBT transactions offline.
|
Use Burrow on an air-gapped, single-board computer, like a Raspberry Pi, to generate new seed words, derive addresses and extended public keys from existing seed words or sign PSBT transactions offline. Check out the self-audited seed generation feature: [ShowMyWork](https://rudefox.io/blog/2020-07-16-show-my-work.html).
|
||||||
+ Use `reynard` on a connected ("hot") device to view your balance and utxo's and to create new, unsigned transactions.
|
|
||||||
|
|
||||||
## Unique Feature: ShowMyWork
|
[Rudefox Burrow](https://rudefox.io/burrow/) is released under the [MIT License](LICENSE.md) by B.J. Dweck
|
||||||
|
|
||||||
[**Rudefox ShowMyWork**](https://rudefox.io/blog/2020-07-16-show-my-work.html) is a feature of Burrow that enables non-technical end-users to audit the seed generation process in order to verify that the generated seed is derived directly from [8-sided dice](https://www.amazon.com/dp/B07XPMV4DQ/) rolls and a set of lookup-tables. Read more [here](https://rudefox.io/blog/2020-07-16-show-my-work.html).
|
## Getting Started
|
||||||
|
|
||||||
|
If you simply want to dive in and try your hand at generating a self-audited seed, see the [Burrow Quick Start](https://www.rudefox.io/burrow/quick-start.html) guide.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
|
* Install the Java 8 SDK (Java 8+ is not already installed)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
[email protected]:~$ burrow mnemonic -i8 --bits 128
|
sudo apt-get install -y openjdk-8-jdk-headless
|
||||||
|
|
||||||
Input 11 x 8-sided dice rolls [1-8]: 12345678123
|
|
||||||
|
|
||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |
|
|
||||||
|000 001 010 01 | 1 100 101 110 1 | 11 000 001 010|
|
|
||||||
| 1. ahead | 2. slight | 3. scout |
|
|
||||||
|
|
||||||
Input 11 x 8-sided dice rolls [1-8]: 12345678123
|
|
||||||
|
|
||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1 | 2 | 3 |
|
|
||||||
|000 001 010 01 | 1 100 101 110 1 | 11 000 001 010|
|
|
||||||
| 4. ahead | 5. slight | 6. scout |
|
|
||||||
|
|
||||||
...
|
|
||||||
|
|
||||||
ahead slight scout ahead slight scout ahead slight scout ahead slight scan
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Menemonic Generation
|
* Clone the repository and build
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
[email protected]:~$ burrow mnemonic --interactive --dice-entropy --bits 128
|
git clone https://git.rudefox.io/rudefox/burrow.git
|
||||||
Input 50 dice rolls [1-6]: 234322343242422344161254151
|
cd burrow
|
||||||
Input 23 more dice rolls [1-6]: 33116265515343114314456
|
./gradlew build distTar
|
||||||
Mnemonic Sentence: mountain tilt wing silk rude fox almost volume wine media verify card
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Mnemonic Options
|
* Find the distribution `.tar` file in `build/distributions/`
|
||||||
|
|
||||||
```bash
|
|
||||||
usage: burrow mnemonic
|
|
||||||
-b,--bits <128|160|192|224|256> bits of entropy (default: 256)
|
|
||||||
-d,--dice-entropy use dice entropy source
|
|
||||||
-e,--events <EVENT_STRING> string representing events from entropy source
|
|
||||||
-h,--help display help message
|
|
||||||
-i,--interactive use interactive command line mode
|
|
||||||
```
|
|
||||||
|
|
||||||
## Xpub Export
|
|
||||||
|
|
||||||
```bash
|
|
||||||
[email protected]:~$ burrow wallet --sentence "stove prefer lunch collect small orphan wasp size beyond auction
|
|
||||||
guilt great" --passphrase apple
|
|
||||||
xpub6CKy5SECeJipZid8dF3bopoMGdRzd7hMJuPzMGesZCobrMSssZyASexzXuzRTPVLcqqdyAEZJKPMGvDthgZW2Z3mPHLohxEAVbkvGKAXjqx
|
|
||||||
```
|
|
||||||
### QR Code Generation
|
|
||||||
|
|
||||||
```bash-qrcode
|
|
||||||
[email protected]:~$ burrow wallet --sentence "stove prefer lunch collect small orphan wasp size beyond auction
|
|
||||||
guilt great" --passphrase apple -q
|
|
||||||
|
|
||||||
█▀▀▀▀▀█ ▄█ █▄█ ▀▄▀ ▀▄▄▄██▄ █▀▄ █▀▀▀▀▀█
|
|
||||||
█ ███ █ ▀ ▀▄█▄▄▄▄██▄▄▄█ █ █▄ █ ███ █
|
|
||||||
█ ▀▀▀ █ █▄▀ █▄█▄▄▄▀█▀▄ ▄▀▀█▀ ▄▄▄ █ ▀▀▀ █
|
|
||||||
▀▀▀▀▀▀▀ █▄▀▄█ ▀▄█▄▀ ▀▄█ █ █▄▀▄▀ ▀ ▀▀▀▀▀▀▀
|
|
||||||
██ █ ▀█ ███ ██ ▄█▄▀▄▀▀██ █▀▄▄▀▀▀ ▀▀▄
|
|
||||||
██ ▀ █▀█▄▀█▄██▀ ▀ █▀ ▄▄▄▀██ █▀▀▀█ █▀ █▀
|
|
||||||
█▀█▄ ▀█▀▀ ▄█▄█▄▀ █▀█ ██▀▄█▀ ▄██▀█ ▀ ▀
|
|
||||||
▀██ ▀▄▄▀▄ ██ ▀██▄▀▄█▀▀█▄▀▄▀█▀▄▄▀▀█▄▀ █▀
|
|
||||||
▀█▄▄ ▀▀▄ ▀▀▀▄▀ ██▄▄ ▀ ▀ █▀ ▀▄▀ █ █ █▀█▄ ▄
|
|
||||||
███ █ ▀██ ▀▄▀█ ▄▄▀ ▄ ▄█▄▄ ▀▄██▄ ▀▄█▀▀ ▀▀
|
|
||||||
▀█▄█▄ ▀ ▀▄▄█ ▀▄ █ ▄▀▀ ▄▄▀▄█▄█ ██▀▀▀▀▀ █
|
|
||||||
▀ ▀▀▄ ▀▄█ ▄ ██▄▀▀██▄▄█▄ ▄█▄ █▀ ▄ ▄▀██
|
|
||||||
█ ▀▄▄▄▀█▀██▄▄▀▄▄▀█▄ █ ▄██▀▄ ▄ ▄▄█▀█ █ ▄
|
|
||||||
▀ ██ ▀▀▀▄ ▀██▄▄▄ ██ █▀█▀▄█ ▄▄▀▄▀▀ ▄█ ▀█▀
|
|
||||||
▀▄▄█ █▀ █▄▀ ██▀█▄ █▄▀████▀▄██ ▄▄▀█ █▀█▀▀█
|
|
||||||
▀ ▄▄ ▀▄▄▄▄▀█ ▄▀▀█████ ▀▀▀▄ █ ▄█▀█▀▀█▀▀▀
|
|
||||||
▀ ▀▀ ▀▀▄▀▀▄▄▀█▀▄ ▄███ ▀██▀▀█ █▄█▀▀▀█▄ █
|
|
||||||
█▀▀▀▀▀█ ▀▄█▄▀ ▄ █ ▀▄▄▄▄▄█▀ ▀▀ █ ▀ █ ▄█▄
|
|
||||||
█ ███ █ ▄ █▄ ▄ █▄▄ ▀█ █ ▄ ▀██ █▀█▀█ ▀█▀
|
|
||||||
█ ▀▀▀ █ ▄▄▀█ █ ▄ ▄█▄ ▄▄▀█▄▀ ▄█ █ ▀ █▀ █▀
|
|
||||||
▀▀▀▀▀▀▀ ▀▀ ▀ ▀ ▀▀ ▀ ▀ ▀▀▀ ▀▀▀
|
|
||||||
[email protected]:~$
|
|
||||||
```
|
|
||||||
|
|
||||||
### Wallet Options
|
|
||||||
|
|
||||||
```bash
|
|
||||||
usage: burrow wallet
|
|
||||||
-h,--help display help message
|
|
||||||
-p,--passphrase <PASSPHRASE> optional seed passphrase
|
|
||||||
-s,--sentence <SENTENCE> mnemonic sentence
|
|
||||||
-q,--qrcode optional seed passphrase
|
|
||||||
```
|
|
||||||
+12
-6
@@ -8,7 +8,7 @@ plugins {
|
|||||||
repositories {
|
repositories {
|
||||||
|
|
||||||
maven {
|
maven {
|
||||||
url "https://repo.rudefox.io/repository/maven-public/"
|
url "https://repo.rudefox.io/repository/maven-releases/"
|
||||||
}
|
}
|
||||||
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -17,15 +17,20 @@ repositories {
|
|||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
|
|
||||||
def isRelease = versionDetails().commitDistance == 0
|
|
||||||
|
|
||||||
group 'io.rudefox'
|
group 'io.rudefox'
|
||||||
version isRelease ? gitVersion.call() : gitVersion.call() + "-SNAPSHOT"
|
|
||||||
|
|
||||||
application {
|
application {
|
||||||
mainClassName = 'io.rudefox.burrow.RudefoxBurrow'
|
mainClassName = 'io.rudefox.burrow.RudefoxBurrow'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def isRelease = versionDetails().commitDistance == 0 &&
|
||||||
|
versionDetails().isCleanTag &&
|
||||||
|
((versionDetails().branchName == 'master') || (versionDetails().branchName == 'null'))
|
||||||
|
|
||||||
|
version isRelease ? gitVersion.call() : gitVersion.call() + "-${versionDetails().branchName}-SNAPSHOT"
|
||||||
|
|
||||||
|
println "${group}:${project.name}:${version}" + ' ' + (isRelease ? '(RELEASE)' : '(SNAPSHOT)')
|
||||||
|
|
||||||
run {
|
run {
|
||||||
standardInput = System.in
|
standardInput = System.in
|
||||||
}
|
}
|
||||||
@@ -41,9 +46,10 @@ tasks.withType(Test) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'io.rudefox:vixen:0.0.2'
|
compile 'io.rudefox:vixen:0.0.3'
|
||||||
compile 'info.picocli:picocli:4.0.4'
|
compile 'info.picocli:picocli:4.5.1'
|
||||||
compile 'com.google.zxing:core:3.4.0'
|
compile 'com.google.zxing:core:3.4.0'
|
||||||
|
compile 'com.diogonunes:JColor:5.0.0'
|
||||||
testCompile 'com.bjdweck.test:commons-test:0.0.1'
|
testCompile 'com.bjdweck.test:commons-test:0.0.1'
|
||||||
testCompile "org.junit.jupiter:junit-jupiter-params:$junitVersion"
|
testCompile "org.junit.jupiter:junit-jupiter-params:$junitVersion"
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
testImplementation "org.junit.jupiter:junit-jupiter-api:$junitVersion"
|
||||||
|
|||||||
@@ -1,23 +1,32 @@
|
|||||||
package io.rudefox.burrow;
|
package io.rudefox.burrow;
|
||||||
|
|
||||||
import com.bjdweck.bitcoin.mnemonic.Entropy;
|
import com.bjdweck.bitcoin.mnemonic.Entropy;
|
||||||
|
import com.diogonunes.jcolor.AnsiFormat;
|
||||||
|
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import static com.diogonunes.jcolor.Attribute.*;
|
||||||
|
|
||||||
public class Dice8EntropyGenerator {
|
public class Dice8EntropyGenerator {
|
||||||
|
|
||||||
|
public static final AnsiFormat RED_STYLE = new AnsiFormat(WHITE_TEXT(), RED_BACK(), BOLD());
|
||||||
|
public static final AnsiFormat GREEN_STYLE = new AnsiFormat(BLACK_TEXT(), GREEN_BACK(), BOLD());
|
||||||
|
public static final AnsiFormat BLUE_STYLE = new AnsiFormat(WHITE_TEXT(), BLUE_BACK(), BOLD());
|
||||||
|
|
||||||
public static final int DICE_PER_ROLL = 11;
|
public static final int DICE_PER_ROLL = 11;
|
||||||
|
|
||||||
private final int targetBitsOfEntropy;
|
private final int targetBitsOfEntropy;
|
||||||
private final Scanner inputScanner;
|
private final Scanner inputScanner;
|
||||||
|
private final boolean ansiColorOutput;
|
||||||
|
|
||||||
private Entropy entropy = new Entropy();
|
private Entropy entropy = new Entropy();
|
||||||
|
|
||||||
public Dice8EntropyGenerator(int targetBitsOfEntropy, Scanner inputScanner) {
|
public Dice8EntropyGenerator(int targetBitsOfEntropy, Scanner inputScanner, boolean ansiColorOutput) {
|
||||||
|
|
||||||
this.targetBitsOfEntropy = targetBitsOfEntropy;
|
this.targetBitsOfEntropy = targetBitsOfEntropy;
|
||||||
this.inputScanner = inputScanner;
|
this.inputScanner = inputScanner;
|
||||||
|
this.ansiColorOutput = ansiColorOutput;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entropy generate() {
|
Entropy generate() {
|
||||||
@@ -81,18 +90,42 @@ public class Dice8EntropyGenerator {
|
|||||||
int entropyBitIndex = entropyBitString.length() - currentRollSetBitString.length() + rollSetBitIndex;
|
int entropyBitIndex = entropyBitString.length() - currentRollSetBitString.length() + rollSetBitIndex;
|
||||||
|
|
||||||
if (entropyBitIndex < targetBitsOfEntropy)
|
if (entropyBitIndex < targetBitsOfEntropy)
|
||||||
rollSetBitsLine.append(currentRollSetBitString.charAt(rollSetBitIndex));
|
rollSetBitsLine.append(styleBit("" + currentRollSetBitString.charAt(rollSetBitIndex), entropyBitIndex, rollSetBitIndex));
|
||||||
else
|
else
|
||||||
rollSetBitsLine.append("-");
|
rollSetBitsLine.append("-");
|
||||||
|
|
||||||
if (rollSetBitIndex == 32) rollSetBitsLine.append("|");
|
if (rollSetBitIndex == 32)
|
||||||
else if (rollSetBitIndex % 3 == 2) rollSetBitsLine.append(" ");
|
rollSetBitsLine.append("|");
|
||||||
else if (rollSetBitIndex % 11 == 10) rollSetBitsLine.append(" | ");
|
else if (rollSetBitIndex % 3 == 2)
|
||||||
|
rollSetBitsLine.append(styleBit(" ", entropyBitIndex, rollSetBitIndex));
|
||||||
|
else if (rollSetBitIndex % 11 == 10)
|
||||||
|
rollSetBitsLine.append(" | ");
|
||||||
}
|
}
|
||||||
|
|
||||||
return rollSetBitsLine;
|
return rollSetBitsLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String styleBit(String bit, int globalEntropyBitIndex, int currentRollSetBitIndex) {
|
||||||
|
|
||||||
|
if (!ansiColorOutput || globalEntropyBitIndex >= targetBitsOfEntropy)
|
||||||
|
return bit;
|
||||||
|
|
||||||
|
return getBitFormat(currentRollSetBitIndex).format(bit);
|
||||||
|
}
|
||||||
|
|
||||||
|
private AnsiFormat getBitFormat(int rollSetBitIndex) {
|
||||||
|
|
||||||
|
int wordBitIndex = rollSetBitIndex % 11;
|
||||||
|
|
||||||
|
if (wordBitIndex == 0)
|
||||||
|
return RED_STYLE;
|
||||||
|
|
||||||
|
if (wordBitIndex <= 6)
|
||||||
|
return GREEN_STYLE;
|
||||||
|
|
||||||
|
return BLUE_STYLE;
|
||||||
|
}
|
||||||
|
|
||||||
private String getSeedWordsLine(int rollSet) {
|
private String getSeedWordsLine(int rollSet) {
|
||||||
|
|
||||||
int baseIndex = rollSet * 3;
|
int baseIndex = rollSet * 3;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ public class MnemonicCommand implements Runnable {
|
|||||||
return getDice6EntropyInteractive(diceEventBuffer);
|
return getDice6EntropyInteractive(diceEventBuffer);
|
||||||
|
|
||||||
if (isDice8InteractiveMode())
|
if (isDice8InteractiveMode())
|
||||||
return new Dice8EntropyGenerator(targetBitsOfEntropy, new Scanner(System.in)).generate();
|
return new Dice8EntropyGenerator(targetBitsOfEntropy, new Scanner(System.in), CommandLine.Help.Ansi.AUTO.enabled()).generate();
|
||||||
|
|
||||||
diceEventBuffer.appendEvents(entropyOptions.eventMethod.getEventString);
|
diceEventBuffer.appendEvents(entropyOptions.eventMethod.getEventString);
|
||||||
return diceEventBuffer.toEntropy();
|
return diceEventBuffer.toEntropy();
|
||||||
|
|||||||
@@ -2,13 +2,14 @@ package io.rudefox.burrow;
|
|||||||
|
|
||||||
import com.bjdweck.bitcoin.params.INetworkParameters;
|
import com.bjdweck.bitcoin.params.INetworkParameters;
|
||||||
import com.bjdweck.bitcoin.params.NetworkParameters;
|
import com.bjdweck.bitcoin.params.NetworkParameters;
|
||||||
|
import picocli.AutoComplete;
|
||||||
import picocli.CommandLine;
|
import picocli.CommandLine;
|
||||||
|
|
||||||
@CommandLine.Command(
|
@CommandLine.Command(
|
||||||
name = "burrow",
|
name = "burrow",
|
||||||
synopsisSubcommandLabel = "COMMAND",
|
synopsisSubcommandLabel = "COMMAND",
|
||||||
description = "Offline wallet tool",
|
description = "Offline wallet tool",
|
||||||
subcommands = {MnemonicCommand.class, WalletCommand.class}
|
subcommands = {MnemonicCommand.class, WalletCommand.class, AutoComplete.GenerateCompletion.class}
|
||||||
)
|
)
|
||||||
public class RudefoxBurrow implements Runnable {
|
public class RudefoxBurrow implements Runnable {
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ class mnemonic_8_sided_dice_tests extends CliTestFixture {
|
|||||||
@Test
|
@Test
|
||||||
void with_arguments_interactive_8_sided_dice_should_generate_mnemonic_sentence() throws UnsupportedEncodingException {
|
void with_arguments_interactive_8_sided_dice_should_generate_mnemonic_sentence() throws UnsupportedEncodingException {
|
||||||
|
|
||||||
|
System.setProperty("picocli.ansi", "false");
|
||||||
|
|
||||||
withArgs("mnemonic -i8 --bits 128");
|
withArgs("mnemonic -i8 --bits 128");
|
||||||
|
|
||||||
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
|
expectedOutput("Input 11 x 8-sided dice rolls [1-8]: ");
|
||||||
|
|||||||
Reference in New Issue
Block a user