Bitcoin Forum
September 23, 2024, 01:47:57 PM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 »
1  Bitcoin / Development & Technical Discussion / Re: Only 2 keys/sec added with importprivkey ? on: April 17, 2013, 04:28:08 PM
Hi John,

btw, thx for your PMs. I had the whole Bitcoin Client on a ramdisk so its not I/O performance which makes it slow.

Expensive seems to be the verification of the imported key plus missing multicore support. Key verification should be optional. Instead to write on each import the client could wait for let say 60 seconds if any more imports are happening or not. If not write to wallet.dat. Keep the new keys in memory, or at least set a buffer limit of 1 MB or so.

For mass import of keys the code logic should be different. Maybe we need a new massimport parameter to handle this situation better.
As a fun test I let it run for some days and had around one million random addresses in the client (wallet.data of ca. 900 MB). Ram usage around 700 MB without any problems. So the basic code is stable to deal with massive addresses, thats good news.

VS2012 with VC or Intel compilers complain about incompatible code. Some sections need to be rewritten.
2  Bitcoin / Development & Technical Discussion / Re: Only 2 keys/sec added with importprivkey ? on: April 13, 2013, 12:36:57 PM
The key verification process should be optional as its time expensive. I am sure that my generated keys are valid, so I just want to import them without checks. To create the DEP key and write it to wallet.dat is not expensive.

To increase import speed I ran multiple importprivkey rpc applications in parallel:

10 parallel apps = crash after 5 min
5 parallell apps = crash after 12 hours but finally CPU usage of bitcoind went up to 50% and import speed was also much faster. Similar to my simulation.

So it seems that bitcoind doesn't like parallel rpc commands and gets a hickup somewhere.

So the perfect solution would be:

- make the code path for importprivkey multithreaded whereever possible (OpenMP or automatic with Intel C++ compilers)
- allow parallel incoming RPC commands. If more RPC commands come in then can be processed save them in a buffer and work them down later or respond with an error code 0 for "busy".

I cannot compile bitcoind on Windows. If oneday there is a working VS2012 project I am happy to help.

3  Bitcoin / Development & Technical Discussion / Re: Only 2 keys/sec added with importprivkey ? on: April 10, 2013, 10:25:40 PM
Using a modded version of the C# Casascius Bitcoin-Address-Utility (https://github.com/casascius/Bitcoin-Address-Utility) I could generate private keys from random passphrases plus their BTC addresses with a speed of 11 keys/s and 50% CPU usage (Intel Dual Core 1.86 Ghz, no HT).

So should be around 20 keys/s with multithreaded code compared to 2.8 Keys/s of bitcoind with its strange 0-1% CPU usage.
4  Bitcoin / Bitcoin Technical Support / Re: Odd importprivkey behavior? on: April 07, 2013, 06:35:30 PM
If a new private key is added it ends up in the address book first. Well, we see only its address.

When the next new block is received and processed that new address is scanned against the new block (transaction list) and the address moves to "receive coins".

Still a rescan is needed if that address has old coins sitting around as without a rescan you will never see them.


5  Bitcoin / Bitcoin Discussion / Why BTC Code sux on: April 04, 2013, 04:02:10 AM
.
6  Bitcoin / Development & Technical Discussion / Re: Only 2 keys/sec added with importprivkey ? on: April 04, 2013, 02:45:42 AM
Hi,

I did that already, quote first post "And yes, I set rescan to false .."

Instead to bug hunt my machine, lets collect your stats.

How fast can you import keys with importprevkey via JSON-RPC plus having the full Bitcoin client on a Ramdisk with whatever 3 GB/s or so of I/O speed ? Lets make a competition to import 10.000 private keys .. Proof that I am wrong to say that the current way the Bitcoin client deals with importprevkey is as stupid as I thought BASIC would change the world in school when I was a tick younger.

I start:

2 Keys/sec .. Intel Dual Core 1.8 Ghz, C# Code - beat this ! Smiley



7  Bitcoin / Development & Technical Discussion / Only 2 keys/sec added with importprivkey ? on: April 03, 2013, 08:52:31 PM
How comes its so slow to add private keys using importprivkey ?

On a Intel Dual Core 1.8Ghz machine where bitcoind is stored on a big ramdisk the total speed is approx 2 keys/second.
CPU is idle at 0-1%, means there is massive time wasted for nothing.

Is it the RPC interface that's so slow ? If the database would work hard it would show in CPU usage. But there is none. To calc the public hashes/addresses etc also is not the limiting factor as it would show up in Task Manager. And yes, I set rescan to false ..

I use C# code, basic example here:

https://bitcointalk.org/index.php?topic=166100.msg1733500#msg1733500

However its the same speed to just call bitcoind via cmd.exe and add the required params for importprivkey. So its not a C# problem.

Something is wrong here ..  Huh

Seems currently the only fast way is to add the keys to wallet.dat directly which is quite a painful task to code under Windows ..

8  Other / Beginners & Help / Re: Pre-generating and using large numbers of addresses seems to be impossible on: April 03, 2013, 08:15:16 PM
How comes its so slow to add private keys using importprivkey ?

On a Intel Dual Core 1.8Ghz machine where bitcoind is stored on a big ramdisk the total speed is approx 2 keys/second.
CPU is idle at 0-1%, means there is massive time wasted for nothing.

Is it the RPC interface that's so slow ? If the database would work hard it would show in CPU usage. But there is none. To calc the public hashes/addresses etc also is not the limiting factor as it would show up in Task Manager. And yes, I set rescan to false ..

 Huh
9  Bitcoin / Development & Technical Discussion / Re: C# JSON-RPC issue with importprivkey on: April 03, 2013, 06:54:53 PM
OK, I answer myself.

Code:
using System;
using System.Text;
using System.Net;

namespace ConsoleApplication1
{
    class Program
    {
        static void SetBasicAuthHeader(WebRequest request, String userName, String userPassword)
        {
            string authInfo = userName + ":" + userPassword;
            authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
            request.Headers["Authorization"] = "Basic " + authInfo;
        }
        
        static void Main(string[] args)
        {
            string postData = "{\"jsonrpc\": \"1.0\", \"id\":\"1\", \"method\": \"importprivkey\", \"params\": [\"5xxxxPRIVATEKEYHERExxxxxxxxxx\", \"NewKeyName\", false] }";
            //string postData = "{\"jsonrpc\":\"1.0\",\"id\":\"1\",\"method\":\"getbalance\"}";

            System.Net.HttpWebRequest request = (System.Net.HttpWebRequest)System.Net.WebRequest.Create("http://10.0.0.30:8332");

            SetBasicAuthHeader(request, "rpc_username", "rpc_password");
            
            request.Method = "POST";
            request.ContentType = "application/json-rpc";    
            request.ContentLength = postData.Length;

            System.IO.Stream writeStream = request.GetRequestStream();
            UTF8Encoding encoding = new UTF8Encoding();
            byte[] bytes = encoding.GetBytes(postData);
            writeStream.Write(bytes, 0, bytes.Length);
            writeStream.Close();
        }
    }
}


SetBasicAuthHeader is needed as bitcoind is not requesting the login infos, we have to push them into it.
I don't like third party dlls, so this solution is clean and simple.
10  Bitcoin / Development & Technical Discussion / C# JSON-RPC issue with importprivkey on: April 03, 2013, 04:15:49 PM
Anyone has a working demo how to use importprivkey with C# for JSON-RPC ?

I tested that command with these C# API projects:

https://github.com/mb300sd/Bitcoin.NET
http://sourceforge.net/projects/bitnet

In both cases the console crashes with an exception:
"The remote server returned an error: (500) Internal Server Error."

GetBalance works in both projects.

Calling bitcoind from cmd.exe using the importprivkey tags works fine.
However I noticed that bitcoind returns nothing when a key is sucessfully added or returns an error message when the key already existed.

So what now ?  Huh

11  Economy / Currency exchange / Re: [WTB] BTC for 3.71 CAD via Moneybookers - Small Order on: October 19, 2012, 03:06:17 PM
bump .. anyone ?  Huh
12  Economy / Currency exchange / [WTB] BTC for 3.71 CAD via Moneybookers - Small Order on: October 17, 2012, 02:58:13 PM
Please send me a PM with the amount of BTC you are willing to transfer and your Moneybookers email and name.

Reason is that the fee is too high to withdraw this little CAD amount so best is to exchange it here.

Thanks !
13  Economy / Securities / How to get BTC back from GLBSCAM ? on: October 07, 2012, 07:54:49 AM
Hello,

Before I started to buy any shares/bonds I sent over BTC to my GLBSE Account coming from my investors. Basically I just sent over a great amount of BTC and wanted to start. Just one day later it went offline. The website now has a message but no contact information. So my BTC investment has been stolen.

So ..

1) What is the process to request a BTC refund ? Means what do I have to send to where to get my BTC back ?

2) What real world data is available about this idiot called Nefario ? Youtube gives me his face but no location. Where is this man ? And who else is responsible for this ? Similar to the Pirate topic regarding family contact information my investors will apply legal and cultural laws of my country to fix this situation.

To loose your investment doesn't mean you have no funds left to recover it.

Увидимся.

PM's with helpful information may be rewarded.
14  Other / Off-topic / Re: Let's talk about how hot Asian girls are. on: October 05, 2012, 02:42:06 AM
Way to many asian girl dreamers here ..  Kiss
15  Economy / Trading Discussion / marketscry.info down forever ? on: August 17, 2012, 07:13:15 PM
Hi

anyone knows whats up with marketscry.info ?
I need theirs Litecoin charts ..  Undecided
16  Bitcoin / Bitcoin Discussion / Scam website: mtgix.com on: August 06, 2012, 05:32:18 AM
Hi

I just saw this website sells Bitcoins, can it be trusted ? I found no discussion about it here.



mod edit: edited out the scam site
17  Economy / Trading Discussion / Re: C++/CLI Library for BTC-E.com Trade API on: August 06, 2012, 04:53:02 AM
Thx  Grin
18  Economy / Trading Discussion / C++/CLI Library for BTC-E.com Trade API on: August 06, 2012, 04:46:02 AM
http://pastebin.com/YvxmCRL9

Use:

Quote
#include "btc-e_api.h"

using namespace System;

int main(array<System::String ^> ^args)
{
    String^ api_key    = "***";
    String^ api_secret = "***";
   
    BTCEBOT::btc_e_api::Init(api_key, api_secret);
   
    String^ info = BTCEBOT::btc_e_api::Check();
   
    Console::WriteLine("Result: " + info);

    return 0;
}
19  Alternate cryptocurrencies / Altcoin Discussion / Re: Trade API btc-e.com on: August 04, 2012, 02:35:50 AM
Any idea ?  Undecided

https://bitcointalk.org/index.php?topic=40889.msg1077256#msg1077256
20  Economy / Exchanges / Re: BTC-E.com exchange Bitcoin, Litecoin, Namecoin <-> USD\BTC (fee 0.2%) on: August 04, 2012, 01:58:02 AM
Anyone got the API to work with C++ or C# ?

I get this result:

{"success":0,"error":"invalid nonce parameter"}  Huh


Code:
        private void button1_Click(object sender, EventArgs e)
        {
           
        NameValueCollection query = new NameValueCollection();

        string apikey = "*****";
        string secret = "*****";

        HttpWebRequest req = (HttpWebRequest)WebRequest.Create("https://btc-e.com/tapi");
        req.Method = "POST";

        query.Add("nonce", "100"); // INCREASE BY 1 ON NEXT CALL
        query.Add("method", "getInfo");
       
        String post_data = "";
        for (int i = 0; i < query.Count; i++)
        {
            post_data += "&";
            post_data += query.Keys[i];
            post_data += "=";
            post_data += query[i];
        }
        post_data = post_data.Substring(1);
        richTextBox1.AppendText(post_data); // CHECKIN POST DATA
     
        HMACSHA512 hmac = new HMACSHA512(Convert.FromBase64String(secret));
        String sign = Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(post_data)), Base64FormattingOptions.None);

        req.Headers.Add("Key", apikey);
        req.Headers.Add("Sign", sign);

        req.UserAgent = "PoorGirl";
        req.ContentType = "application/x-www-form-urlencoded";

        StreamWriter reqStream = new StreamWriter(req.GetRequestStream());
        reqStream.Write(post_data);
        reqStream.Close();

        HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

        StreamReader respStream = new StreamReader(resp.GetResponseStream());
        richTextBox1.AppendText(respStream.ReadToEnd()); // SHOW RESPONSE
        respStream.Close();
           
        }

Pages: [1] 2 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!