Bitcoin Forum
May 25, 2024, 02:34:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 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 »
261  Bitcoin / Development & Technical Discussion / Re: Bitcoin Address Utility I made (Visual C#, Source Only) on: June 01, 2020, 06:36:37 AM
when doing generate, can one choose comp. or uncomp.
currently it is uncompressed. so hope to have an updatet version
This is just a code snippet here, I don't think OP maintains it. I wouldn't expect an update.
You should try using active projects that can be found on GitHub (https://github.com/search?q=bitcoin+language%3Ac%23).

Feel free to take a look at my project Bitcoin.Net, it is in beta.
Examples of creating some addresses:
Code:
var addrBuilder = new Address();

string p2pkh = addrBuilder.GetP2pkh(pubKey, useCompressed: false, netType: NetworkType.TestNet);
string p2sh = addrBuilder.GetP2sh(script);
string nestedSegWit = addrBuilder.GetP2sh_P2wpkh(pubkey, witVer: 0, netType: NetworkType.MainNet);
https://github.com/Autarkysoft/Denovo/blob/642103ca8e7693c02c1867202c3cc1a8fa31ab50/Src/Autarkysoft.Bitcoin/Encoders/Address.cs
262  Other / Serious discussion / Re: Long shot... but does such an Android wallet app exist ? on: May 29, 2020, 04:37:12 AM
...
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!
263  Bitcoin / Development & Technical Discussion / Re: Does core not-fail on invalid OP codes while counting SigOps? on: May 25, 2020, 06:17:36 AM
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.
264  Bitcoin / Development & Technical Discussion / Does core not-fail on invalid OP codes while counting SigOps? on: May 24, 2020, 01:46:42 PM
I've traced it all the way to this line:
https://github.com/bitcoin/bitcoin/blob/24f70290642c9c5108d3dc62dbe055f5d1bcff9d/src/script/script.cpp#L278
that 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
Code:
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.
265  Bitcoin / Project Development / Re: The FinderOuter, a bitcoin recovery tool (v0.2.0 2020-05-11) on: May 18, 2020, 02:14:29 PM
It is a privatekey with 51 characters, I lost 12 characters. I lost everything? Sad

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*1018 hashes, in comparison current total bitcoin hashrate (the entire bitcoin mining power) is about 100*1018 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/5ed05806c64a7790a8c9c300fe5722809bc7e4ec

For reference the test vector was this:
Code:
K**M*jGmerYanjeui5SHS7JkmpZ*VipYvB2*JGU1ZxJwYvP98617
result 1 (valid)
KwdMAjGmerYanjeui5SHS7JkmpZvVipYvB2LJGU1ZxJwYvP98617
result 2 (invalid)
KGZM5jGmerYanjeui5SHS7JkmpZnVipYvB2UJGU1ZxJwYvP98617
266  Bitcoin / Bitcoin Technical Support / Re: txn file on: May 17, 2020, 01:06:06 PM
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.
267  Bitcoin / Project Development / Re: Denovo (v 0.0.0) and Bitcoin.Net (v 0.2.0) on: May 17, 2020, 03:02:49 AM
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
268  Bitcoin / Project Development / Re: The FinderOuter (v0.2.0 2020-05-11) on: May 11, 2020, 03:35:04 AM
Version 0.2.0 is released.
https://github.com/Coding-Enthusiast/FinderOuter/releases/tag/v0.2.0.0
See changelog for more details.
Most notable changes are:
- Replacing backend with the well tested Bitcoin.Net library which improves performance and fixes some bugs
- Added 2 new features: recovering Base-58 addresses and BIP-38 encrypted keys
- Fix some bugs including a bug that prevented the FinderOuter from running on Ubuntu 20
269  Bitcoin / Development & Technical Discussion / Re: Are there any encryption proposals like BIP38? on: May 07, 2020, 09:30:03 AM
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.
270  Bitcoin / Development & Technical Discussion / Re: Are there any encryption proposals like BIP38? on: May 07, 2020, 08:33:24 AM
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.
271  Bitcoin / Development & Technical Discussion / Are there any encryption proposals like BIP38? on: May 07, 2020, 04:42:40 AM
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.
272  Bitcoin / Project Development / Re: [C#] Watch Only Bitcoin Wallet. Support SegWit and Forks (V3.2.1) on: May 07, 2020, 04:34:11 AM
Could you post the compiled exe?
https://github.com/Coding-Enthusiast/Watch-Only-Bitcoin-Wallet/releases/tag/V3.2.1
273  Other / Beginners & Help / Re: How i can understand P2P? on: May 05, 2020, 05:11:48 AM
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)
274  Bitcoin / Development & Technical Discussion / [Experimental-1] Bech32 encoding of private keys on: May 04, 2020, 10:53:58 AM
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:
Code:
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) type
Currently 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. 


275  Bitcoin / Project Development / Re: Denovo (v 0.0.0) and Bitcoin.Net (v 0.1.0) on: May 04, 2020, 05:24:14 AM
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
276  Bitcoin / Project Development / Re: Address and Wallet Watcher for free with Excel + Blockchair API on: May 04, 2020, 04:55:25 AM
I created a desktop app a couple of years ago to do this, it has been supporting bech32 addresses as soon as I found a block explorer API that supported it (Jan 2018): https://bitcointalk.org/index.php?topic=1616888.0
277  Bitcoin / Development & Technical Discussion / Re: Why does OP_CheckMultiSig not fail on an invalid public key? on: April 22, 2020, 07:42:41 AM
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.
278  Bitcoin / Development & Technical Discussion / Why does OP_CheckMultiSig not fail on an invalid public key? on: April 22, 2020, 06:28:36 AM
Basically this test vector: https://github.com/bitcoin/bitcoin/blob/b6a5dc90bfd4640cf9f914e59bf8e21cd265b51e/src/test/data/tx_valid.json#L185-L188

It is spending a P2SH output with the redeem script of it being:
OP_2 <invalid_pub><Pub><Pub> OP_3 OP_CheckMultiSig
The first push which is supposed to be a public key is an invalid public key (it is a DER encoded signature) and despite that OP_CheckMultiSig passes successfully!
Is this another bug at protocol level? Also is it the same for SegWit scripts?
279  Bitcoin / Project Development / Re: The FinderOuter (v0.1.2 2020-03-10) on: April 22, 2020, 06:18:26 AM
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.
280  Bitcoin / Project Development / Re: [C#] Watch Only Bitcoin Wallet. Support SegWit and Forks (V3.1) on: April 13, 2020, 01:51:44 PM
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.
Pages: « 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 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!