Android Example [B4X] Blockchain Example - Create Your Own Cryptocurrency (part 1/2)

Blockchain
A digital ledger in which transactions made in bitcoin
or another cryptocurrency are recorded chronologically and publicly.
In more general terms, it’s a public database where new data are stored
in a container called a block and are added to an immutable chain
(hence blockchain) with data added in the past. In the case of Bitcoin
and other cryptocurrencies, these data are groups of transactions.
The data can, of course, be of any type.

Blockchain technology has given rise to new, fully digital currencies
like Bitcoin and Litecoin that aren’t issued or managed by a central authority.
This brings new freedom to individuals who believe that today’s banking systems
are a scam or subject to failure. Blockchain has also revolutionized distributed
computing in the form of technologies like Ethereum, which has introduced
interesting concepts like smart contracts.


Here's a B4X port of the first part of the example found in this page.
https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b
Author: https://medium.com/@aunyks

upload_2017-12-13_21-11-30.png


The example is presented in B4J format, but the code should be compatible with any B4X product.
 

Attachments

  • blockchain example.zip
    2.8 KB · Views: 1,040
Last edited:

tufanv

Expert
Licensed User
Longtime User
I worked with cryptocurrencies with rebuilding clones based on cryptonite and equihash algo, but this is creating from stracth so good ! I am waiting for the part 2 to see how things work better. Great Job.
 

wonder

Expert
Licensed User
Longtime User

tufanv

Expert
Licensed User
Longtime User

wonder

Expert
Licensed User
Longtime User
I have inadvertently created a PoW (proof-of-work) algorithm 2 years ago, it was related to finding strings in random numbers, such as PI.
If I recall, 5 character strings would take ~1-2 minutes to be found. Perhaps that could be a good starting point...

PoW Candidate: https://www.b4x.com/android/forum/threads/its-a-kind-of-magic.70294/
See posts #9 and #10.
 

tufanv

Expert
Licensed User
Longtime User
I have inadvertently created a PoW (proof-of-work) algorithm 2 years ago, it was related to finding strings in random numbers, such as PI.
If I recall, 5 character strings would take ~1-2 minutes to be found. Perhaps that could be a good starting point...

PoW Candidate: https://www.b4x.com/android/forum/threads/its-a-kind-of-magic.70294/
See posts #9 and #10.
Yes that would be , I read the posts they may be implemented. But first of all , data transfer between all remote nodes is important mentioned at part 2 of the tutorial. btw , blockchain tech can be extended to many great things different than a crypto currency.
 

wonder

Expert
Licensed User
Longtime User
Yes that would be , I read the posts they may be implemented. But first of all , data transfer between all remote nodes is important mentioned at part 2 of the tutorial. btw , blockchain tech can be extended to many great things different than a crypto currency.
I fully agree, the dominant technologies in the next 10 years will most likely be blockchain and advanced machine learning. We better climb on board now. :)
 

Germán Arduino

Member
Licensed User
Interesting!

I'm new here and with B4 family of products, sorry if I ask some obvious question, but I tried to load your code and it complain because need jencryption and jbyteconverter. Where I can find these libraries?

Thanks.
 

tufanv

Expert
Licensed User
Longtime User
Interesting!

I'm new here and with B4 family of products, sorry if I ask some obvious question, but I tried to load your code and it complain because need jencryption and jbyteconverter. Where I can find these libraries?

Thanks.
search for encryption library for b4a and byteconverter lib for b4a not b4j.
 
Last edited by a moderator:

tufanv

Expert
Licensed User
Longtime User
Blockchain
A digital ledger in which transactions made in bitcoin
or another cryptocurrency are recorded chronologically and publicly.
In more general terms, it’s a public database where new data are stored
in a container called a block and are added to an immutable chain
(hence blockchain) with data added in the past. In the case of Bitcoin
and other cryptocurrencies, these data are groups of transactions.
The data can, of course, be of any type.

Blockchain technology has given rise to new, fully digital currencies
like Bitcoin and Litecoin that aren’t issued or managed by a central authority.
This brings new freedom to individuals who believe that today’s banking systems
are a scam or subject to failure. Blockchain has also revolutionized distributed
computing in the form of technologies like Ethereum, which has introduced
interesting concepts like smart contracts.


Here's a B4X port of the first part of the example found in this page.
https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b
Author: https://medium.com/@aunyks

View attachment 62739

The example is presented in B4J format, but the code should be compatible with any B4X product.

How is the progress on part 2 ?
 

wonder

Expert
Licensed User
Longtime User
How is the progress on part 2 ?
Hi!! Regarding part 2, I'm designing the network layer in Python. Once done, I'll try to port it into B4X.
If you're into Python, the project is live here: https://xnode.coincry.pt (github link) :)

Network layer goals:
- Decentralized (peer-to-peer)
- Anonymous nodes
- Balanced topology
- Asymmetric encryption for broadcasts (node ---> all nodes)
- End-to-end encryption for direct interactions (node <---> node)

By achieving these goals, changes to the Blockchain can then be broadcast across all over the network.

Part 3 will be dealing with the Proof-of-work.
 

tufanv

Expert
Licensed User
Longtime User
Hi!! Regarding part 2, I'm designing the network layer in Python. Once done, I'll try to port it into B4X.
If you're into Python, the project is live here: https://xnode.coincry.pt (github link) :)

Network layer goals:
- Decentralized (peer-to-peer)
- Anonymous nodes
- Balanced topology
- Asymmetric encryption for broadcasts (node ---> all nodes)
- End-to-end encryption for direct interactions (node <---> node)

By achieving these goals, changes to the Blockchain can then be broadcast across all over the network.

Part 3 will be dealing with the Proof-of-work.
Incredible work. I am not familiar with python unfortunately or else I could help you about this.
 
Top