Bitcoin Forum
May 08, 2024, 07:15:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Address Generation?  (Read 1015 times)
creepyjas (OP)
Sr. Member
****
Offline Offline

Activity: 854
Merit: 272


View Profile
March 20, 2017, 03:42:37 AM
Last edit: March 20, 2017, 04:28:33 AM by creepyjas
 #1

I am not sure if I am on the right sub forum for this.

I am planning to create a website that could generate a web bitcoin wallet. The problem is, I don't know where to start.
1. How do I generate a bitcoin wallet address?
2. How do I know if it's a valid address?
3. Can I use a website, like bitaddress.org to the job for me?
4. What else do I need to know about building a website that generates bitcoin wallets?

This sounds like a big project for me, but I am testing my skills.
1715152532
Hero Member
*
Offline Offline

Posts: 1715152532

View Profile Personal Message (Offline)

Ignore
1715152532
Reply with quote  #2

1715152532
Report to moderator
1715152532
Hero Member
*
Offline Offline

Posts: 1715152532

View Profile Personal Message (Offline)

Ignore
1715152532
Reply with quote  #2

1715152532
Report to moderator
1715152532
Hero Member
*
Offline Offline

Posts: 1715152532

View Profile Personal Message (Offline)

Ignore
1715152532
Reply with quote  #2

1715152532
Report to moderator
Remember that Bitcoin is still beta software. Don't put all of your money into BTC!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715152532
Hero Member
*
Offline Offline

Posts: 1715152532

View Profile Personal Message (Offline)

Ignore
1715152532
Reply with quote  #2

1715152532
Report to moderator
achow101
Staff
Legendary
*
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
March 20, 2017, 04:11:33 AM
 #2

I am not sure if I am on the right sub forum for this.

I am planning to create a website that could generate a web bitcoin wallet. The problem is, I don't know where to start.
Then you probably shouldn't be creating a web wallet since you will be in control of people's money.

1. How do I generate a bitcoin wallet address?
Generate a 256-bit ECDSA private key. Derive the ECDSA public key from that private key. Hash the public key with SHA256. Hash the SHA256 hash with RIPEMD160. The resulting hash is called the hash160. Prepend the hash160 with a 0x00 byte. Hash the that with SHA256, and hash that hash again with SHA256. Take the first four bytes of the resulting hash and stick it onto the end of the modified hash160. Encode the result with Base58. Note that Bitcoin uses a slightly different Base58 encoding than the normal Base58 conversion.

See https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses for more details and an example.

2. How do I know if it's a valid address?
When you decode the Base58 address, hash everything but the last 4 bytes twice with SHA256. Then compare the first 4 bytes of the hash to the last 4 bytes of the Base58 decoded address. If they match, the address is valid.

3. Can I use a website, like bitaddress.org to the job for me?
Yes, but you probably want to have something that happens on your server instead of someone else's.

4. What else do I need to know about building a website that generates bitcoin wallets?
You need to know how ECDSA works. If you are planning on making a fully fledged web wallet, you will need to know how transaction signing works, how transactions are serialized, how to calculate proper transaction fees, how to handle double spends, how to handle transaction malleability, among a ton of other things. If you are asking these kinds of questions, I advise you to first study existing wallet software and how they work before you even consider making your own.

creepyjas (OP)
Sr. Member
****
Offline Offline

Activity: 854
Merit: 272


View Profile
March 20, 2017, 04:28:19 AM
 #3

I am not sure if I am on the right sub forum for this.

I am planning to create a website that could generate a web bitcoin wallet. The problem is, I don't know where to start.
Then you probably shouldn't be creating a web wallet since you will be in control of people's money.

1. How do I generate a bitcoin wallet address?
Generate a 256-bit ECDSA private key. Derive the ECDSA public key from that private key. Hash the public key with SHA256. Hash the SHA256 hash with RIPEMD160. The resulting hash is called the hash160. Prepend the hash160 with a 0x00 byte. Hash the that with SHA256, and hash that hash again with SHA256. Take the first four bytes of the resulting hash and stick it onto the end of the modified hash160. Encode the result with Base58. Note that Bitcoin uses a slightly different Base58 encoding than the normal Base58 conversion.

See https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses for more details and an example.

2. How do I know if it's a valid address?
When you decode the Base58 address, hash everything but the last 4 bytes twice with SHA256. Then compare the first 4 bytes of the hash to the last 4 bytes of the Base58 decoded address. If they match, the address is valid.

3. Can I use a website, like bitaddress.org to the job for me?
Yes, but you probably want to have something that happens on your server instead of someone else's.

4. What else do I need to know about building a website that generates bitcoin wallets?
You need to know how ECDSA works. If you are planning on making a fully fledged web wallet, you will need to know how transaction signing works, how transactions are serialized, how to calculate proper transaction fees, how to handle double spends, how to handle transaction malleability, among a ton of other things. If you are asking these kinds of questions, I advise you to first study existing wallet software and how they work before you even consider making your own.

Thanks for answering my questions. I am now locking this thread. I am going to take it from here. Thanks again!
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!