...
I have had a windows-only desktop app for a long time now and a while ago I decided to expand to multiple platforms including Android but got busy doing a million other things that couldn't start the journey and while the project I currently work on would eventually have all those options too but it is at least a year away from being complete. If you are familiar with .Net and C# you could use my code as an starting point. Since the code is very loosely coupled I don't think the migration is going to be that hard, these would be the steps: - Change the target framework to .Net core (v 2.2 or better yet use the latest v 3.1) - Swap all the views with Xamarin forms which are using pretty similar XAML syntax so that conversion should also be easier - Add a new Balance and Price APIs to support LTC. This may be harder since it would require changing the wallet file and how addresses are stored to figure out which is which!
|
|
|
Pull requests welcome. But there really aren't many cases to test. It's also fuzz tested and IIRC some functional tests too.
That's in my TODO list (already have 1 issue that turned into a PR for a tiny fix), but first I'll have to go through all tests and familiarize myself more with core's code. Another issue is core being in c++ and me not knowing anything about the language.
|
|
|
I've traced it all the way to this line: https://github.com/bitcoin/bitcoin/blob/24f70290642c9c5108d3dc62dbe055f5d1bcff9d/src/script/script.cpp#L278that is called by GetSigOpCount a bunch of lines above this which is called by GetTransactionSigOpCost from tx_verify.cpp And to me it looks like a broken script such as OP_2 OP_DIV 0xff OP_CheckMultiSig
is counted as 20 SigOps. Is my interpretation correct? (Obviously OP_DIV is disabled and 0xff is not an OP at all). PS. SigOpCount tests of core needs a lot more cases, right now they seem to only test the elementary standard scripts only.
|
|
|
It is a privatekey with 51 characters, I lost 12 characters. I lost everything? Short answer is it's impossible to recover this private key since the number of possible keys to check is enormous. You'll need to construct and compute 1,449*10 18 hashes, in comparison current total bitcoin hashrate (the entire bitcoin mining power) is about 100*10 18 and that is hash of a rather fixed input that doesn't have the same additional computation step on each round. That means even if you had all the ASICs operating today and had a way of modifying them to compute the hash you want, you still wouldn't even be able to go through 5% of the cases. On top of that since the number of missing characters is huge, the number of correct results is going to be large and in order to go through all of them there is another bottleneck which is computation of public key and if needed the address to compare with an input (FinderOuter doesn't do that in current version).
PS. I don't want to get your hopes up but there may be a small chance if you have your public key. I still haven't looked into the algorithm (Pollard's kangaroo) but it may be possible if we could get a manageable range of keys from what you already have.
Merging 2 consecutive comments I tried Electrum and Mycelium, both didn't tell me the reason. I didn't use bitaddress because I couldn't run it offline at that moment. I guess the checksum must have failed. The resulting key was the original, with 2 characters added at one place, and further one 1 character added. I was very hopeful at that moment that it would have found the the correct key.
I still haven't been able to find any problem that involves checksum, it appears to be working correctly. However I found another problem while testing. It was due to checksum collision and the fact that second character was missing, it ended up producing a wrong starting byte hence an invalid key. I'm currently refactoring the way reports work and will add more checks before printing result. For now my latest commit is a simple fix that makes the loop continue running (like all the rest of the loops!). The result is that even if it finds an invalid key it still continues running until it searches the entire space so there may be another possible key down the line that is valid. https://github.com/Coding-Enthusiast/FinderOuter/commit/5ed05806c64a7790a8c9c300fe5722809bc7e4ecFor reference the test vector was this: K**M*jGmerYanjeui5SHS7JkmpZ*VipYvB2*JGU1ZxJwYvP98617 result 1 (valid) KwdMAjGmerYanjeui5SHS7JkmpZvVipYvB2LJGU1ZxJwYvP98617 result 2 (invalid) KGZM5jGmerYanjeui5SHS7JkmpZnVipYvB2UJGU1ZxJwYvP98617
|
|
|
Assuming the "txn file" was created by Electrum and the transaction is unsigned you may want to look here: https://bitcointalk.org/index.php?topic=5082785.0 There are both privacy and security concerns: Privacy: you are revealing your entire list of past, present and future public keys (hence addresses). Security: revealing a single private key from that wallet some day will reveal all your private keys.
|
|
|
Version 0.2.0 released. - New BIP: Passphrase protected private key (BIP-38)
- New hash algorithm: Murmur3
- Improve Address and Signature classes
- Various code improvements and additional tests
|
|
|
BIP151. A bit off topic I guess.
It is marked as withdrawn. I haven't seen any project that uses this proposal. If I can find any, I would implement it.
|
|
|
Beyond encrypting wallet data, I don't think there is much use of encryption in Bitcoin.
Another major usage is for physical backups and cold storage where users print their keys or master keys. Those backups also must be encrypted for extra security. BIP38 comes in here but there is no standard for encrypting extended keys or mnemonics which is what nearly all wallets use these days. BIP-39 doesn't use encryption but it specifies an optional passphrase for the key derivation.
That can't be categorized as encryption though. Lightning uses encryption.
That is in my to-do list. Hopefully I can implement that too by the end of this year.
|
|
|
I'm implementing encryption proposals in Bitcoin.Net but I've only been able to find BIP38. So I was wondering if there are anything else (doesn't have to be a BIP), maybe something that covers encryption used for mnemonics.
|
|
|
If you want to focus on bitcoin then there really isn't that much to learn about P2P protocol. It has two pretty simple parts: - the handling of sockets which can be done by the framework or any library out there (eg. since you mentioned VB, the .Net framework/core has TCP clients that is a wrapper around sockets and make it easy to use) - parsing, handling and responding to received message buffers
If you want to learn more and don't use wrappers or libraries and focus on Sockets directly then you'll have to look elsewhere since it is not bitcoin related anymore. Start from creating a server-less messenger app. I see on your GitHub account you have a similar project, work on that first.
The important topics in bitcoin are 1) blockchain (blocks, transactions and scripts) and 2) cryptography (hash algorithms, elliptic curve cryptography)
|
|
|
As I'll be adding some experimental ideas to Bitcoin.Net library I'll also share them here with more details and rationals for discussion. The first one is replacing Base-58 with Bech-32 encoding Direct link to the code: https://github.com/Autarkysoft/Denovo/blob/master/Src/Autarkysoft.Bitcoin/Experimental/Bech32PrivateKey.cs Here is an example with a random key: Original WIF (Base-58): L28Peud5cQcijrtMthAdUS8FynpM8PKZtnoUZb1VAio9WxKoebHt Key bytes (Base-16): 92734fe879f662ff8ee4eb87dd019425e2ee73ff3edd0c4dc3def2f71e1a6a69 Version byte (ie. the script type): 0x02 or P2WPKH Date UTC: 5/4/2020 7:11:05 AM H.R.P.: bprv New encoding (versioned Bech-32): bprv1zjfe5l6re7e30lrhyawra6qv5yh3wuull8mwscnwrmme0w8s6df5sns90tcqqzyen4e
Note that key is encoded the same way an address would be encoded (version byte is added separately as a 5-bit value instead of 8-bit). If you know of any work done similar to this idea please post it here. I'm addressing some of the problems with current encoding of private keys: 1) Using Bech32 encoding instead of Base58 While writing a private key recovery tool I've felt how hard it is to come up with an optimized algorithm to recover a key that is missing a couple of characters (eg. a damaged paper wallet). That is not true with Bech32 being a multiply of base-2 algorithm is inherently faster, and the checksum is not a bottleneck since it is not a hash algorithm. Bech32 also has the benefit of having error detection. 2) Script (address) typeCurrently when a user imports/sweeps a private key in a wallet client, that client either has to explicitly ask user for the script type (like Electrum) which means user is exposed to complications and has to be familiar with script types; or the wallet has to construct all script types and scan the blockchain for all of them (like bitcoin core) which adds more burden on the client. If the encoding included a script type that becomes so much easier. 3) Locktime!Another burden on both clients and users (specially full node users) is the time consuming need for a re-scan of the entire blockchain to find the historical transactions that belong to an imported key. A timestamp can make that process a lot shorter. Using locktime (similar to last 4 bytes of any transaction) the key string (aka WIF) could include either a block height or a date-time value of when the key was created.
|
|
|
Major Updates (see commits on github for details)- [2020-01-01] Project started (Happy New Year!)
- [2020-05-02] v 0.1.0 initial release.
- [2020-05-16] v 0.2.0 with a new BIP and hash algorithm.
- [2020-05-27] v 0.3.0 with a new BIP, Transaction signing and Script improvements.
- [2020-06-23] v 0.4.0 with a new BIP, New hash algorithm, new miner and P2PNetwork improvements.
- [2020-07-14] v 0.4.1 with a new BIP, optimization, improvement and bug fixes in P2PNetwork namespace.
- [2020-08-06] v 0.4.2 with a new BIP, bug fixes and more improvements in P2PNetwork namespace.
- [2020-09-01] v 0.5.0 with major optimization for verifying transactions and some bug fixes.
- [2020-09-29] v 0.5.1 with more bug fixes and code improvements in P2PNetwork, specifically NodeStatus.
- [2020-10-15] v 0.6.0 finished implementation of everything that doesn't involved IStorage.
- [2020-11-03] v 0.6.1 with small improvements in P2PNetwork.
- [2020-12-09] v 0.7.0 introduces clients and implementations of Blockchain and NodePool.
- [2020-12-22] v 0.8.0 focuses on initial communication and syncing.
- [2021-01-26] v 0.9.0 refactor of initial sync with improvements in Blockchain.
- [2021-03-03] v 0.10.0 initial block sync
- [2021-04-03] v 0.11.0 static encoders and improved cryptography
- [2021-04-23] v 0.12.0 new BIPs and new experimental idea
- [2021-06-08] v 0.13.0 Taproot (BIP-340, 341, 342)
- [2021-08-11] v 0.14.0 improve Address and Scripts for Taproot
- [2021-10-30] v 0.15.0 improve initial sync, cryptography and blockchain classes
- [2021-12-13] v 0.16.0 finished implementing Taproot verification + some breaking changes
- [2022-01-16] v 0.17.0 added MinimalClient
- [2022-03-01] v 0.18.0 a couple of breaking changes to improve the code
- [2022-04-05] v 0.19.0 many fixes in Chain, UtxoDb, ... involving initial sync
- [2022-06-02] v 0.20.0 some breaking changes involving BlockHeader and any class that deals with a 256-bit hash.
- [2022-08-05] v 0.20.0 improve DB and introduce optimized ECC
Full changelog: Bitcoin.Net: https://github.com/Autarkysoft/Denovo/blob/master/Changelog(Bitcoin.Net).md↑
- [2020-01-01] v 0.1.0 Initial release
- [2020-01-20] v 0.2.0 First published binaries with 6 tools
- [2020-03-01] v 0.3.0 From now on Denovo will be published with each Bitcoin.Net version
- [2020-04-05] v 0.4.0 The manual connect to IP is removed
- [2020-06-02] v 0.5.0 Fix UTXO database
- [2020-08-05] v 0.6.0 Add new mock DB
Full changelog: Bitcoin.Net: https://github.com/Autarkysoft/Denovo/blob/master/Changelog(Denovo).md↑
|
|
|
Why would you consider this a bug? Yes, it could have been implemented differently, but the definition of CMS is that signature validation passes N of M times.
I guess because I usually expect certain things to be strict specially when it comes to evaluating scripts. This is not the first time I'm surprised by such rules though.
|
|
|
Thank you for all Coding Enthusiast. But that's very difficult to follow for people who are not involved in IT, I tried all night long to launch FinderOuter but that doesn't work... maybe I am too idiot.
Did you try to build the project from source code and faced difficulties or did you try to run the compiled version (the 27 MB file called v0.1.2.0.zip) and had problems? And please mention the difficulties you encountered explicitly so that I could improve the project and make things easier.
|
|
|
Tiny version update (V. 3.2.1). Fixed some bugs with the APIs and removed the dead ones. Now we have only two and both support Bech32 addresses.
PS. I may continue back-porting features to this project but my focus is going to be on my new project, Denovo, which would eventually be a much more advanced version of this project.
|
|
|
|