forked from bitcoin-wallet/bitcoin-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
213 lines (126 loc) · 7.29 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
FILES
Your wallet contains your private keys and various transaction related metadata. It is stored in app-private
storage:
Mainnet: /data/data/de.schildbach.wallet/files/wallet-protobuf (MODE_PRIVATE)
Testnet: /data/data/de.schildbach.wallet_test/files/wallet-protobuf-testnet (MODE_WORLD_READABLE | MODE_WORLD_WRITEABLE)
The wallet file format is not compatible to wallet.dat (Satoshi client). Rather, it uses a custom protobuf format
which should be compatible between clients using bitcoinj.
Certain actions cause automatic rolling backups of your wallet to app-private storage:
Mainnet: /data/data/de.schildbach.wallet/files/key-backup-protobuf (MODE_PRIVATE)
Testnet: /data/data/de.schildbach.wallet_test/files/key-backup-protobuf-testnet (MODE_PRIVATE)
Your wallet can be manually backed up to and restored from external storage:
Mainnet: /sdcard/Download/bitcoin-wallet-backup-<yyyy-MM-dd>
Testnet: /sdcard/Download/bitcoin-wallet-backup-testnet-<yyyy-MM-dd>
If you want to recover coins from manual backups and for whatever reason you cannot use the app
itself to restore from the backup, see the separate README.recover guide.
DEBUGGING
Wallet file for Testnet can be pulled from an (even un-rooted) device using
adb pull /data/data/de.schildbach.wallet_test/files/wallet-protobuf-testnet
Log messages can be viewed by
adb logcat
The app can send extensive debug information. Use Options > Settings > Report Issue and follow the dialog.
In the generated e-mail, replace the support address with yours.
BUILDING THE DEVELOPMENT VERSION
It's important to know that the development version uses Testnet, is debuggable and the wallet file
is world readable/writeable. The goal is to be able to debug easily.
You can probably skip some steps, especially if you built Android apps before.
You'll need git, a Java SDK 6 (or later) and Maven 3.0.4 (or later) for this. I'll assume Ubuntu Linux
for the package installs.
# first time only
sudo apt-get install git maven openjdk-6-jdk libstdc++6:i386
Get the Android SDK (Tools only) from
http://developer.android.com/sdk/
and unpack it to your workspace directory. Point your ANDROID_HOME variable to that Android SDK directory
and switch to it. Use
# make sure tools are at the newest version
tools/android update sdk --no-ui --force --filter tools
# fetch required android dependencies
tools/android update sdk --no-ui --force --filter build-tools-20.0.0,android-10,android-16,extra-android-m2repository
to download the necessary API level.
Finally, you can build Bitcoin Wallet and sign it with your development key. Again in your workspace,
use
# first time only
git clone -b master https://github.com/schildbach/bitcoin-wallet.git bitcoin-wallet
# each time
cd bitcoin-wallet
git pull
mvn clean install
To upload the app to your Android device, use
# first time only
sudo apt-get install android-tools-adb
# each time
adb install wallet/target/wallet-*-test.apk
BUILDING THE PRODUCTIVE VERSION
At this point I'd like to remind that you continue on your own risk. According to the license,
there is basically no warranty and liability. It's your responsibility to audit the source code
for security issues and build, install and run the application in a secure way.
The productive version uses Mainnet, is built non-debuggable, space-optimized with ProGuard and the
wallet file is protected against access from non-root users. In the code repository, it lives in a
separate 'prod' branch that gets rebased against master with each released version.
# each time
cd bitcoin-wallet
git fetch origin
git checkout origin/prod
mvn clean install -Prelease -Dandroid.sdk.path=<path to your android sdk>
SETTING UP FOR DEVELOPMENT
Make sure you've got Eclipse Luna with ADT 23 installed.
Use Git to check out the project and an Android library dependency to your workspace:
# clone Bitcoin Wallet project
git clone -b master https://github.com/schildbach/bitcoin-wallet.git bitcoin-wallet
Use the maven-eclipse-plugin to create Eclipse project files:
cd bitcoin-wallet
mvn clean install eclipse:eclipse
Optional: In the generated .classpath, remove the org.eclipse.jdt.launching.JRE_CONTAINER
classpath entry. It does not belong there, but cannot be excluded from being generated currently.
In Eclipse, use File -> Import -> General -> Existing Project into Workspace to import project.
If you see loads of "should be tagged with @Override" errors, set Project -> Properties ->
Java Compiler -> Errors/Warnings -> Annotations -> Missing @Override annotation to 'Warning'
TRANSLATIONS
The source language is English. Translations for all languages except German happen on Transifex:
https://www.transifex.com/projects/p/bitcoin-wallet/
The english resources are pushed to Transifex. Changes are pulled and committed to the git
repository from time to time. It can be done by manually downloading the files, but using the "tx"
command line client is more convenient:
# first time only
sudo apt-get install transifex-client
If strings resources are added or changed, the source language files need to be pushed to
Transifex. This step will probably only be executed by the maintainer of the project, as special
permission is needed:
# push source files to Transifex
tx push -s
As soon as a translation is ready, it can be pulled:
# pull translation from Transifex
tx pull -f -l <language code>
Note that after pulling, any bugs introduced by either translators or Transifex itself need to be
corrected manually.
NFC (Near field communication)
Bitcoin Wallet supports reading Bitcoin requests via NFC, either from a passive NFC tag or from
another NFC capable Android device that is requesting coins.
For this to work, just enable NFC in your phone and hold your phone to the tag or device (with
the "Request coins" dialog open). The "Send coins" dialog will open with fields populated.
Instructions for preparing an NFC tag with your address:
- We have successfully tested this NFC tag writer:
https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter
Other writers should work as well, let us know if you succeed.
- Some tags have less than 50 bytes capacity, those won't work. 1 KB tags recommended.
- The tag needs to contain a Bitcoin URI. You can construct one with the "Request coins" dialog,
then share with messaging or email. You can also construct the URI manually. Example for Mainnet:
bitcoin:1G2Y2jP5YFZ5RGk2PXaeWwbeA5y1ZtFhoL
- The type of the message needs to be URI or URL (not Text).
- If you put your tag at a public place, don't forget to enable write protect. Otherwise, someone
could overwrite the tag with his own Bitcoin address.
BITCOINJ
Bitcoin Wallet uses bitcoinj for Bitcoin specific logic:
https://bitcoinj.github.io/
EXCHANGE RATES
Bitcoin Wallet reads this feed from "BitcoinAverage" for getting exchange rates:
https://api.bitcoinaverage.com/custom/abw
I chose this feed because it is not dependent on a single exchange. However, you should keep in
mind it's always a 24h average (falling back to 7d or even 30d if no trade occurred for a long
time).
If the above feed is not available, the feed from "Blockchain.info" is fetched instead:
https://blockchain.info/ticker
SWEEPING WALLETS
For sweeping wallets, Bitcoin Wallet uses an API by biteasy to query for unspent transaction
outputs:
https://api.biteasy.com/blockchain/v1/unspent-outputs