Bitcoin Forum
June 26, 2024, 11:25:22 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 [2]
21  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 26, 2023, 08:56:42 AM
but I had tweaked the way DPs were found.

Can we have your code?
22  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 25, 2023, 09:56:53 PM


But why you use 01 as starting point?   Roll Eyes Roll Eyes

I already told you:


For sequential private keys there is the NextKey function.

DoubleDirect does, as the name indicates, only the double of P.

Then, if you start from G:

G
P = DoubleDirect(G) :  G -> P = 2G
P = NextKey(P)         :  P -> P+1 = 3G
P = NextKey(P)         :  P -> P+1 = 4G
P = NextKey(P)         :  P -> P+1 = 5G

and so on


If you use 0000000000000000000000000000000000000000000000000000000000000002

as starting point it should work.

You can't compute G+G = 2G with NextKey, what is not clear?


Point Secp256K1::NextKey(Point &key) {
  // Input key must be reduced and different from G
  // in order to use AddDirect
  return AddDirect(key,G);
 }

You are using the NextKey in the only case you can't (and it is clearly written)

Thank you very much. Now I understand, finally Wink It working on CPU fine. Moving on to GPU Smiley

4090 cards have a lot more cache than previous ones.
Looking for changes to fit to cache as much data as possible to speed up kangaroo and prevent memory bottleneck kangaroo have.
23  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 25, 2023, 08:15:19 PM

Hard to tell anything without the results of what your program is spitting out.

What happens when you use NextKey? Give exact examples.

// test 1 (WORKING) returns correct public key and BTC address for 0x01 and 0x02 private keys
privateKey.SetBase16((char*)"0000000000000000000000000000000000000000000000000000000000000001");
point = secp->ComputePublicKey(&privateKey);
std::cout << " (" << secp->GetPublicKeyHex(true, point) << ") [" << secp->GetAddress(P2PKH, true, point) << "]" << std::endl;

privateKey.AddOne();

point = secp->ComputePublicKey(&privateKey);
std::cout << " (" << secp->GetPublicKeyHex(true, point) << ") [" << secp->GetAddress(P2PKH, true, point) << "]" << std::endl;


// test 2 (NOT WORKING) returns correct public key and BTC address for 0x01 private key only
privateKey.SetBase16((char*)"0000000000000000000000000000000000000000000000000000000000000001");
point = secp->ComputePublicKey(&privateKey);
std::cout << " (" << secp->GetPublicKeyHex(true, point) << ") [" << secp->GetAddress(P2PKH, true, point) << "]" << std::endl;

point = secp->NextKey(point);

std::cout << " (" << secp->GetPublicKeyHex(true, point) << ") [" << secp->GetAddress(P2PKH, true, point) << "]" << std::endl;


// test 3 as arulbero suggested (NOT WORKING) returns correct public key and BTC address for 0x01 private key only
privateKey.SetBase16((char*)"0000000000000000000000000000000000000000000000000000000000000001");
Point P(secp->ComputePublicKey(&privateKey));
std::cout << " (" << secp->GetPublicKeyHex(true, secp->ComputePublicKey(&privateKey)) << ") [" << secp->GetAddress(P2PKH, true, secp->ComputePublicKey(&privateKey)) << "]" << std::endl;

P = secp->NextKey(P);   

std::cout << " (" << secp->GetPublicKeyHex(true, P) << ") [" << secp->GetAddress(P2PKH, true, P) << "]" << std::endl;
24  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 25, 2023, 07:42:26 PM
do you set bool reduce = True?

Yes.
I'm using ComputePublicKey() function from vanitysearch project, not from kangaroo project. It do reduction by default at the end of ComputePublicKey() function.
NextKey() function still not working as it should.
25  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 25, 2023, 06:52:39 PM

UPD: 25.12.2023
Actually DoubleDirect() also not working. It starting to calculate wrong keys after some interval. Why this is can happen?
The only function work so far for sequential private keys to public keys is ComputePublicKey().


For sequential private keys there is the NextKey function.

DoubleDirect does, as the name indicates, only the double of P.

Then, if you start from G:

G
P = DoubleDirect(G)  :  G -> P = 2G
P = NextKey(P)         :  P -> P+1 = 3G
P = NextKey(P)         :  P -> P+1 = 4G
P = NextKey(P)         :  P -> P+1 = 5G

and so on


But what if I need to start not from G point...

Int* privateKey = "some random private key";
Point* point;

This is working:
point = secp->ComputePublicKey(&privateKey);
while(1)
{
   privateKey.AddOne();
   point = secp->ComputePublicKey(&privateKey);
}


This is NOT working:
point = secp->ComputePublicKey(&privateKey);
while(1)
{   
   point = secp->NextKey(point);
}

26  Other / Off-topic / Re: scantxoutset example on: December 25, 2023, 12:38:27 PM
No need to rely on any third party blockchain explorers.  Way better privacy!

Yeh. But it very slow to query this rpc call to local bitcoin core. Is any way to improve bitcoin core response time for this type of query? Thanks.
27  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: December 25, 2023, 08:17:50 AM

#66, #67, #68 and so on can be cracked within seconds using Kangaroo. I'm pretty sure there are bots watching those addresses.


Is placing transaction (with transaction fee enough to be included in next block) in the last second before new block will be mined will help?
28  Bitcoin / Bitcoin Discussion / Re: Bitcoin puzzle transaction ~32 BTC prize to who solves it on: December 24, 2023, 09:38:10 PM
That depends which nodes and pools honor that protocol, you could simply be tricked by a pool operator, they could solve the key and include the tx in a block, there are many ways to double spend it. Unless every single node, miner, pool honors the RBF disabled flag. There is no guarantee for your puzzle 66, 67, 68 etc to be safe from looters.

Hello. Can RBF transaction be on different receiver address or only fee can be increased for faster processing, but receiver address should be same as in initial first transaction? Thanks.
29  Other / Off-topic / Re: scantxoutset example on: December 22, 2023, 08:38:04 PM
I have following RPC code. It runs on local fully synced bitcoin core node.
You'll have to be a little more explanatory. Where is this code from? Is it yours? What's the library you're using? Judging by the fact that it's C#, may I suppose it's NBitcoin?

For example for address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa it returns 22.73242908 BTC, instead of correct 72.74245948 BTC.
That particular address is the exception to the rule, because it was rewarded with the 50 non-spendable bitcoins of the genesis block. The correct amount of spendable coins is 22.73242908.

Judging by the code, it gets the total balance by summing the UTXOs. Since the block reward of genesis isn't UTXO, it doesn't count it.

Thanks. Code work ok then. It just a problem with this particular address. A lot needed to know about bitcoin internals. I'm heard first time about '50 non-spendable bitcoins of the genesis block'.
30  Other / Off-topic / Re: scantxoutset example on: December 22, 2023, 08:06:37 PM
Hello.

I have following RPC code. It runs on local fully synced bitcoin core node.

JObject getAddressUtxosResponse = rpcClient.InvokeMethod("scantxoutset", "start", new[] { $"addr({bitcoinAddress})" });
JValue success = (JValue)getAddressUtxosResponse["result"]["success"];
if ((bool)success == true)
{
    // get total balance by total_amount
    JValue total_amount = (JValue)getAddressUtxosResponse["result"]["total_amount"];
    decimal totalBalance = (decimal)total_amount;
}

It return incorrect amount.
For example for address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa it returns 22.73242908 BTC, instead of correct 72.74245948 BTC.
Why this is can happen?
Thanks.
31  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 22, 2023, 07:16:56 PM

Thanks.
DoubleDirect() works, but it only about 10% faster, than do entire private key to public key calculation with ComputePublicKey() function.
Is any faster way possible to do this 'increment private key by 1 and get public key' method?

UPD: 25.12.2023
Actually DoubleDirect() also not working. It starting to calculate wrong keys after some interval. Why this is can happen?
The only function work so far for sequential private keys to public keys is ComputePublicKey().
32  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 22, 2023, 02:20:26 PM
Hello.

Point Secp256K1::NextKey(Point &key) {
  // Input key must be reduced and different from G
  // in order to use AddDirect
  return AddDirect(key,G);
}

Is anybody can explain me why this function in secp256k1.cpp file not work correctly?
As I understand it should return next public key like as increment private key by 1 and compute public key from it.
What is reduced public key?

Thanks.
33  Bitcoin / Bitcoin Discussion / Re: == Bitcoin challenge transaction: ~1000 BTC total bounty to solvers! ==UPDATED== on: December 17, 2023, 07:08:32 AM
Those are tests with KeyHunterGPU; Rotor has some flaws in it, especially if using the continue option. I stopped using/testing all versions of Rotor after I discovered a bug with the continue option, because it was causing keys to be skipped.

Hello. What is continue option? What bug exactly? Also, can somebody explain me what maxFound option is and how it used in code? Thanks.
The continue option was an option in rotorcuda that would save how many keys searched and grid size and readjust the range on a restart.
It had flaws, as in sometimes it would not adjust correctly, or the total keys searched line would be blank.

The maxFound option was the max keys the program could find in a single kernel call. I don't remember that being in keyhuntcuda or rotorcuda but more of the vanitysearch/forks of vanitysearch.

Thanks. I had some thoughts about this program optimization also.

1. It uses global device memory access even if searching by one key. Why it can't fit searched bitcoin address ripemd160 hash, public key incremental function and ripemd160(sha256) functions in cache?
2. As I understand it executes kernel from cpu thread several times on range. Why don't do it just one time for entire range supplied to kernel.
3. ripemd160(sha256) using Tensor cores?
34  Bitcoin / Bitcoin Discussion / Re: == Bitcoin challenge transaction: ~1000 BTC total bounty to solvers! ==UPDATED== on: December 16, 2023, 10:18:51 PM
Those are tests with KeyHunterGPU; Rotor has some flaws in it, especially if using the continue option. I stopped using/testing all versions of Rotor after I discovered a bug with the continue option, because it was causing keys to be skipped.

Hello. What is continue option? What bug exactly? Also, can somebody explain me what maxFound option is and how it used in code? Thanks.
35  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 14, 2023, 10:09:26 AM
--snip--
Yes. I tried all possible grid size combinations. Also, I tried to compile on latest cuda version using more recent compute_89 shader model. Same result. The maximum I have on 4090 is about 2500 MK/s. On 3090 is 2200 MK/s. 4090 should be faster. Looks like Kangaroo need some optimization for large number of cores 4090 have. Any ideas where this optimization can be made? Thanks.

I see. While i have no idea which optimization can be done, you might want to try fork of this software or implementation written by different people. Here are few example,
https://github.com/ZenulAbidin/Kangaroo-256
https://github.com/PawelGorny/Kangaroo
https://github.com/secoc/Pollard-Rho-kangaroo

P.S. i haven't tried any of those.

After some tests I found that memory speed is an issue. It GPU memory bound, not GPU chip. This is why it can't scale well for more GPU cores.
36  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 11, 2023, 01:53:58 PM
Hello. What parameters or something to change in the code to speed-up this program on 4090 card? It only 1.2 times faster than on 3090 card, but it should be about 1.9 times faster. Thanks.

After searching for all post in this thread[1] and github repository[2], it looks like you're first person who mention "4090" or any RTX 4000 series. And while it's obvious, have you tried all guidance on github repository. For example,

-g g1x,g1y,g2x,g2y,...: Specify GPU(s) kernel gridsize, default is 2*(MP),2*(Core/MP)

Powerfull GPUs with large number of cores won't be very efficient on small range, you can try to decrease the grid size in order to have less kangaroos but the GPU performance may not be optimal

[1] https://ninjastic.space/search?content=4090&topic_id=5244940
[2] https://github.com/search?q=repo%3AJeanLucPons%2FKangaroo%204090&type=issues

Yes. I tried all possible grid size combinations. Also, I tried to compile on latest cuda version using more recent compute_89 shader model. Same result. The maximum I have on 4090 is about 2500 MK/s. On 3090 is 2200 MK/s. 4090 should be faster. Looks like Kangaroo need some optimization for large number of cores 4090 have. Any ideas where this optimization can be made? Thanks.
37  Bitcoin / Development & Technical Discussion / Re: Pollard's kangaroo ECDLP solver on: December 11, 2023, 10:08:43 AM
Hello. What parameters or something to change in the code to speed-up this program on 4090 card? It only 1.2 times faster than on 3090 card, but it should be about 1.9 times faster. Thanks.
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!