Bitcoin Forum
August 19, 2019, 01:36:40 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Address Generation?  (Read 968 times)
creepyjas
Sr. Member
****
Offline Offline

Activity: 574
Merit: 250


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.

        ▄▄▀▀▀▀▀▀▀▀▀▄▄
     ▀▀ ▄▄▀▀▀▀▀▀▀▄▄ ▀▀▄
  ▄  ▄▀▀           ▀▀  ▀▄
 ▄▀ █      ▐█ █▌      █ ▀▄
▄█ █     ▄███████▄     █ █▄
█ ▄▀    ██▀▐█ █▌▀██     █ █
█ █     ██ ▐█ █▌ ██     █ █
█ ▀▄    ██▄▐█ █▌███    ▄▀ █
▀█ █     ▀████████▄    █ █▀
 ▀▄ ▀      ▐█ █▌ ▀█▌  █ ▄▀
  ▀▄  ▀▄           ▄▄▀  ▀
    ▀▄▄ ▀▀▄▄▄▄▄▄▄▀▀ ▄▄
       ▀▀▄▄▄▄▄▄▄▄▄▀▀
      █▀▀▀▀▀▀▀▀▀▀▀▀█
▄▄▄▀▀▀█   ▄▄▄▄▄▄   █
█     █ ▄▀      ▀▄ █
 █  ▄██ █        █ █
 █  █ █ █        ▀ █
  █ █ █ █ ▄█▄█▄  ▀ █
  █  ██ █  █▄▄█▄ █ █
   █ ██ ▄ ▄█▄▄▄█ █ █
   █  █ ▄  ▀ ▀   █ █
    █ █ █        █ █
    █ █ ▀▄      ▄▀ █
     ██   ▀▀▀▀▀▀   █
      █▄▄▄▄▄▄▄▄▄▄▄▄█
PLATINUM STABLECOINS
USDQ KRWQ CNYQ JPYQ

───────────────────────
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
█              █
█              █
█              █
█              █
█              █
█              █
█              █
█              █
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
█     ████     █
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀
██████
██
██







██
██
██████
██████
██
██







██
██
██████
▬▬▬▬▬▬▬▬   WHITEPAPER   ▬▬▬▬▬▬▬▬
FACEBOOK         TWITTER         TELEGRAM
▬▬▬▬▬▬▬▬   ANN THREAD   ▬▬▬▬▬▬▬▬
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
achow101
Staff
Legendary
*
Offline Offline

Activity: 1862
Merit: 2645


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


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
Sr. Member
****
Offline Offline

Activity: 574
Merit: 250


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!

        ▄▄▀▀▀▀▀▀▀▀▀▄▄
     ▀▀ ▄▄▀▀▀▀▀▀▀▄▄ ▀▀▄
  ▄  ▄▀▀           ▀▀  ▀▄
 ▄▀ █      ▐█ █▌      █ ▀▄
▄█ █     ▄███████▄     █ █▄
█ ▄▀    ██▀▐█ █▌▀██     █ █
█ █     ██ ▐█ █▌ ██     █ █
█ ▀▄    ██▄▐█ █▌███    ▄▀ █
▀█ █     ▀████████▄    █ █▀
 ▀▄ ▀      ▐█ █▌ ▀█▌  █ ▄▀
  ▀▄  ▀▄           ▄▄▀  ▀
    ▀▄▄ ▀▀▄▄▄▄▄▄▄▀▀ ▄▄
       ▀▀▄▄▄▄▄▄▄▄▄▀▀
      █▀▀▀▀▀▀▀▀▀▀▀▀█
▄▄▄▀▀▀█   ▄▄▄▄▄▄   █
█     █ ▄▀      ▀▄ █
 █  ▄██ █        █ █
 █  █ █ █        ▀ █
  █ █ █ █ ▄█▄█▄  ▀ █
  █  ██ █  █▄▄█▄ █ █
   █ ██ ▄ ▄█▄▄▄█ █ █
   █  █ ▄  ▀ ▀   █ █
    █ █ █        █ █
    █ █ ▀▄      ▄▀ █
     ██   ▀▀▀▀▀▀   █
      █▄▄▄▄▄▄▄▄▄▄▄▄█
PLATINUM STABLECOINS
USDQ KRWQ CNYQ JPYQ

───────────────────────
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█▄▄▄▄▄▄▄▄▄▄▄▄▄▄█
█              █
█              █
█              █
█              █
█              █
█              █
█              █
█              █
█▀▀▀▀▀▀▀▀▀▀▀▀▀▀█
█     ████     █
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀
██████
██
██







██
██
██████
██████
██
██







██
██
██████
▬▬▬▬▬▬▬▬   WHITEPAPER   ▬▬▬▬▬▬▬▬
FACEBOOK         TWITTER         TELEGRAM
▬▬▬▬▬▬▬▬   ANN THREAD   ▬▬▬▬▬▬▬▬
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!