Bitcoin Forum
April 23, 2024, 03:23:00 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it possible to simulate bitcoin address using C#?  (Read 179 times)
Maus0728 (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1552


Bitcoin Casino Est. 2013


View Profile
September 05, 2020, 12:56:19 PM
Merited by DdmrDdmr (2), OmegaStarScream (1), webtricks (1)
 #1

Hey greetings,

I've been slowly reading the book of Andreas Antonopolous and currently reading chapter 4 - keys addresses and recently came across the thread created by @webtricks about How Bitcoin Addresses are generated? Understand the Math behind Bitcoin.

Is it possible to create a similar bitcoin address generation using C# programming language in visual studio from a console? I came across with this idea because I am currently enrolled in an online class and it happens that we're using C# programming language in our subject and also have the willingness to learn how these bitcoin addresses are generated from scratch.

What are the requirements to create similar programming just like what webtricks did before in his project? Any recommended readings?

███▄▀██▄▄
░░▄████▄▀████ ▄▄▄
░░████▄▄▄▄░░█▀▀
███ ██████▄▄▀█▌
░▄░░███▀████
░▐█░░███░██▄▄
░░▄▀░████▄▄▄▀█
░█░▄███▀████ ▐█
▀▄▄███▀▄██▄
░░▄██▌░░██▀
░▐█▀████ ▀██
░░█▌██████ ▀▀██▄
░░▀███
▄▄██▀▄███
▄▄▄████▀▄████▄░░
▀▀█░░▄▄▄▄████░░
▐█▀▄▄█████████
████▀███░░▄░
▄▄██░███░░█▌░
█▀▄▄▄████░▀▄░░
█▌████▀███▄░█░
▄██▄▀███▄▄▀
▀██░░▐██▄░░
██▀████▀█▌░
▄██▀▀██████▐█░░
███▀░░
1713885780
Hero Member
*
Offline Offline

Posts: 1713885780

View Profile Personal Message (Offline)

Ignore
1713885780
Reply with quote  #2

1713885780
Report to moderator
Unlike traditional banking where clients have only a few account numbers, with Bitcoin people can create an unlimited number of accounts (addresses). This can be used to easily track payments, and it improves anonymity.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713885780
Hero Member
*
Offline Offline

Posts: 1713885780

View Profile Personal Message (Offline)

Ignore
1713885780
Reply with quote  #2

1713885780
Report to moderator
hatshepsut93
Legendary
*
Offline Offline

Activity: 2954
Merit: 2144



View Profile
September 05, 2020, 01:06:49 PM
Merited by pooya87 (1), DdmrDdmr (1)
 #2

"Simulate" is not the right word here, you are asking how to generate a real Bitcoin address in C#. You can use any programming language available, they are all capable of doing this task.

Generating Bitcoin address requires cryptographic hash function utilities and elliptic curve utilities, though webtrics implemented some elliptic curve functions from scratch in his example. Generally, it's a bad practice to implement something that has already been done and is freely available in forms of libraries, unless done for educational purposes.

So, the simple approach would be to import all the functions that you need, and just assemble your wallet generation function with them.

You can also look for existing C# implementations of it, for example here.

.BEST.CHANGE..███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
OmegaStarScream
Staff
Legendary
*
Offline Offline

Activity: 3458
Merit: 6099



View Profile
September 05, 2020, 01:10:51 PM
Merited by DdmrDdmr (2), webtricks (1)
 #3

Take a look at NBitcoin's[1] library, you can either call it[2] or check the source code to see how is it done from scratch.

[1] https://github.com/MetacoSA/NBitcoin
[2] https://programmingblockchain.gitbook.io/programmingblockchain/bitcoin_transfer/bitcoin_address

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Maus0728 (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1552


Bitcoin Casino Est. 2013


View Profile
September 05, 2020, 01:29:24 PM
 #4

WOW! Thank you @hatshepsut93 and @OmegaStarScream for recommending some resources. This can significantly help boost my learning curve between the use of C# as well as learning the algorithm involved in this bitcoin generation address.

I'll ask questions here if there are any issues I encountered throughout the process.  Smiley

███▄▀██▄▄
░░▄████▄▀████ ▄▄▄
░░████▄▄▄▄░░█▀▀
███ ██████▄▄▀█▌
░▄░░███▀████
░▐█░░███░██▄▄
░░▄▀░████▄▄▄▀█
░█░▄███▀████ ▐█
▀▄▄███▀▄██▄
░░▄██▌░░██▀
░▐█▀████ ▀██
░░█▌██████ ▀▀██▄
░░▀███
▄▄██▀▄███
▄▄▄████▀▄████▄░░
▀▀█░░▄▄▄▄████░░
▐█▀▄▄█████████
████▀███░░▄░
▄▄██░███░░█▌░
█▀▄▄▄████░▀▄░░
█▌████▀███▄░█░
▄██▄▀███▄▄▀
▀██░░▐██▄░░
██▀████▀█▌░
▄██▀▀██████▐█░░
███▀░░
tbct_mt2
Hero Member
*****
Offline Offline

Activity: 2310
Merit: 835



View Profile WWW
September 05, 2020, 03:39:37 PM
 #5

To get a bitcoin address, you need to have a public key. To have a public key, you need to have a private key. You can not find them in the backward steps.

Private key (Eliptic Curve Multiplication) - Publick Key (Hash Function) - Address
k - K - A (irreversible)
And K = k * G

What you ask is the reverse math of the formula and it is impossible.

You can see the explanation for Eliptic Curve at https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc#elliptic_curve

https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04.asciidoc

.
.airbet.
██
██
██
██
██
██
██
██

██

██

██

██

██
.

▄████▄▄▄██████▄
███████████████
███████████████
███████▀▀▀▀████
██████████████
▀███▀███████▄██
██████████▄███
██████████████
███████████████
███████████████
██████████████
█████▐████████
██████▀███████▀
▄███████████████▄
████████████████
█░██████████████
████████████████
████████████████
█████████████████
█████████████████
███████░█░███████
████████████████
█████████████████
██████████████░█
████████████████
▀███████████████▀
.
.
.
.
██▄▄▄
████████▄▄
██████▀▀████▄
██████▄░░████▄
██████████████
████████░░▀███▌
░████████▄▄████
██████████████▌
███░░░█████████
█████████░░░██▀
░░░███████████▀
██████░░░██▀
░░▀▀███▀

   
6,000+
GAMES
|
WEEKLY
PROMOS
.
....100%....
1ST DEPOSIT
BONUS
....
....125%.....
2ND DEPOSIT
BONUS
██
██
██
██
██
██
██
██

██

██

██

██

██
.
.PLAY NOW.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10495



View Profile
September 06, 2020, 05:01:16 AM
Merited by aliashraf (1)
 #6

What are the requirements to create similar programming just like what webtricks did before in his project? Any recommended readings?

the topic you shared already contains good information for you to read. also if you want to experiment you can "translate" the code in that topic to c# which isn't really that hard to begin with. if you use .Net Framework then you'll have access to RIPEMD160 and SHA256 and the ECC code is in that topic. BigInt becomes BigInteger (found in System.Numerics) and the points such as G have to be defined as a "struct" that contains 2 BigIntegers (x and y).
if you use .Net Core then you won't have RIPEMD160 anymore but you can copy it from any crypto library or even .Net Framework source code itself (link)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
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!