Bitcoin Forum
November 08, 2024, 01:48:13 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Need C/C++ code for brain wallet function: any suggestions?  (Read 2273 times)
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
June 04, 2013, 08:55:03 AM
 #1

Hi,
I am looking for C/C++ code for brain wallet function.

What it should look like:
1. C/C++
2. No dependencies, all code should be in that function or its sub-functions. Alternatively I need a sample project for MSVC 2005 or before (I don't have licence for later versions). The reason is simple: I am not good enough with C++ to handle installation of 10 mutually dependent libraries as it usually happens in Unix Smiley

What it should do:
Take ASCII text and produce a private key (the 51 char one, starting with "5").

Technically, this functionality is in pywallet, but it uses Python-specific libraries.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 04, 2013, 09:04:16 AM
 #2

Although it's not hard to find direct source for things like SHA256 (e.g. https://github.com/ciyam/ciyam/blob/master/src/sha256.cpp), and base58 could perhaps be taken from Bitcoin itself (https://github.com/bitcoin/bitcoin/blob/master/src/base58.h), it is going to be a bit more difficult to get the ECDSA stuff working if you are not wanting to use *any* 3rd party libraries.

It's not really that difficult to get OpenSSL integrated (CIYAM Open uses it) so if you don't mind using just the *one* 3rd party library then I would recommend using it to help you to complete your project.

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4816



View Profile
June 04, 2013, 09:09:44 AM
 #3

Hi,
I am looking for C/C++ code for brain wallet function.

What it should do:
Take ASCII text and produce a private key (the 51 char one, starting with "5").

it is going to be a bit more difficult to get the ECDSA stuff working if you are not wanting to use *any* 3rd party libraries.

So the important question is:

Do you just want to generate a private key based on the user chosen text, or do you want the software to also output the bitcoin address?

Generating private key only won't be too bad, but you should really consider using OpenSSL if you want your brain wallet generator to compute the bitcoin address as well.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
June 04, 2013, 09:24:03 AM
 #4

I want the string, that importprivkey will be able to use Smiley

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
June 04, 2013, 09:30:41 AM
 #5

Although it's not hard to find direct source for things like SHA256 (e.g. https://github.com/ciyam/ciyam/blob/master/src/sha256.cpp), and base58 could perhaps be taken from Bitcoin itself (https://github.com/bitcoin/bitcoin/blob/master/src/base58.h), it is going to be a bit more difficult to get the ECDSA stuff working if you are not wanting to use *any* 3rd party libraries.

It's not really that difficult to get OpenSSL integrated (CIYAM Open uses it) so if you don't mind using just the *one* 3rd party library then I would recommend using it to help you to complete your project.


That's why I asked for a sample project, not just a code snippet... It is a large and complex library, and I don't need 99% of it...

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
June 04, 2013, 09:34:23 AM
 #6

That's why I asked for a sample project, not just a code snippet... It is a large and complex library, and I don't need 99% of it...

A sample project that does what (if there were one that did what you are asking for then you wouldn't be *needing* anything at all)?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
genjix
Legendary
*
expert
Offline Offline

Activity: 1232
Merit: 1076


View Profile
June 04, 2013, 09:42:44 AM
 #7

http://libbitcoin.dyne.org/doc/crypto.html#deterministic-wallets

Python bindings too (see main page).
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
June 04, 2013, 09:52:17 AM
 #8

That's why I asked for a sample project, not just a code snippet... It is a large and complex library, and I don't need 99% of it...

A sample project that does what (if there were one that did what you are asking for then you wouldn't be *needing* anything at all)?


Oh, that's os true!

But htanks for the CYAM, I will try to study it.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
June 04, 2013, 09:54:48 AM
 #9


Thanks!

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!