/pay-no-way

A mobile app for testing payment systems against double-spend attacks.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

PayNoWay

A mobile app for testing payment systems against double-spend attacks.

Double-spending is no longer a theoretical possibility but a practical reality. Most of the end-user applications used widely today leave their users vulnerable to being defrauded via double-spend attacks. PayNoWay is a tool that you can use to test the applications that you, or your business, depend on to accept on-chain cryptocurrency payments. If you would like to learn more about how double-spending works: Double-Spending Made Easy.

Disclaimers

  • This app is intended to be used for testing and educational purposes.
  • Please do not use this app to double-spend against merchants without their explicit consent.
  • A successful double-spend is not guaranteed - use at your own risk.
  • You are responsible for creating a backup of your private key(s). Without a backup, if you delete the app or lose your device, your funds will be permanently lost.

Requirements

  • nodejs - For Linux and Mac install node via nvm.
  • make
  • For Android development:
    • Java Development Kit (JDK) version 8 or higher. Use your system's native package manager to install the JDK (if available).
    • Android SDK - On Ubuntu 18.04 or later, it is possible to install Android Studio from Ubuntu Software Sources.
    • gradle
    • adb - Not required, but is recommended.

Getting Started

Before continuing, be sure you already have the project's requirements.

Download the project files via git:

git clone https://github.com/samotari/pay-no-way.git

Install the project's dependencies:

cd pay-no-way
npm install

Build the application files:

npm run build

Android

Before installing and running the app on Android, you must prepare the Android platform with cordova:

npm run prepare:android

This downloads the cordova plugins which are necessary to build the app for Android devices.

Running on Android (VM)

Run the following command to check to see if there are any available Android virtual devices:

adb devices

Install and run the app on the virtual device with the following command:

npm run android-vm

Running on Android (Device)

To install and run the app on an Android device, you must first:

Once developer mode and USB debugging are enabled, connect the device to your computer via USB. Run the following command to check to see if your computer is authorized:

adb devices

Install and run the app on the device: with the following command

npm run android

Create Signed APK

Create your signing key:

npm run android-generate-signing-key

Build a production APK:

npm run build:prod && npm run build:apk

If successful, it should have created a new .apk file at the following path:

./platforms/android/app/build/outputs/apk/release/app-release.apk

To install the newly created APK onto an Android device:

adb install ./platforms/android/app/build/outputs/apk/release/app-release.apk
  • You may need to run adb devices before the above command.
  • And if the app is already installed on the device, you will need to use the -r flag to reinstall it.

Tests

This project includes automated tests. To run them:

npm test

Translations

Your help in translating the app into other languages is welcome. To do so please see the following steps:

  • Find the app's primary language file here.
  • Copy the contents of the file to the text editing program of your choice.
  • Change the values only - leave the keys un-translated. The reference keys are used internally in the app. Please see the following example:
var app = app || {};

app.lang = app.lang || {};

// The lang key here is the ISO_639-1 language code. See:
// https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
app.lang['es'] = (function() {

	return {
		'self.label': 'Español'
		'busy-text': 'Espere por favor...',
		'close': 'Cerrar',
		'copy': 'Copiar',
	};

})();
  • Once you've finished the translations, create an issue in this project here and copy/paste the contents of your translation file into the new issue.

    • Alternatively, you can fork this project and create a pull-request with the new file.
  • Thanks for taking the time to make a translation!

Changelog

See CHANGELOG.md

License

This project is licensed under the GNU General Public License v3 (GPL-3):

You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.