XDS Lesson: Cryptomining with Xojo

As requested, I have implemented a cryptocurrency manager, including miner, block-chain server, and custom wallet, created entirely in Xojo for mining crypto-currency (This demo will mine for Monero).

The lesson that is being composed for the XDS community currently includes:

-What is cryptocurrency, how is it made, why does it have value, what are the differences between cryptocurrencies, how blockchains ensure security & prevent changes to transactions, and how everything code-wise works.
-Developing a miner (as a Class for reuse in Console, Desktop, & Web)
-Developing a working blockchain P2P server
-Creating a password protected database crypto-currency wallet & storing/retrieving/sending currency using wallet/transaction ID

Any other suggestions to include in the lesson are welcome!

There is a miner (40 of them actually [1 embedded in the web application, 39 consoles]) running at

http://167.160.185.150:8030/

~Generates about $140USD every 5-7 days. Hash counts reset at midnight EST.

Notice: **The exchange has not been integrated in the online demo, so using the calculations will not be correct **

Awsome dude.

Where can it be found ? on the website?

[quote=366433:@Derk Jochems]Awsome dude.

Where can it be found ? on the website?[/quote]

Hey Derk! Hope you had a Merry Christmas!!!

It will be uploaded to the website as soon as all input requests for additional topics have been submitted. I figured I’d ask the community if there’s any subject matter/topics that should be discussed & demonstrated before making the lesson live online, in case additional topics alter or tie-in to another area. Rather than jump around from topic to topic and back again. Since this one is “deep,” I’d like to maintain a straight flow for the lesson plan, so developers can follow along, and not fall behind. :slight_smile:

So far, I’ve received one request to add “Proof of Work” (See: https://en.wikipedia.org/wiki/Proof-of-work_system), but that’s already implemented.

What’s Included & Ahead:
The second part of lesson 1 will be applying concepts learned to other areas of development. Like, What can a BlockChain be used for, for anything other than cryptocurrency?!? Imagine writing a database application that KNOWS if the database has been altered by anything other than the software itself, and will automatically revert the value to the correct value set by the software interface, if the database record has been tampered. Perfect for accounting, financial software in general, or any other database system that requires a “tattle-tale” if someone or something attempts to alter the information outside a valid “transaction.”

Proof of Work - Using Javascript in a web application as a CAPTCHA to run through CPU cycles client side, to solve a cryptographic function, returning it to the server, and validating the user is “a human.” Prevent spam, prevent unauthorized or GUI-less applications from ‘scraping’ your site (can be applied to standard HTML/PHP/etc) or web application, forcing them to use a GUI, and preventing “automation” systems from interacting with your site/application.

and lots more.

Lesson 2 will include - “Creating the Perfect Cryptocurrency” (code’s already done :-)) -
-Which uses a modified implementation of a blockchain (doesn’t require the entire chain)
-peers validate the chain simultaneously as well as hashes that are accepted
-designated nodes act as exchange/transactional ‘branches’ (Just like going to your local branch of the popular big-chain Bank), which makes transactions instant…just like swiping a credit card. (BitCoin/etc can take hours to days for a transaction to process and be validated.). Transactions are instantly broadcast across all peers, spidering from the processing node, and in a matter of moments a collective yes or collective no is returned, preventing the user from spending that same ‘coin’ in two places. When a coin is processed in a transaction, it is destroyed (keep liquidity in the market!), and the originating server is notified, which then notifies all peers along the route that have ever touched the coin (if you never knew it existed, do you need to know it’s gone?..BitCoin sadly believes so). All coins are instantly replaced with a new one and signed by a “bank server.” (Only authorized ‘bank servers’ can sign coins)… Basically, the first Central-Decentralized bank… a Central bank is needed to “mint” (sign) the “coin” (hash), but after that, the peers handle all transactions in co-habitation with the central bank. If the central bank were to shutdown, a new one could be authorized, or if all central banks shutdown, the currency would be spendable until the last hash/coin has been spent and destroyed with no signed hash to take its place.
-hashes are bashed on a Quantum function based on “collapsing superpositions”, which does not require an advanced CPU/GPU to mine (Current state of affairs is, whoever has the most money to start, can buy the biggest baddest hardware to mine for cryptocurrency…thus keeping the money where the money began. Thus the unspoken corruption that is programmed into BitCoin,etc.) Using a quantum function, at any given moment in time, a raspberry pi could potentially churn out more hashes than the most powerful supercomputer. In other words, just as in the real world, “what is meant to happen, happens.” If we want something real that works without corruption (ie currency), why not base it on how things work in the ‘real world?’ Not manipulated to suit an ‘agenda.’ The following day, that same raspberry pi could churn out no hashes, while the supercomputer churns out a few. Just like mining for REAL gold, using a quantum function, basically means you need “to be in the right place at the right time and space…err place.” :slight_smile: The function intense, to comprehend outside of a machine solving it, and the “mined resources” (hashes) are so scarce (in time), but infinitesimal (in space) in abundance, that it makes the perfect currency. Unlike even BitCoin and REAL gold though, this function is perpetual… a ‘self-renewing resource.’ This is an implementation of currency at its best without bias. You can be rich, you can be poor, but here’s your pickaxe, find yourself a place to mine…and get mining.

A little more than I wished to share at the moment, but that’s where it’s heading and what’s ahead! Just wait it’s awesome :slight_smile: If you have any suggestions of stuff to include let me know before the first!!! I’m trying to have all the lessons that are done, and this one, uploaded before then!

Can I assume you mean XDC in the title? Can’t make it this year, but would love to see the project afterwards.

That is an interesting subject, I cannot make it to XDC but I hope the lessons will be available soon.

[quote=366422:@Matthew Combatti]As requested, I have implemented a cryptocurrency manager, including miner, block-chain server, and custom wallet, created entirely in Xojo for mining crypto-currency (This demo will mine for Monero).

The lesson that is being composed for the XDS community currently includes:

-What is cryptocurrency, how is it made, why does it have value, what are the differences between cryptocurrencies, how blockchains ensure security & prevent changes to transactions, and how everything code-wise works.
-Developing a miner (as a Class for reuse in Console, Desktop, & Web)
-Developing a working blockchain P2P server
-Creating a password protected database crypto-currency wallet & storing/retrieving/sending currency using wallet/transaction ID

Any other suggestions to include in the lesson are welcome!

There is a miner (40 of them actually [1 embedded in the web application, 39 consoles]) running at

http://167.160.185.150:8030/

~Generates about $140USD every 5-7 days. Hash counts reset at midnight EST.[/quote]
It seems that the URL does not work, you cannot see anything on that ip .

No, he doesn’t mean XDC.
XDS stands for his own website, Xojo Developer’s Spot.

Wait longer?
It loads really slow from europe

I’m guessing the web version is going to be the same coinhive miner that’s hiding in a hidden iframe on XDS?

Also, the IP is not accessible.

Took a while from NZ but it did launch.

[quote=366876:@Tim Garrity]I’m guessing the web version is going to be the same coinhive miner that’s hiding in a hidden iframe on XDS?

Also, the IP is not accessible.[/quote]

Huh! Is that for real? I think I’ll give it a miss.

That’s really sucmmy, Matthew. I usually keep quiet about how you disappear for months at a time when people ask about your stuff, but if you leave that there I will actively recommend against people going to your website.

Dudes, come on the miner is on the server side. I don’t think it’s client side javascript. It’s just slow loading.

I’m goin to examine the browser source but i can’t believe it if it’s clients doing the mining

The whole point of the hidden iframe and javascript miners is to offload the computations for mining onto the visitor’s browser. So you visit a website, and your browser starts mining for the person that owns it. This eats up your processor without your permission, and was not the reason you visited the website to begin with.

Malicious people have managed to sneak miners into some major websites without them knowing, Showtime was a victim of this.

Hi Tim,

My antivirus detected the attached photo

Is it the JavaScript miner you mentioned?

Is it this?

Unauthorized Coin Mining in the Browser

https://researchcenter.paloaltonetworks.com/2017/10/unit42-unauthorized-coin-mining-browser/

it’s a demo… If the miner is on the client side (I don’t know anything about it), you can set a password access and send the URL only to clients who want to miner.

Matthew is very generous and a hell of a developer. He has been a major contributor to the Xojo eco-system for a long time. To contact him, it is better to go through his website or email rather than through a third party site. When a developer does volunteer work, freeware, or software without support, you have to accept that sometimes it may not be reachable for weeks or months. If you have purchased support, you can then contact him normally via an appropriate means of communication I suppose.

I agree with you Mr. Oliver.

Matthew gave me techniques and free codes by communicating him directly. :slight_smile:

Yea I’m definitely not disputing that at all about who Matthew is and his abilities, I’m actually really curious about the implementation of Crypto-Algos in pure Xojo or even via a Xojo Plugin coded in C++. So far the best I’ve seen and done personally was just RPC communication. I honestly didn’t mean it to have this post turn out this way, I was more trying to ask if his lesson/implementation was going to be more than the same coinhive that I found running on his site. I do agree with everyone that it’s a bit deceiving, especially since the website’s name has Xojo in the title, it kinda makes it look like Xojo themselves are okay with secretly mining. So I’d recommend against using it myself or at least using a popup of some sort that warns the user and let’s them approve it. But that wasn’t the point of my post. So for what it’s worth, sorry.