C++ Btcn help

hey guys,
I was wondering if anyone knew how to write a simple programme on bitcoin and how it works, such as hashes, Blockchain, transactions, private keys and puplic keys.
This is more towards the advanced C++ programmers who know about bitcoin and crypto-currency, just give an idea of what you would if You were to write your cryptocurrency
simple programme

+

hashes, Blockchain, transactions, private keys and puplic keys

=
mutex

... this stuff isn't simple. There are libraries and code galore that does the encryption via 2 primes stuff, and the algorithms for the cryptocurrencies is public I think, but its still not something that a short simple wad of code here is going to solve. And, if you plan to mine it via cuda or a Beowulf or some other construct, its even more convoluted.

If I were doing it I would try to find it already done and use that. I would not even remotely try to do this from scratch. I'd try to make it faster, though :)
Last edited on
Did you delete and re-post this question? I thought I responded to this already.

Regarding how it works, read the paper:
https://bitcoin.org/bitcoin.pdf
It assumes basic understanding of cryptography (e.g., what a cryptographic hash is). If you don't know about that, read
https://gpgtools.tenderapp.com/kb/how-to/introduction-to-cryptography

If you are interested in the guts, the reference implementation is a good place to start.
https://github.com/bitcoin/bitcoin
(You're interested in bitcoind.)
Last edited on
sorry I didn't see your response, but thanks for useful info
*the
mbozzi - would it be possible to create a cryptocurrency better than bitcoin, what is your thoughts on how bitcoin can be improved?
Would it be possible to create a cryptocurrency better than bitcoin
Certainly, but having never used it, I can't say how.

What is your thoughts on how bitcoin can be improved?
Not my thoughts, but thoughts nonetheless:
https://github.com/bitcoin/bips

One problem is the storage and bandwidth requirement for initial setup of full nodes. According to the documentation, a computer looking to participate needs to download the entire blockchain ledger, at ~150GB in size, and growing.
Last edited on
If you could actually hold it in your hand and spend it without a hassle, it would be better lol. Its getting better, but its still about useless at most stores. You want to improve it, get it accepted by mainstream methods for spending -- a bitcard debit card like thing, perhaps. (if this has been done, forgive me, I havent kept track of it, last time I dabbled in the stuff all you could do with it was trade it on some rather seedy websites for some rather questionable services).

Algorithm improvement, its really just a rehash of some things that are well studied already. I think you would have to understand all the theory and work behind encryption methods very well if you wanted to make any adjustments there. If you did some other type of problem that was not prime factor driven, that would be interesting, but it would have to be as hard or harder to crack and proving that for acceptance would be an uphill struggle.

Last edited on
If you could actually hold it in your hand and spend it without a hassle, it would be better lol. Its getting better, but its still about useless at most stores.
"Most stores"? I have personally never encountered a single store that accepts any form of cryptocurrency.
Can you imagine going to the supermarket and waiting there for an hour for your payment to even be included in a block? Steam has dropped BTC support because of the insane tx processing delays (unless you're willing to pay 20-100 USD per transaction).

If you did some other type of problem that was not prime factor driven
None of the major cryptocurrencies, certainly none that I know of, are based on RSA. All of them use elliptic curve cryptography to sign and verify transactions.
I thought elliptic curves were tied to prime number theory in the same root ways, though? I am not sure, I dabbled, got to the point where the math was way past my level, and put it aside. All I remember about it was that there was a time when the curves were looking to be promising for a way to do the factorization.
Last edited on
You're talking about this: https://en.wikipedia.org/wiki/Lenstra_elliptic-curve_factorization
Elliptic curve cryptography doesn't use prime numbers, though.
For elliptic-curve-based protocols, it is assumed that finding the discrete logarithm of a random elliptic curve element with respect to a publicly known base point is infeasible: this is the "elliptic curve discrete logarithm problem" (ECDLP). The security of elliptic curve cryptography depends on the ability to compute a point multiplication and the inability to compute the multiplicand given the original and product points. The size of the elliptic curve determines the difficulty of the problem.
They are different, but nonetheless you can compare them in their applications. They can both be used for key exchange, using the Diffie-Hellman protocol, and for signing.

The Diffie-Hellman problem states that "Given an element g and the values of gx and gy, what is the value of gxy".

gxy acts as a shared secret that is used to make the key. In an elliptic field, the *,+ operators are defined in a special way, which makes the multiplication in an elliptic field computationally-equivalent to exponentiation. It's actually really cool to read up on elliptic curves, to see how the galois field is formed on the curve and see how the operations are defined graphically and algebraically.
https://youtu.be/F3zzNa42-tQ?t=2m30s

So they both can perform very large exponentiation. The advantage of Elliptic Curve cryptography is that it can use a smaller key size for roughly the same level of security. Hopefully that last sentence isn't too much of an oversimplification.

Elliptic curves and RSA are actually susceptible to quantum computing, but encryptions like AES are thought to be much safer for a post-quantum world.
Last edited on
Topic archived. No new replies allowed.