Bitcoin Forum
June 29, 2024, 06:53:38 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Possible to write C offline wallet?  (Read 157 times)
fk1 (OP)
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
December 17, 2017, 08:51:08 AM
 #1

Hey guys,

I just had a nice idea for an offline hardware wallet but I am not sure if this is possible to do so. I googled some time today but I cant answer my own questions. so lets see:

I need to write my code with old C language. afaik bitcoin is written in c++. I cant find good tutorials except one for how to write an own bitcoin wallet. this tutorial is made with c#.

So before I move on with my idea I'd like to find out if it is possible to write a bitcoin wallet, at least the private key generating part, in C.

anybody?
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
December 17, 2017, 09:33:31 AM
Merited by ABCbits (1)
 #2

So before I move on with my idea I'd like to find out if it is possible to write a bitcoin wallet, at least the private key generating part, in C.

Of course. There is no reason why this shouldn't be doable in C. I guess you are planning to use libaries instead of doing this from scratch.
You can use LIBBTC (https://github.com/libbtc/libbtc). But make sure how generation is exactly handled and how entropy is gathered.
And if you want to store larger amounts on your selfwritten wallet, make sure to catch any exceptions and create a testing environment to make sure it works properly in every case.

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3444
Merit: 6722


Just writing some code


View Profile WWW
December 17, 2017, 04:22:31 PM
 #3

The bitcoin consensus rules are language agnostic. You can use whatever language you want, it doesn't have to be C++ (which is what Bitcoin Core, the reference client, uses).

It is certainly possible to write a bitcoin wallet in C. As for how, you will need to figure that out yourself. Keep in mind that if you can't figure it out or are unsure about anything, you probably shouldn't be making a wallet as the code that you make without understanding everything may be more insecure than the code written in an open source project that has been reviewed and audited by many people.

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!