Skip to content

GenYuanLian/SourceWallet

Repository files navigation

Build Status

Testing in a Browser

Note: This method should only be used for development purposes. When running Copay in a normal browser environment, browser extensions and other malicious code might have access to internal data and private keys.

Clone the repo and open the directory:

git clone https://github.com/bitpay/copay.git
cd copay

Ensure you have Node installed, then install and start Copay:

npm run apply:copay
npm start

Visit localhost:8100 to view the app.

Build Copay App Bundles

Before building the release version for a platform, run the clean-all command to delete any untracked files in your current working directory. (Be sure to stash any uncommited changes you've made.) This guarantees consistency across builds for the current state of this repository.

The final commands build the production version of the app, and bundle it with the release version of the platform being built.

##prepare npm install -g electron electron-packager cordova

Android build on linux

Follow the Cordova Android Platform Guide to set up your development environment.

npm run clean-all
npm run apply:copay
npm run final:android

iOS build on mac osx

Follow the Cordova Android Platform Guide to set up your development environment.

npm run clean-all
npm run apply:copay
npm run final:ios

Desktop (Linux, macOS, and Windows)

To comile windows x64 platform:
electron-packager . copay --win32 --out ../ --arch=x64 --electron-version=1.8.4
To comile osx x64 platform:
electron-packager . copay --darwin --out ../ --arch=x64 --electron-version=1.8.4
To comile linux x64 platform:
electron-packager . copay --linux --out ../ --arch=x64 --electron-version=1.8.4

Copay Backups and Recovery

Since v1.2 Copay uses BIP39 mnemonics for backing up wallets. The BIP44 standard is used for wallet address derivation. Multisig wallets use P2SH addresses, while non-multisig wallets use P2PKH.

Information about backup and recovery procedures is available at: https://github.com/bitpay/copay/blob/master/backupRecovery.md

Previous versions of Copay used files as backups. See the following section.

It is possible to recover funds from a Copay Wallet without using Copay or the Wallet Service, check the Copay Recovery Tool.

Wallet Export Format

Copay encrypts the backup with the Stanford JS Crypto Library. To extract the private key of your wallet you can use https://bitwiseshiftleft.github.io/sjcl/demo/, copy the backup to 'ciphertext' and enter your password. The resulting JSON will have a key named: xPrivKey, that is the extended private key of your wallet. That information is enough to sign any transaction from your wallet, so be careful when handling it!

The backup also contains the key publicKeyRing that holds the extended public keys of the Copayers. Depending on the key derivationStrategy, addresses are derived using BIP44 or BIP45. Wallets created in Copay v1.2 and forward always use BIP44, all previous wallets use BIP45. Also note that since Copay version v1.2, non-multisig wallets use address types Pay-to-PublicKeyHash (P2PKH) while multisig wallets still use Pay-to-ScriptHash (P2SH) (key addressType at the backup):

| Copay Version | Wallet Type | Derivation Strategy | Address Type | |---|---|---|---|---| | <1.2 | All | BIP45 | P2SH | | >=1.2 | Non-multisig | BIP44 | P2PKH | | >=1.2 | Multisig | BIP44 | P2SH | | >=1.5 | Multisig Hardware wallets | BIP44 (root m/48') | P2SH |

Using a tool like Bitcore PlayGround all wallet addresses can be generated. (TIP: Use the Address section for P2PKH address type wallets and Multisig Address for P2SH address type wallets). For multisig addresses, the required number of signatures (key m on the export) is also needed to recreate the addresses.

BIP45 note: All addresses generated at BWS with BIP45 use the 'shared cosigner index' (2147483647) so Copay address indexes look like: m/45'/2147483647/0/x for main addresses and m/45'/2147483647/1/y for change addresses.

Since version 1.5, Copay uses the root m/48' for hardware multisignature wallets. This was coordinated with Ledger and Trezor teams. While the derivation path format is still similar to BIP44, the root was in order to indicate that these wallets are not discoverable by scanning addresses for funds. Address generation for multisignature wallets requires the other copayers extended public keys.

Bitcore Wallet Service

Copay depends on Bitcore Wallet Service (BWS) for blockchain information, networking and Copayer synchronization. A BWS instance can be setup and operational within minutes or you can use a public instance like https://bws.bitpay.com. Switching between BWS instances is very simple and can be done with a click from within Copay. BWS also allows Copay to interoperate with other wallets like [Bitcore Wallet CLI] (https://github.com/bitpay/bitcore-wallet).

License

Copay is released under the MIT License. Please refer to the LICENSE file that accompanies this project for more information including complete terms and conditions.

About

a SourceWallet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •