Skip to content

Commit

Permalink
Merge pull request #314 from selfcustody/integrated_changes
Browse files Browse the repository at this point in the history
Integrated changes
  • Loading branch information
odudex authored Mar 6, 2024
2 parents 7add64a + 10037be commit 768e24b
Show file tree
Hide file tree
Showing 662 changed files with 15,257 additions and 69,749 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,21 @@ assignees: ''

---

#### Summary

<!-- Describe some general things about the bug -->

**Device**
- [ ] Amigo
- [ ] M5stickV
- [ ] Dock
- [ ] Bit
- [ ] Yahboom

**Version**
- [ ] Official release (selfcustody/krux): <!-- Specify version, like v23.09.1 -->
- [ ] Beta release (odudex/krux_binaries): <!-- Specify version, like v24.01.0-beta14 -->

#### Describe the bug

<!-- Give some details about it -->
8 changes: 6 additions & 2 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ coverage:
status:
project:
default:
target: 100%
threshold: 15%
target: 95%
threshold: 5%
patch:
default:
target: 95%
threshold: 5%
52 changes: 14 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
strategy:
matrix:
device: [maixpy_m5stickv, maixpy_amigo_ips, maixpy_amigo_tft, maixpy_bit, maixpy_dock]
device: [maixpy_m5stickv, maixpy_amigo, maixpy_bit, maixpy_dock]
runs-on: ubuntu-latest
services:
registry:
Expand All @@ -20,7 +20,7 @@ jobs:
- 5000:5000
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Docker Buildx
Expand Down Expand Up @@ -59,53 +59,29 @@ jobs:
path: ${{ steps.extract-m5stickv.outputs.destination }}
name: build-m5stickv

- name: Build for Amigo IPS
if: matrix.device == 'maixpy_amigo_ips'
- name: Build for Amigo
if: matrix.device == 'maixpy_amigo'
uses: docker/build-push-action@v4
with:
context: .
build-args: DEVICE=maixpy_amigo_ips
build-args: DEVICE=maixpy_amigo
push: true
tags: localhost:5000/selfcustody/krux-builder-amigo-ips:latest
tags: localhost:5000/selfcustody/krux-builder-amigo:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Amigo IPS
id: extract-amigo-ips
if: matrix.device == 'maixpy_amigo_ips'
- name: Extract firmware for Amigo
id: extract-amigo
if: matrix.device == 'maixpy_amigo'
uses: shrink/actions-docker-extract@v2
with:
image: localhost:5000/selfcustody/krux-builder-amigo-ips:latest
image: localhost:5000/selfcustody/krux-builder-amigo:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Amigo IPS
if: matrix.device == 'maixpy_amigo_ips'
- name: Upload firmware for Amigo
if: matrix.device == 'maixpy_amigo'
uses: actions/upload-artifact@v3
with:
path: ${{ steps.extract-amigo-ips.outputs.destination }}
name: build-amigo-ips

- name: Build for Amigo TFT
if: matrix.device == 'maixpy_amigo_tft'
uses: docker/build-push-action@v4
with:
context: .
build-args: DEVICE=maixpy_amigo_tft
push: true
tags: localhost:5000/selfcustody/krux-builder-amigo-tft:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Extract firmware for Amigo TFT
id: extract-amigo-tft
if: matrix.device == 'maixpy_amigo_tft'
uses: shrink/actions-docker-extract@v2
with:
image: localhost:5000/selfcustody/krux-builder-amigo-tft:latest
path: /src/firmware/Kboot/build/.
- name: Upload firmware for Amigo TFT
if: matrix.device == 'maixpy_amigo_tft'
uses: actions/upload-artifact@v3
with:
path: ${{ steps.extract-amigo-tft.outputs.destination }}
name: build-amigo-tft
path: ${{ steps.extract-amigo.outputs.destination }}
name: build-amigo

- name: Build for Bit
if: matrix.device == 'maixpy_bit'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
build-gh-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
lint-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: psf/black@stable
Expand All @@ -40,9 +40,9 @@ jobs:
lint-pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -59,9 +59,9 @@ jobs:
check-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Validate translations
Expand All @@ -70,11 +70,11 @@ jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand All @@ -89,11 +89,11 @@ jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
Expand Down
61 changes: 61 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,64 @@
# Changelog 24.04.beta16 - February 10, 2024

## Changes

### Wipe Device
Option on tools to wipe the device, permanently removing settings and stored encrypted mnemonics by erasing every single bit of user's flash space.

### Better Deletion of Mnemonics Stored on SD card
When deleting an encrypted mnemonic from an SD card, Krux will now overwrite the memory area making it impossible to recover the previously stored data.

### Save and Load Wallet Output Descriptor from SD card
Create or load from a wallet output descriptor file on an SD card. The backup file format is compatible with most coordinators.

### Sign Messages at a Derived Bitcoin address
Sign messages from Sparrow and Specter, via QR code, also attesting a Bitcoin address belongs to you.

### Add Entropy Quality Estimation for Mnemonic Creation.
Entropy quality estimators, like Shannon's entropy, were added to mnemonic generation through dice rolls and camera snapshot.

### IRQ Interfaces
Button and touch presses are now detected by the application through IO interrupts. Meaning inputs events will be registered and handled even if they happened when other tasks were being executed by the processor, resulting in a better UX.

### Restore Default Settings
Option to restore the device's settings to its factory state.

### Optimized Settings Storage
Device's storage is now used more efficiently, data is stored less frequently, only in case a setting is changed from defaults.

### Amigo's Power Manager Enhancements
Standardize Amigo's shutdown and power on behavior.

### GUI Enhancements
Icons, information text boxes, and rounded shapes are now present at the GUI.

### Mnemonic Numbers
To match the input options, export mnemonics as decimal, hexadecimal, or octal numbers. When loading from numbers, a new numbers confirmation screen was added.

### Optimized QR codes
QR codes rendering is faster and uses less RAM.

### Export QR Codes as Images to SD Card
Some QR codes can be exported as images to SD card.

### Screensaver
Optional screensaver to reduce pixels' burn-in and grab the attention of the user when the device is left powered on.

### Addresses Exploring
More receive and change addresses per page are shown on bigger screens.

### Update Embit to version 0.7
Use the latest Embit release.

### Maix Dock Simulator
Now Krux PC simulator can also run in Maix Dock mode, mimicking appearance and characteristics of the most DIY Krux device.

### Join Amigo IPS and Amigo TFT firmwares
Users will be able to flash a single firmware and change display settings if their device was shipped with a display different from standard TFT.

### Other Small Fixes and Code Optimizations
Many other small fixes and optimizations under the hood.

# Version 23.09.1 - November 18, 2023
This release contain bugfixes:

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,5 @@ FROM build-firmware AS build
ARG DEVICE="maixpy_m5stickv"
WORKDIR /src/firmware/Kboot/build
RUN cp /src/firmware/MaixPy/projects/"${DEVICE}"/build/firmware.bin .
RUN sed -i -e 's/\r$//' *.sh
RUN ./CLEAN.sh && ./BUILD.sh
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<p align="center">
<img src="https://selfcustody.github.io/krux/img/maixpy_m5stickv/logo-125.png">
<img src="https://selfcustody.github.io/krux/img/maixpy_amigo_tft/logo-150.png">
<img src="https://selfcustody.github.io/krux/img/maixpy_amigo/logo-150.png">
</p>

Krux is open-source firmware that enables anyone to build their own Bitcoin signing device via off-the-shelf parts. It runs on Kendryte K210 devices such as the [M5StickV](https://docs.m5stack.com/en/core/m5stickv) and [Maix Amigo](https://www.seeedstudio.com/Sipeed-Maix-Amigo-p-4689.html), converting them into airgapped devices that can sign transactions for multisignature and single-sig wallets.
Expand Down Expand Up @@ -66,25 +66,25 @@ Note that you can run `poetry install` after making a change to the krux code if

## Format code
```bash
poetry run black ./src
poetry run black ./tests
poetry run poe format
```

## Run pylint
```bash
poetry run pylint ./src
poetry run poe lint
```

## Run tests
```bash
poetry run pytest --cache-clear --cov src/krux --cov-report html ./tests
poetry run poe test
```

This will run all tests and generate a coverage report you can browse to locally in your browser at `file:///path/to/krux/htmlcov/index.html`.

For more verbose test output (e.g., to see the output of print statements), run:

```bash
poetry run pytest --cache-clear --cov src/krux --cov-report html --show-capture all --capture tee-sys -r A ./tests
poetry run poe test-verbose
```

To run just a specific test from a specific file, run:
Expand Down Expand Up @@ -130,7 +130,7 @@ Run the simulator:
cd simulator

# Run simulator with the touch device amigo, then use mouse to navigate
poetry run python simulator.py --device maixpy_amigo_tft
poetry run python simulator.py --device maixpy_amigo

# Run simulator with sd enabled (you need the folder `simulator/sd`) on the small button-only device m5stick, then use keyboard (arrow keys UP or DOWN and ENTER)
poetry run python simulator.py --device maixpy_m5stickv --sd
Expand Down Expand Up @@ -168,7 +168,7 @@ cd simulator
poetry run python simulator.py --sequence sequences/about.txt --sd --device maixpy_m5stickv

# Sequence screenshots are scaled to fit in docs. Use --no-screenshot-scale to get full size
poetry run python simulator.py --sequence sequences/home-options.txt --device maixpy_amigo_tft --no-screenshot-scale
poetry run python simulator.py --sequence sequences/home-options.txt --device maixpy_amigo --no-screenshot-scale
```

## Live debug a device
Expand Down Expand Up @@ -287,7 +287,7 @@ Learn about how to setup fonts [here](firmware/font/README.md)

## Colors

Use [this script](firmware/scripts/krux_colors.py) to generate Maixpy compatible colors from RGB values to customize Krux
Use [this script](firmware/scripts/rgbconv.py) to generate Maixpy compatible colors from RGB values to customize Krux

## Documentation

Expand Down
10 changes: 7 additions & 3 deletions docs/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.md-typeset img {
margin: 0 0 0.4em 0.8em !important;
}
.md-typeset img {
margin: 0 0 0.4em 0.8em !important;
}

.md-typeset img.twemoji {
margin: 0 !important;
}
15 changes: 0 additions & 15 deletions docs/development.en.md

This file was deleted.

Loading

0 comments on commit 768e24b

Please sign in to comment.