GithubHelp home page GithubHelp logo

isabella232 / rust-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ledgerhq/app-boilerplate-rust

0.0 0.0 0.0 126 KB

A demo Rust app using the UI and SDK as crates.

License: Apache License 2.0

Rust 88.56% Python 11.44%

rust-app's Introduction

Rust Nano S Application

A simple application that receives a message, displays it, and requests user approval to sign. Can also display an example menu.

Building

Prerequisites

This project will try to build nanos-secure-sdk, so you will need:

Linux

  1. A standard ARM gcc (sudo apt-get install gcc-arm-none-eabi binutils-arm-none-eabi)
  2. Cross compilation headers (sudo apt-get install gcc-multilib)
  3. Python3 (sudo apt-get install python3)
  4. Pip3 (sudo apt-get install python3-pip)

Windows

  1. install Clang
  2. install an ARM GCC toolchain
  3. Python

Other things you will need:

  • Cargo-ledger
  • Speculos (make sure you add speculos.py to your PATH by running export PATH=/path/to/speculos:$PATH)
  • The correct target for rustc: rustup target add thumbv6m-none-eabi

You can build on either Windows or Linux with a simple cargo build or cargo build --release. It currently builds on stable.

Loading

You can use cargo-ledger which builds, outputs a hex file and a manifest file for ledgerctl, and loads it on a device in a single cargo ledger load command in your app directory.

Some options of the manifest file can be configured directly in Cargo.toml under a custom section:

[package.metadata.nanos]
curve = "secp256k1"
flags = "0x40"
icon = "btc.gif"

Testing

One can for example use speculos

cargo run --release defaults to running speculos on the generated binary with the appropriate flags, if speculos.py is in your PATH.

There is a small test script that sends some of the available commands in test/test_cmds.py, or raw APDUs that can be used with ledgerctl.

rust-app's People

Contributors

yhql avatar pscott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.