Comprehensive Bitcoin development library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Comprehensive Bitcoin development library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash, Litecoin and Dash blockchains. Fully compliant with existing standards and BIPs.
It happens because TransactionExtractor cannot extract any data from a transaction.
It is incorrect behavior, because we should handle all transaction, even if we were not able to extract any "pubic key" or "address" data from it.
PeerGroup should download blocks by "windows". Window means that it should concurrently download blocks in a range and provide it to app.
Application on the other hand - should request to download blocks by serial windows.
Currently there are files Crypto/WalletKitPrivate.m and Crypto/WalletKitPrivate.h which are swift implementations of some cryptographic algorithms used in bitcoin. Sometimes we get exceptions in Crypto/WalletKitPrivate.m#43 saying that key variable is NULL.
There's a new swift implementation available in BitcoinKit. Let's try to use them.
Currently, if we can't extract keyhash from input scriptSig we leave as unknown input.
TransactionLinker should look for previous output of unknown inputs and set keyhash if output exists
Now HeaderHandler rejects all block headers that are not in its chain.
Instead it should check incoming block headers for the case of fork. If incoming headers are more "valid" than the chain on our database - it should replace it.
Each header in HeaderHandler should be validated and saved independently.
Creating validated block should be extracted into separate class (ValidatedBlockFactory).
Currently there are files Crypto/WalletKitPrivate.m and Crypto/WalletKitPrivate.h which are swift implementations of some cryptographic algorithms used in bitcoin. Sometimes we get exceptions in Crypto/WalletKitPrivate.m#43 saying that key variable is NULL.
There's a new swift implementation available in BitcoinKit. Let's try to use them.
Now most of the logs are printed directly into console.
It is no suitable when we need to debug and print only certain logs. Logger should be available to turn on/off certain logs.
As PeerGroup was transferred from Android project - it was not developed using TDD.
All Peer and PeerGroup related logic should be covered with unit tests:
When discovering new peers for several dns seeds - if any seed will not respond or respond slowly - all peer discovery process is stuck.
Dns seeds should report their discovery results independently from each other.
Transactions are now can be sent only in "real-time". This means that in order for them to be sent successfully we should have started PeerGroup and connected Peers.
We should handle resending transactions when PeerGroup is ready and on app restart as well.
Now all sync and handler jobs use DispatchQueues with qos = .background.
This is not quite correct because some tasks require more priority to make syncing of blockchain faster.
Every DispatchQueue in the app should be reviewed and correct qos should be selected.
Currently, our peers don't send transactions sending our P2PK outputs. Because, there's nothing matching our PKH/PK in their inputs. For this, FilterLoad message has a nFlag attribute. We should set it to 2 in order for peers to automatically update bloom filter with COutPoints of matched P2PK outputs.
This and this(#94 ) tickets gradually pollute the bloom filter. That's why we should track the false positives ratio and clear/reset bloom filter when that ratio raises
After downloading and parsing all transactions - we can remove all transactions that are not related to our wallet. (they were downloaded by bloom filter false positive rate).
After removing transactions we can also remove all blocks that have no transactions, except the blocks that are required for blockchain validation (2016 last blocks usually).
Currently, our peers don't send transactions sending our native P2WPKH outputs. Because, they don't test filter against witnessdata, where matching PKH is located. Therefore, we should set COutPoint hashes of those outputs to bloom filter when we detect them.
Now ProgressSyncer reports progress calculated for all blocks in database (synced/non synced).
For the first sync session it shows correct progress, but for later sync sessions it shows incorrect progress.
We should get the last synced block in database and fetch the last block height from sync peer and calculate progress according to this data.
Now we determine PublicKey used in the transaction by matching only with publicKeyHash. We should also match with WitnessProgramHash, in order to find our p2wpkh(sh) transactions.
Use ScriptBuilder for generating p2wpkh(sh) keyhashes
AddressManager should also generate p2wpkh(sh) for each PublicKey and set that hash to bloomfilter
Current transaction parsing logic is developed for parsing them in random order.
After #83 - all blocks (and their transactions) are downloaded in order. So transaction parsing logic can be simplified according top this changes.