Comments (9)
Tested on this piece of code.
For zprv
(bip84) - it's downloading transactions, but not recognising old transactions (history for such wallet is empty)
For xprv
(bip32) - it doesn't download transactions at all.
from bitcoincore.swift.
Same seedData
used to initialise bitcoinKit
works as expected
from bitcoincore.swift.
All tested on .testNet .newWallet
from bitcoincore.swift.
hey @ArtemZinkov ,
.newWallet is considered to sync transactions only after the last checkpoint block. It assumes that the wallet is new and it has no transactions. You can check with ".api" or ".full" to sync historical transactions.
full // Sync from bip44Checkpoint. Api restore disabled
api // Sync from lastCheckpoint. Api restore enabled
newWallet // Sync from lastCheckpoint. Api restore enabled
lastCheckpoint is the last block of the last difficulty adjustment and it's updated before each release of the app.
from bitcoincore.swift.
Tested on this piece of code. For
zprv
(bip84) - it's downloading transactions, but not recognising old transactions (history for such wallet is empty) Forxprv
(bip32) - it doesn't download transactions at all.
As of watch accounts, we only support account derivations which have "m/purpose'/coin_type'/account'" derivations. You can get an account Public extended key as following:
let keychain = HDKeychain(privateKey: rootKey) // rootKey is an instance of HDPrivateKey
let publicKey = try! keychain.derivedKey(path: "m/84'/0'/0'").publicKey()
let extendedKey = HDExtendedKey.public(key: publicKey)
bip32 derivations are the generic name of all HD wallets and it may be custom for each type of wallets.
from bitcoincore.swift.
Hello @esen thank you for answering!
I tried to generate pubKey the way you mentioned, but for some reason - old transactions was still not recognised as "ours"
BUT if i init wallet with Seed - it fetches and see transactions properly
For more context - i still use .newWallet, due to it's testNet, transactions in it is quite recent and they're shown in history, for seed initialisation.
I clear Tx (BitcoinKit.Kit.clear()) every time when i change init version (with seed, or derived pubKey), to replicate initial launch.
Sorry if i missing some important detail, please ask if more context is required here
from bitcoincore.swift.
Hello @esen i would really appreciate any help or suggestion here, due to i faced road block here and not sure where to move forward, to enable watch only mode for wallets.
i also checked syncMode == .full, and still had no history for watch only mode, while bitcoinKit with seedData initialiser was capable to see old transactions for wallet i used
from bitcoincore.swift.
UPDATE:
Found what was the issue!
Derived path ("m/84'/0'/0'") you provided - consists of:
Purpose - 84
coinType - 0 (bitcoin)
chain - 0
I was testing this all on testNet, thus coinType should be 1 as mentioned here
i changed derivation path from "m/84'/0'/0'" to "m/84'/1'/0'" and it worked!
Thanks!!
from bitcoincore.swift.
I would suggest to add this as a check to compare with networkType, during initialisation of bitcoinKit
from bitcoincore.swift.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitcoincore.swift.