GithubHelp home page GithubHelp logo

coreyphillips / moonshine Goto Github PK

View Code? Open in Web Editor NEW
68.0 7.0 33.0 9.16 MB

Moonshine is a homebrewed, open-source, non-custodial, Bitcoin wallet for iOS & Android.

Home Page: https://moonshinewallet.com/

License: MIT License

JavaScript 71.33% Java 1.18% Objective-C 0.82% TypeScript 26.22% Ruby 0.13% Starlark 0.33%
bitcoin litecoin bitcoin-wallet javascript react-native nodejs bitcoinjs-lib electrum android ios

moonshine's Introduction

Moonshine Icon

Moonshine

Moonshine is available on iOS & Android

Website: moonshinewallet.com

Send Transaction Main Receive Transaction

Moonshine is a homebrewed, open-source, non-custodial, Bitcoin/Litecoin Electrum wallet for iOS & Android.

Built with React Native, Moonshine utilizes Electrum's JSON-RPC methods to interact with the Bitcoin/Litecoin network.

Moonshine's intended use is as a hot wallet. Meaning, your keys are only as safe as the device you install this wallet on. As with any hot wallet, please ensure that you keep only a small, responsible amount of Bitcoin/Litecoin on it at any given time.

If you are looking for secure cold storage solutions please consider purchasing a Trezor or a Ledger

Features

  • Bitcoin/Litecoin Mainnet & Testnet supported
  • Bech32 support
  • Multiple wallet support
  • Electrum
    • Support for both random and custom peers
  • Encrypted storage
  • Biometric + Pin authentication
  • Custom fee selection
  • Import mnemonic phrases via manual entry or scanning
  • RBF functionality
  • BIP39 Passphrase functionality
  • Support for Segwit-compatible & legacy addresses in settings
  • Support individual private key sweeping
  • UTXO blacklisting
    • Accessible via the Transaction Detail view, this allows users to blacklist any utxo that they do not wish to include in their list of available utxo's when sending transactions. Blacklisting a utxo excludes it's amount from the wallet's total balance.
  • Ability to Sign & Verify Messages
  • Support BitID for passwordless authentication
  • Coin Control
    • This can be accessed from the Send Transaction view and basically allows users to select from a list of available UTXO's to include in their transaction.
  • Broadcast raw transactions

For an up-to-date list of features that are in progress please refer to Moonshine's issue page. If you do not see a feature that you want feel free to create a new issue requesting it or reach out at [email protected] and let me know.

Installation

  1. Clone Moonshine and Install Dependencies: git clone https://github.com/coreyphillips/moonshine && cd moonshine && yarn install
  2. Start the project:
    • iOS: react-native run-ios
    • Android: react-native run-android

Create Your Own Build

  • git clone https://github.com/coreyphillips/moonshine && cd moonshine && yarn install && yarn bundle

Create a Reproducible Build

This method requires docker to create a reproducible build and takes quite some time. However, it will allow you to verify against the most recently available build on Google Play.

A few things to note though. First, this method only works if using the same version that is currently available on the Play Store. Second, you'll need to be sure that you're comparing the correct apk files depending on the device you're using (x86, x86_64, v7a, arm64-v8a). Third, make sure you're building with a clean, unmodified clone of moonshine by following the steps below. Modifying the code in any way will result in a failed apkdiff.py check.

  1. Clone and cd into the latest release:
    • basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/coreyphillips/moonshine/releases/latest) | { IFS= read -r tag; git clone -b ${tag} https://github.com/coreyphillips/moonshine; }
    • cd moonshine
  2. Run docker and create the build. Once built, the apks will be located in "moonshine/android/app/build/outputs/apk/release/":
    • docker run --rm --name moonshine-build -v ${PWD}:/pwd -w /pwd coreylphillips/react-native-android bash -c "source ~/.bash_profile && yarn install && cd nodejs-assets/nodejs-project && yarn install && cd ../../android && ./gradlew clean && cd .. && yarn bundle"
  3. Fetch the apk from Google Play using a service of your choice. I've listed a few below:
  4. Use apkdiff.py to compare the apk files. Example usage:
    • python apkdiff.py googleplay.apk local.apk

Contributing

  1. Fork it (https://github.com/coreyphillips/moonshine)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Altcoin Support

Please be aware and take note that my primary focus is on expanding the core functionality of this wallet and not on adding altcoins. However, for those wishing to add a specific altcoin for personal use, I have created the following guide so that you may fork off in a proper fashion: Altcoin Implementation Guide

If you have any questions regarding this guide I'm always happy to help so don't hesitate to reach out.

Support

Supported Derivation Paths: m/44' | 49' | 84' /0'/0'

Again, if you have any questions, feature requests, etc., please feel free to create an issue on Github, reach out to me on Twitter or send an email to [email protected].

Donate

I built this app to learn and have fun. I never intend to monetize or turn a profit on this app so if you found it useful, cool or interesting please consider donating:

Meta

Corey Phillips – @coreylphillips

Distributed under the MIT license. See LICENSE for more information.

https://github.com/coreyphillips/moonshine

License MIT

Acknowledgments

  • Giant shoutout to the authors and contributors of the following projects along with everyone who has taken the time to provide feedback and help me through this process of learning and development. You are all awesome:
    • bitcoinjs-lib
      • For providing a powerful library with detailed documentation capable of handling all of the necessary client-side, Bitcoin-related heavy-lifting.
    • Electrum
      • For providing a simple and flexible way to interact with the Bitcoin network.
    • Lightning-App
      • For providing the initial inspiration for the main UI of this app and for providing a wonderful guide/example of how to implement Lightning via Neutrino.
    • Testers!
      • Thank you for the encouragement, exceptional feedback and help troubleshooting throughout the development process. You are a large part of what makes this community great. Thank you!
      • Special shoutout to the Groestlcoin team for their awesome help with QA and bug catching as they setup their own fork.

moonshine's People

Contributors

coreyphillips avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

moonshine's Issues

FaceID gets stuck in loop when transitioning from background to foreground.

FaceID gets stuck in a loop when transitioning from a background state to foreground forcing the user to swipe out of and restart the app.

Steps to reproduce:

  1. Enable FaceID from Settings.
  2. Close the app.
  3. Open the app normally using FaceID.
  4. Put the app into a background state.
  5. Re-open the app from it's background state and attempt to open the wallet with FaceID.

Expected Behavior:
The app allows the user to open the wallet and resume normal operations.

Actual Behavior:
The app appears to get caught in an authentication loop, switching between being able to access the wallet as expected and then immediately back to the Biometrics component.

Share requested amount shows incorrect numbers

How to reproduce:

  1. Go to settings choose Crypto Units BTC
  2. Go to Receive
  3. Specify amount
  4. 12 BTC Ok
  5. Press Share
  6. send message to Telegram f.e.
  7. U will send something like this

Address:
bc1qw5g9s6*****************************d6am2rg

Amount:
1200000000 BTC
$87,513.12

problem occurred starting process 'command 'security'' - Windows10 Android

Hi Corey, im trying to run moonshine-0.2.0-2 with windows10 and android but i got this errors.

I will apreciate help.

Thanks

`FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    A problem occurred evaluating project ':app'.

A problem occurred starting process 'command 'security''

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================

2: Task failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':app'.

compileSdkVersion is not specified.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================`

generated address never received crypto

I did testing of sending crypto to 1 bech32 1 segwit and 1 legacy address.
I did generate them one by one and gave to my friend.
he send money to all of them.
Funny but Legacy wallet was not showing anything.
I check blockexplorer and found transaction but never in wallet.

How can I debug Issue? Can I enumerate all addresses? Do u have JS version of wallet where I can import wallet and find out why TX not appears?

Update wallet when a transaction is received.

This feature will create a listener for the next available address of the currently active wallet. When a transaction is detected the app will refresh the wallet and vibrate to notify the user of activity. The app will then remove the previous listener and move on to the next available address of the currently active wallet. Switching between wallets/coins will work the same way, removing the previous listener and setting up a new listener on the currently active wallet's next available address.

Add suggested words as users type their mnemonic phrase

Add a "Suggested Words" section to the Import Mnemonic Phrase view that will suggest valid words as the user types them. Not only would it make typing 12-24 words more convenient, but helps users that only store the first 3-4 characters of a word from their backup.

Restoring of seed phrase needs extra refresh

Good time of day!

I found funny behavior:
after recovering wallet from backup seed phrase, we see no money in main screen.

Refresh wallet button not helping in this case somehow.

Only remedy I found till now :

  1. Settings
  2. click on Legacy
  3. click on Segwit,
  4. Bech32
  5. Return to main screen

Now we can see amount of money which was backed up.

Testnet bech32 not sending

I get an error when trying to sweep from and to a testnet bech32 address. When i copy the hex and broadcast elsewhere it looks like there are no inputs. That’s on iOS, latest Testflight.

Allow users to create watch-only wallets.

This feature is not currently on the roadmap, but has been highly requested. If there are any capable and willing RN developers out there wanting the same feature please feel free to take this on.

Account for language preferences that replace a period with a comma in the keyboard

Users are currently unable to type a period in the "Amount" TextInput when attempting to send a transaction when the following two conditions apply:

  • The user has a language preference set on their device that replaces a period with a comma in the keyboard.
  • The user has "BTC" set as their "Crypto Unit" in Settings.

The current workaround is to set "sats" as the "Crypto Unit" in Settings. However, a fix will be available shortly for the 0.3.5 release.

bech32 shows segwit TXs

sometimes in TX log of bech32 I see segwit TXs...
later they disappears.
Honestly I would prefer to have 1 log for all of them.

Paper Wallet Sweep on Bitcoin Testnet not completing

We are working on a fork of this app for a different coin and are stuck on the paper wallet sweep function. This process starts with scanning a WIF QR Code.

Next, we tested this function on the app from the Google Play store last updated on Jan 20, 2020. A paper wallet was created with a Legacy address and testnet bitcoins were deposited (4 mBTC).

As seen in this screenshot the amount is found, but the app doesn't progress beyond this screen.

Screenshot_20200123-103456_Moonshine

We haven't tested if this is the case on Bitcoin mainnet, or Litecoin mainnet or testnet.

Add ability to request a specific amount from the "Receive Transaction" view

This would allow users to request a specific amount of sats or fiat from the "Receive Transaction" view. This would update the qrcode to a BIP21 compatible URL with the amount specified. Attempting to copy the address after specifying an amount will only copy the address. Attempting to share the address after specifying an amount will include the address and amount separately in the share message.

Failed to transform artifact 'Lndmobile.aar (project :Lndmobile)' to match attributes {artifactType=android-manifest}

Hi, when running react-native run-android it wont compile giving an error trying to transform artifact lndmobile.aar

I have windows 10

info JS server already running.
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...

Configure project :lottie-react-native
publishNonDefault is deprecated and has no effect anymore. All variants are now published.

Task :app:preDebugBuild FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:preDebugBuild'.

Could not resolve all files for configuration ':app:debugCompileClasspath'.
Failed to transform artifact 'Lndmobile.aar (project :Lndmobile)' to match attributes {artifactType=android-manifest}
> Execution failed for IdentityTransform: C:\Users\juant\Documents\GitHub\bitbip\android\Lndmobile\Lndmobile.aar.
> Transform output file C:\Users\juant\Documents\GitHub\bitbip\android\Lndmobile\Lndmobile.aar does not exist.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 6s
54 actionable tasks: 1 executed, 53 up-to-date
error Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
error Command failed: gradlew.bat app:installDebug
debug Error: Command failed: gradlew.bat app:installDebug
at checkExecSyncError (child_process.js:629:11)
at execFileSync (child_process.js:647:13)
at runOnAllDevices (C:\Users\juant\Documents\GitHub\bitbip\node_modules@react-native-community\cli\build\commands\runAndroid\runOnAllDevices.js:58:39)
at buildAndRun (C:\Users\juant\Documents\GitHub\bitbip\node_modules@react-native-community\cli\build\commands\runAndroid\runAndroid.js:142:41)
at then.result (C:\Users\juant\Documents\GitHub\bitbip\node_modules@react-native-community\cli\build\commands\runAndroid\runAndroid.js:104:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

Allow users to batch transactions

This feature would allow users to batch transactions via the Send Transaction view.
I'm currently thinking a "+" icon that when tapped would transition the view into a carousel, allowing the user to tack on as many additional transactions that they would like. To edit any given transaction they would simply swipe horizontally via the carousel and edit/update the desired transaction accordingly.

Android wallet hangs in "Getting current block"

I set up my own Electrum server and tested and everything seemed fine.
The connection is TCP no SSL on port 5001 (maybe it accepts only ssl connections?).
The "receive" part doesn't give informations.
If I tap "bitcoin" to change currency and I choose "litecoin" then I'm able to get a receiving address (probably because a different server is used?).
When try to come back to the "Bitcoiin" currency there's a screen saying:
"Getting current block, Height and exchange rate..."

Are non SSL connection to an Electrum server allowed. That could be the problem. I need it because I connect through Tor or VPN.
Thank you.
2020-02-21 16 30 42

Allow users to toggle between a light and dark mode in settings

This feature will allow users to toggle between a light and dark mode in Settings.

I'm thinking the light mode will retain the scheme we have now and remain the default. While the dark mode will replace the current purple scheme altogether in lieu of something like #302e43 or #2f2d3a. All purple text/icons would also need to be updated accordingly.

unable to generate new receiving address

I did extensive test on receiving small amount to Legacy wallet from my mates Bech32 wallet.
Both Moonshine based.
after 5 random addresses 1 address start repeating.
it was same until it received some amount of crypto.
Can I always get new random address without confirmation of receiving crypto on previous generated address?

Use correct Derivation Paths

Part 1

There are 2 places where the derivation path is specified in the format m/${keyDerivationPath}'/0'/0'/${networkValue}/0, but it should be in the format m/${keyDerivationPath}'/${networkValue}'/0'

Incorrect:

subTitle: `m/${keyDerivationPath}'/0'/0'/${isTestnet ? 1 : 0}/0`,

return `m/${keyDerivationPath}'/0'/0'/${networkValue}/0`;

basically, this is not needed: 0'/0'/

Correct:

const addressPath = `m/${keyDerivationPath}'/${networkValue}'/0'/0/${i + addressIndex}`;

Part 2 - address derivation for different coins:

const networkValue = networkType === "testnet" ? 1 : 0; //Used to modify the derivation path accordingly

const networkValue = networkType === "testnet" ? "1" : "0";

These two spots will derive the correct addresses in subsequent code for Bitcoin (0) and TestNet (1) for any coin. However the 0 should be 2 for litecoin. Other software that supports multiple coins has used modules like coininfo where the coin_type is included in coin's network information. (e.g. https://github.com/cryptocoinjs/coininfo/blob/master/lib/coins/ltc.js#L27). Since the coin_type is 0 for litecoin, the addresses generated by the app do not match those generated by https://iancoleman.io/bip39/

one solution is to include that value in the networks data:

const networks = {

Remove Litecoin

This is an interesting project with some great functionality.

That said, I (& many others) don't want to be exposed to shitcoins and the associated technical overhead. Litecoin is advertised with misleading information and detracts from this project.

Would you consider removing litecoin support?

Connecting to custom electrumx server never happen in Release mode

I tested your app in debug mode with my custom electrumx server - works well.
But if I make signed APK with bundled react native it never connect to my Electrumx server.
While sniffing traffic on server side -
It shows that Android tries to connect but connection finished without server received payload from mobile phone.

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.