Skip to content
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

Krux Apps, small utility programs to enhance Krux #485

Draft
wants to merge 57 commits into
base: develop
Choose a base branch
from

Conversation

tadeubas
Copy link
Contributor

@tadeubas tadeubas commented Nov 30, 2024

What is this PR for?

Create a new Tool to enable the execution of developer's signed Krux apps as .mpy files in SD card.

In the simulator it fakes the execution of the selected .mpy file (within simulator/sd) by executing the kapp.py file in the simulator root folder.

In order to execute on the device, first enable execution of SPIFFS VFS changing the file firmware/MaixPy/components/micropython/port/src/maixpy_main.c line 276 to vfs->exec_allowed = true;

In any case you will need to generate a .mpy file using the tool firmware/MaixPy/components/micropython/core/mpy-cross. Follow its README.md instructions in order to make and then compile a .py file into .mpy. It is defined that all kapps must implement the run() function that will be executed.

You will also need to create a .sig file based on the .mpy. Remember to change the contents of the SIGNER_PUBKEY inside src\krux\metadata.py following instructions here To generate a keypair and Signing the firmware (firmware will be your .mpy file) in order to sign and verify the signature within Krux code.

Use my PUBKEY to test the signed apps (kapp, nostr) more easily, just change your metadata.py and flash the device:

SIGNER_PUBKEY = "0473d0a15dd45c336749dd548f73a2d3e4d4eb35a63bed31339959616a8b9d9e6e0060acc43bb915e89dc0d7f2b1c480be36d4f9883f1be1e525cddcd01d495805"

TODO:

  • Create the Nostr Krux app using the code and idea from @odudex . Creates a Nostr private key (nsec or hex) based on BIP-39 mnemonic and vice versa.
  • Reformulate Nostr Kapp to use NIP06 instead with NIP19.
  • Allow Nostr Kapp to sign a Nostr event.
  • Nostr Kapp: Add support to NIP-26 delegation.
  • Create a C function in Maixpy to allow the Python code to change SPIFFS VFS exec_allowed attr.
  • Create test cases.
  • Create docs page.

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Docs update
  • Other

Copy link

codecov bot commented Nov 30, 2024

Codecov Report

Attention: Patch coverage is 41.43646% with 106 lines in your changes missing coverage. Please review.

Project coverage is 93.21%. Comparing base (824e8ee) to head (fb8711c).

Files with missing lines Patch % Lines
src/krux/pages/kapps.py 11.20% 103 Missing ⚠️
src/krux/pages/login.py 89.28% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #485      +/-   ##
===========================================
- Coverage    94.37%   93.21%   -1.16%     
===========================================
  Files           74       75       +1     
  Lines         8104     8252     +148     
===========================================
+ Hits          7648     7692      +44     
- Misses         456      560     +104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tadeubas
Copy link
Contributor Author

tadeubas commented Dec 13, 2024

Use my PUBKEY to test the signed apps (kapp, nostr) more easily, just change your metadata.py and flash the device:

SIGNER_PUBKEY = "0473d0a15dd45c336749dd548f73a2d3e4d4eb35a63bed31339959616a8b9d9e6e0060acc43bb915e89dc0d7f2b1c480be36d4f9883f1be1e525cddcd01d495805"

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