Is there a version of bitcoin compiled in Xojo by chance? If not, I was thinking of copying the code line by line to the Xojo equivalent. Was curious if anyone else might be interested in this if I did that? I might even code my own version from scratch using the bitcoin theory in mind.
The reason is compiling is extremely difficult in the current versions of bitcoin (requiring extensive knowledge of libraries and use of a ridiculous amount of libraries via macports etc), and xojo would make one code base for easy cross compile. It would also make it easier for the community to add to it.
I doubt something like this has been done with Xojo. Also, cryptocurrency clients have to be fast, very fast, that’s why all the clients are made in C++. Coding it with Xojo would break a lot of things, and the speed would go down. Yeah, you could have plugins for the cpu intensive parts, but, that kinda complicates things.
Oh and, the codebase of the bitcoin client is huge, not something you would be able to convert to Xojo easily.
[quote=143694:@Ashot Khachatryan]I doubt something like this has been done with Xojo. Also, cryptocurrency clients have to be fast, very fast, that’s why all the clients are made in C++. Coding it with Xojo would break a lot of things, and the speed would go down. Yeah, you could have plugins for the cpu intensive parts, but, that kinda complicates things.
Oh and, the codebase of the bitcoin client is huge, not something you would be able to convert to Xojo easily.[/quote]
Maybe using a dynamic library or a plugin would be an option. After all, C++ should not be too difficult to wrap, then made available at least for Mac and Windows. I have never tried that for Linux, but I know Christian has plugins for it, so it can probably be done.
Which part requires a lot of CPU speed? I’ve studied the bitcoin block chain algorithm, from my understanding it involves hashing algorithms which should be pretty fast and database tables from my understanding, although the peer to peer network part I’m not sure on, but I assume that involves more network than cpu speed.
I’m naive about bitcoins but did a little searching yesterday and get the impression the mining aspect is CPU intensive.
Hashes of a block are easy to make, but for some reason I’m not completely clear on, there’s an arbitrary requirement added to the hash pattern so that it’s NOT easy. Not sure of the specifics, what I read mentioned the hash must start with 8 zeros. What happens is there’s an unused part of the block called a ‘nonce’ which can be randomized and rehashed. So when a miner gets a block she tries a bunch of nonce values until a hash comes out with the right pattern and then this can be published.
If I understand this right, it’s the first miner to publish a proper hash that earns bitcoin credits for the task. So the faster a miner can generate these hashes the more likely she is to win.
There’s pictures at the bottom of this page of various dedicated mining rigs, apparently optimized for extreme speed.
If you’re not mining then I don’t know if there’s something else that’s CPU intensive. Again I’m naive about this, but curious, and happy to be corrected/informed.
[quote=143688:@Joe Astrahan]Is there a version of bitcoin compiled in Xojo by chance? If not, I was thinking of copying the code line by line to the Xojo equivalent. Was curious if anyone else might be interested in this if I did that? I might even code my own version from scratch using the bitcoin theory in mind.
The reason is compiling is extremely difficult in the current versions of bitcoin (requiring extensive knowledge of libraries and use of a ridiculous amount of libraries via macports etc), and xojo would make one code base for easy cross compile. It would also make it easier for the community to add to it.[/quote]
I know the post is relatively old, still it’s a thing of the future.
I will be amazed if this community was active in blockchain tech. It’s possible to do such thing in xojo, and speed is probably one thing but there are other ways to get good results once you know how the backend works.
There are a few things;
The transactions
the blocks holding the transactions
the p2p setup
the blockchain storage
the hashing types
the mining (confirming of the transactions or blocks).
the UI
If probably a few people where willing to help, i’d be glad to maintain a repository for a xojo-based-crypto-coin.
Even better would be to not base it around a coin but around a purpose like software licensing or (xojo script) code within the blockchain.
The entire Bitcoin client could be written in Xojo assuming a few external crypto libraries are used as external DLL/SO/DYLIBs on the various platforms.
The CPU intensive part is the mining - this is done on external dedicated hardware these days and that could be controlled by a Xojo program, it’s just sha256 hashes with a nonce added to the end and if you think of the resulting 256 bit number as an integer (yes - this needs special bignum libraries as well), the integer value needs to be lower than a certain target to be accepted. That’s what the miners are looking for - the lowest number output of an sha256 hash which is below the current ‘difficulty target’.
Also for every new block that comes in through the p2p network all digital signatures for each transaction need verifying which means 1000’s of signature verifications per block - however this is trivial as ECDSA signature verification is pretty simple.
Specifically it uses an elliptic curve known as SECP256K1, the Bitcoin developers have written their own library for this which if my memory serves me correctly is compatible with some older bugs from OpenSSL which are ‘baked into’ the blockchain dating back years so they need to be catered for due to historical reasons.
There’s a load of archaic old and and weird stuff inside Bitcoin, archaic data encoding, variable length integers when there’s really no need for them. It overcomplicates things much more than it’s supposed to.
I believe they use the Qt packages and others that they use is because they were around back in 2008/2009 when Bitcoin was first written, it was started off in C++ and all the tools they use are fully open source.
I’m about to start work on something which will use a p2p network in a very similar way to how Bitcoin works, the network uses something known as a ‘gossip protocol’. This is the first part which I will work on.
is the market in need of a new application to do that ?[/quote]
Here’s a real life example :
A company once wrote a spreadsheet system named ‘Lotus 123’, I used it for a long, long time, well over a decade back in the 90’s until sometime after 2000 but probably before 2010. It was on DOS before they rewrote it for Windows.
It reigned supreme and pretty much every business used it and the suite of applications which were also available under the Lotus brand, there was never any need for anyone to write a new spreadsheet system ever again as everyone used this and it was really very good.
Where is it now ? It’s dead, everyone uses Excel so here we are yet again - there’s no reason for anyone to write another spreadsheet because everyone uses Excel…for now…but someone wrote OpenOffice which contains yet another spreadsheet which is gaining popularity and it’s completely free but I believe that’s the next chapter of the story…
As for Bitcoin clients / wallets / others - we’re just getting started, consider what’s out there right now to be the equivalent of MS-DOS v3.
is the market in need of a new application to do that ?[/quote]
Not stupid, there are like 5000+ altcoins. But the code is hard to understand for non-developers. So to be sure the code is safe people may like to know a bit or two of the source. With Xojo it would be easier to understand the code.
Miners could be done in C++ or Xojo, as most coins add features to make it to hard to fake a blockchain. But it’s still not required. Just premine blocks to about 1000 - 10000 so it’s hard for fake blockchains to even get close. Use the pre-mine value to support the project.