Skip to content

Commit

Permalink
Added support for Epic Cash
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasFlamel1 committed May 8, 2023
1 parent 8ab8cea commit 224df0e
Show file tree
Hide file tree
Showing 85 changed files with 15,072 additions and 2,642 deletions.
683 changes: 569 additions & 114 deletions .github/workflows/continuous_integration.yml

Large diffs are not rendered by default.

168 changes: 164 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS)

# Application version
APPVERSION_M = 7
APPVERSION_N = 0
APPVERSION_N = 1
APPVERSION_P = 0
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

Expand Down Expand Up @@ -72,7 +72,13 @@ ifeq ($(CURRENCY),mimblewimble_coin)
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_MQS_ADDRESS
DEFINES += CURRENCY_ENABLE_TOR_ADDRESS
DEFINES += CURRENCY_ENABLE_NO_RECENT_DUPLICATE_KERNELS
DEFINES += CURRENCY_MQS_VERSION=\{1,69\}
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=MWC_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=ASCII_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=\(MQS_PAYMENT_PROOF_ADDRESS\|TOR_PAYMENT_PROOF_ADDRESS\)
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=\(MQS_SLATE_ENCRYPTION\|TOR_SLATE_ENCRYPTION\)
DEFINES += CURRENCY_MQS_NAME=\"MQS\"
DEFINES += CURRENCY_NAME=\"MimbleWimble\\x20\\x43oin\"
DEFINES += CURRENCY_ABBREVIATION=\"MWC\"

Expand Down Expand Up @@ -129,7 +135,13 @@ else ifeq ($(CURRENCY),mimblewimble_coin_floonet)
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_MQS_ADDRESS
DEFINES += CURRENCY_ENABLE_TOR_ADDRESS
DEFINES += CURRENCY_ENABLE_NO_RECENT_DUPLICATE_KERNELS
DEFINES += CURRENCY_MQS_VERSION=\{1,121\}
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=MWC_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=ASCII_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=\(MQS_PAYMENT_PROOF_ADDRESS\|TOR_PAYMENT_PROOF_ADDRESS\)
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=\(MQS_SLATE_ENCRYPTION\|TOR_SLATE_ENCRYPTION\)
DEFINES += CURRENCY_MQS_NAME=\"MQS\"
DEFINES += CURRENCY_NAME=\"MimbleWimble\\x20\\x43oin\\x20\\x46loonet\"
DEFINES += CURRENCY_ABBREVIATION=\"Floonet\\x20MWC\"

Expand Down Expand Up @@ -192,8 +204,13 @@ else ifeq ($(CURRENCY),grin)
DEFINES += CURRENCY_BIP44_COIN_TYPE=592
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_SLATEPACK_ADDRESS
DEFINES += CURRENCY_ENABLE_NO_RECENT_DUPLICATE_KERNELS
DEFINES += CURRENCY_SLATEPACK_ADDRESS_HUMAN_READABLE_PART=\"grin\"
DEFINES += CURRENCY_MAXIMUM_FEE=0xFFFFFFFFFF
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=GRIN_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=BINARY_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=SLATEPACK_PAYMENT_PROOF_ADDRESS
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=SLATEPACK_SLATE_ENCRYPTION
DEFINES += CURRENCY_NAME=\"Grin\"
DEFINES += CURRENCY_ABBREVIATION=\"GRIN\"

Expand Down Expand Up @@ -256,8 +273,13 @@ else ifeq ($(CURRENCY),grin_testnet)
DEFINES += CURRENCY_BIP44_COIN_TYPE=1
DEFINES += CURRENCY_FRACTIONAL_DIGITS=9
DEFINES += CURRENCY_ENABLE_SLATEPACK_ADDRESS
DEFINES += CURRENCY_ENABLE_NO_RECENT_DUPLICATE_KERNELS
DEFINES += CURRENCY_SLATEPACK_ADDRESS_HUMAN_READABLE_PART=\"tgrin\"
DEFINES += CURRENCY_MAXIMUM_FEE=0xFFFFFFFFFF
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=GRIN_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=BINARY_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=SLATEPACK_PAYMENT_PROOF_ADDRESS
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=SLATEPACK_SLATE_ENCRYPTION
DEFINES += CURRENCY_NAME=\"Grin\\x20Testnet\"
DEFINES += CURRENCY_ABBREVIATION=\"Testnet\\x20GRIN\"

Expand Down Expand Up @@ -287,15 +309,153 @@ else ifeq ($(CURRENCY),grin_testnet)
# Emulator flags
EMULATOR_FLAGS += --library "MimbleWimble Coin":"mimblewimble coin.elf"

# Otherwise check if currency is Epic Cash
else ifeq ($(CURRENCY),epic_cash)

# Application name
APPNAME = "Epic Cash"

# 44'/23000' path on secp256k1 curve
APP_LOAD_PARAMS += --curve secp256k1 --path "44'/23000'"

# Check if target is the Nano X
ifeq ($(TARGET_NAME),TARGET_NANOX)

# APPLICATION_FLAG_BOLOS_SETTINGS application flags for Bluetooth
APP_LOAD_PARAMS += --appFlags 0x200

# Otherwise check if target is the Stax
else ifeq ($(TARGET_NAME),TARGET_STAX)

# APPLICATION_FLAG_BOLOS_SETTINGS application flags for Bluetooth
APP_LOAD_PARAMS += --appFlags 0x200

# Otherwise
else

# No application flags
APP_LOAD_PARAMS += --appFlags 0x000
endif

# Defines
DEFINES += CURRENCY_ID=4
DEFINES += CURRENCY_BIP44_COIN_TYPE=23000
DEFINES += CURRENCY_FRACTIONAL_DIGITS=8
DEFINES += CURRENCY_ENABLE_MQS_ADDRESS
DEFINES += CURRENCY_ENABLE_TOR_ADDRESS
DEFINES += CURRENCY_MQS_VERSION=\{1,0\}
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=GRIN_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=BINARY_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=TOR_PAYMENT_PROOF_ADDRESS
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=MQS_SLATE_ENCRYPTION
DEFINES += CURRENCY_MQS_NAME=\"Epicbox\"
DEFINES += CURRENCY_NAME=\"Epic\\x20\\x43\\x61sh\"
DEFINES += CURRENCY_ABBREVIATION=\"EPIC\"

# Check if target is the Stax
ifeq ($(TARGET_NAME),TARGET_STAX)

# Defines
DEFINES += CURRENCY_ICON_DETAILS=C_icon_epic_cash_big
DEFINES += CURRENCY_ICON_BITMAP=C_icon_epic_cash_big_bitmap

# Otherwise
else

# Defines
DEFINES += CURRENCY_ICON_DETAILS=C_icon_epic_cash
DEFINES += CURRENCY_ICON_COLORS=C_icon_epic_cash_colors
DEFINES += CURRENCY_ICON_BITMAP=C_icon_epic_cash_bitmap
endif

# Defines library
DEFINES += USE_LIB_MIMBLEWIMBLE_COIN
APP_LOAD_PARAMS += --dep "MimbleWimble Coin":$(APPVERSION)

# Icon
ICON = Epic Cash

# Emulator flags
EMULATOR_FLAGS += --library "MimbleWimble Coin":"mimblewimble coin.elf"

# Otherwise check if currency is Epic Cash floonet
else ifeq ($(CURRENCY),epic_cash_floonet)

# Application name
APPNAME = "Epic Cash Floonet"

# 44'/1' path on secp256k1 curve
APP_LOAD_PARAMS += --curve secp256k1 --path "44'/1'"

# Check if target is the Nano X
ifeq ($(TARGET_NAME),TARGET_NANOX)

# APPLICATION_FLAG_BOLOS_SETTINGS application flags for Bluetooth
APP_LOAD_PARAMS += --appFlags 0x200

# Otherwise check if target is the Stax
else ifeq ($(TARGET_NAME),TARGET_STAX)

# APPLICATION_FLAG_BOLOS_SETTINGS application flags for Bluetooth
APP_LOAD_PARAMS += --appFlags 0x200

# Otherwise
else

# No application flags
APP_LOAD_PARAMS += --appFlags 0x000
endif

# Defines
DEFINES += CURRENCY_ID=5
DEFINES += CURRENCY_BIP44_COIN_TYPE=1
DEFINES += CURRENCY_FRACTIONAL_DIGITS=8
DEFINES += CURRENCY_ENABLE_MQS_ADDRESS
DEFINES += CURRENCY_ENABLE_TOR_ADDRESS
DEFINES += CURRENCY_MQS_VERSION=\{1,136\}
DEFINES += CURRENCY_ADDRESS_DERIVATION_TYPE=GRIN_ADDRESS_DERIVATION
DEFINES += CURRENCY_PAYMENT_PROOF_MESSAGE_TYPE=BINARY_PAYMENT_PROOF_MESSAGE
DEFINES += CURRENCY_SUPPORTED_PAYMENT_PROOF_ADDRESS_TYPES=TOR_PAYMENT_PROOF_ADDRESS
DEFINES += CURRENCY_SUPPORTED_SLATE_ENCRYPTION_TYPES=MQS_SLATE_ENCRYPTION
DEFINES += CURRENCY_MQS_NAME=\"Epicbox\"
DEFINES += CURRENCY_NAME=\"Epic\\x20\\x43\\x61sh\\x20\\x46loonet\"
DEFINES += CURRENCY_ABBREVIATION=\"Floonet\\x20\\x45PIC\"

# Check if target is the Stax
ifeq ($(TARGET_NAME),TARGET_STAX)

# Defines
DEFINES += CURRENCY_ICON_DETAILS=C_icon_epic_cash_big
DEFINES += CURRENCY_ICON_BITMAP=C_icon_epic_cash_big_bitmap

# Otherwise
else

# Defines
DEFINES += CURRENCY_ICON_DETAILS=C_icon_epic_cash
DEFINES += CURRENCY_ICON_COLORS=C_icon_epic_cash_colors
DEFINES += CURRENCY_ICON_BITMAP=C_icon_epic_cash_bitmap
endif

# Defines library
DEFINES += USE_LIB_MIMBLEWIMBLE_COIN
APP_LOAD_PARAMS += --dep "MimbleWimble Coin":$(APPVERSION)

# Icon
ICON = Epic Cash

# Emulator flags
EMULATOR_FLAGS += --library "MimbleWimble Coin":"mimblewimble coin.elf"

# Otherwise
else

# Display error
$(error Unsupported CURRENCY - use mimblewimble_coin, mimblewimble_coin_floonet, grin, or grin_testnet)
$(error Unsupported CURRENCY - use mimblewimble_coin, mimblewimble_coin_floonet, grin, grin_testnet, epic_cash, or epic_cash_floonet)
endif

# Define total number of supported currencies
DEFINES += TOTAL_NUMBER_OF_SUPPORTED_CURRENCIES=4
DEFINES += TOTAL_NUMBER_OF_SUPPORTED_CURRENCIES=6

# Check if target is the Nano S
ifeq ($(TARGET_NAME),TARGET_NANOS)
Expand Down Expand Up @@ -518,4 +678,4 @@ dep/%.d: %.c Makefile

# List variants
listvariants:
@echo VARIANTS CURRENCY mimblewimble_coin mimblewimble_coin_floonet grin grin_testnet
@echo VARIANTS CURRENCY mimblewimble_coin mimblewimble_coin_floonet grin grin_testnet epic_cash epic_cash_floonet
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# MimbleWimble Coin (MWC) and Grin (GRIN) Ledger hardware wallet apps
# MimbleWimble Coin (MWC), Grin (GRIN), and Epic Cash (EPIC) Ledger hardware wallet apps

### Description
MimbleWimble Coin (MWC) and Grin (GRIN) apps for Ledger Nano S, Ledger Nano X, Ledger Nano S Plus, and Ledger Stax hardware wallets.
MimbleWimble Coin (MWC), Grin (GRIN), and Epic Cash (EPIC) apps for Ledger Nano S, Ledger Nano X, Ledger Nano S Plus, and Ledger Stax hardware wallets.

These apps can be installed onto Ledger Nano S and Ledger Nano S Plus hardware wallets by going [here](https://htmlpreview.github.io/?https://github.com/NicolasFlamel1/Ledger-MimbleWimble-Coin/blob/master/tools/installer/index.html) with a web browser that supports [WebUSB](https://caniuse.com/webusb).

Ledger Live Desktop and Ledger Live Mobile with MimbleWimble Coin (MWC) and Grin (GRIN) support can be downloaded [here](https://github.com/NicolasFlamel1/ledger-live/releases).
Ledger Live Desktop and Ledger Live Mobile with MimbleWimble Coin (MWC), Grin (GRIN), and Epic Cash (EPIC) support can be downloaded [here](https://github.com/NicolasFlamel1/ledger-live/releases).

[These video tutorials](https://youtube.com/playlist?list=PLb1nuT3sFYbD_sydCVCngbvATsm9RwWyF) go over how to start using Grin with Ledger Live Desktop/Mobile and how to send Grin to and receive Grin from popular wallets and exchanges with it.

Expand Down Expand Up @@ -41,8 +41,8 @@ cd ..
git clone https://github.com/LedgerHQ/ledger-secure-sdk.git
mv ledger-secure-sdk stax-secure-sdk
cd stax-secure-sdk
git checkout stax_1.0.0
git checkout API_LEVEL_8
git checkout stax_1.1.0-rc1
git checkout API_LEVEL_9
git pull
echo stax > .target
cd ..
Expand Down Expand Up @@ -71,11 +71,13 @@ The apps can then be built with the following commands:
```
make CURRENCY=mimblewimble_coin
make CURRENCY=grin
make CURRENCY=epic_cash
```
The apps can be installed onto Ledger Nano S, Ledger Nano S Plus, and Ledger Stax hardware wallets with the following commands:
```
make load CURRENCY=mimblewimble_coin
make load CURRENCY=grin
make load CURRENCY=epic_cash
```

### Testing
Expand All @@ -84,6 +86,7 @@ Functional tests for the apps can be ran with the following commands:
npm i @ledgerhq/hw-transport-node-speculos @ledgerhq/hw-transport-node-hid
make functional_tests CURRENCY=mimblewimble_coin
make functional_tests CURRENCY=grin
make functional_tests CURRENCY=epic_cash
```
Unit tests can be ran with the following commands:
```
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/how_to_send_epic_cash_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/Epic Cash/images/setup_instructions_6.png
Loading

0 comments on commit 224df0e

Please sign in to comment.