Skip to content
sam-astro edited this page Jan 3, 2024 · 11 revisions

Welcome to the Distributed Compute Coin wiki!

This wiki is currently out of date for the C++ implementation.

Distributed Compute Coin or DCC is based on sharing mining hardware with developers in order to run their programs better and compute a lot of data quickly. Anybody can submit code to be run across the peer-to-peer network, and will pay for that using this crypto. Learn how the entire system works, and how to create your own programs below.


The Standard-Wallet

The Standard-Wallet is the program most people will use to trade DCC. It is used to send and receive funds, and for developers to publish their compute-heavy programs. If it is your first time using it, then you will first be prompted with a sign-in. There is no need to create an account or register since once you sign in an account is generated. You also don't need to be online to see your balance, though the actual one may be different if the blockchain on your device is not recent. DO NOT FORGET YOUR CREDENTIALS. Everything is encrypted with a SHA256 hash algorithm, and there is no way to recover your account if lost. You must also make them as secure as possible since anything predictable like '1234' or 'password' can compromise your account. You may choose to save your credentials and stay logged in for next time if you wish. Once signed in, multiple things will appear on your screen. Your generated wallet address is at the top, which is the address you will give others in order to receive DCC. Next, your current balance and pending balance. Also, the trade and upload tabs appear.

Trading

When trading DCC, you must enter the recipient's wallet address and the amount you wish to send them. This will return an error if the amount you are trying to send is larger than your pending and current balance or if the recipient's address is invalid.

Upload Program

Programs are the most important part of DCC and what makes it unique. In order to make dependencies as manageable as possible and prevent running .EXE files, the language chosen is called Rust. You will need to install that before using the Standard-Wallet. You can do that by going to the Rust website and following the instructions there, which should only take a few minutes. Miners are able to automatically build and run Rust programs with just the base language installed, and they are running the source which means executables don't have to be used and they can be analyzed for malicious software. Unlike C++, Python, or C#, all of the dependencies for Rust programs are written in a Cargo.toml file and are automatically downloaded when it is built.

Before submitting any Rust project, there are a few guidelines that must be followed first.

  1. No malicious software, and no editing files outside of your project's own folder. Each program is examined by trusted users before release, and if any problems are encountered the program will not be computed and you will receive a refund.
  2. The project, not including any dependencies, must be less than 20 MB. This means you will need to run cargo clean inside of your project folder. This will remove cached and unneeded files or dependencies generated by Cargo, and will significantly reduce file size.
  3. The project should include an out.txt file in its root folder. This is where you will output any data you want to be returned to you. Every miner will upload a version of this to the server and store it in a folder for you to download at any time.
  4. The project directory should look similar to this:
    • Cargo-Project-Folder
      • src
        • main.rs
      • Cargo.toml
      • Cargo.lock
      • out.txt
  5. Your Rust project must be packaged in a .zip file. You may use any software to do this, it just needs to be zipped. Do not put the project in an extra folder: just zip the root project folder containing all of the cargo files and out.txt. Using the example above, you would zip Cargo-Project-Folder, and upon opening the zip file you would see the src folder along with the Cargo.toml file.

After you have ensured you followed all of these guidelines, you may submit your program. You can upload your zipped Rust program via the section titled "Upload Program" in the Standard-Wallet. First, you select your zipped program with the file select button. Next, you can specify the number of minutes you want your program to be run for. This number is cumulative and will decrease as many different miners are running it. After that, you can specify the level of hardware you want. The minutes and hardware-level are related: if your program requires better hardware but you select a low level, then it will take more time for it to execute and therefore use up more of your minutes. Try to balance the number of minutes and hardware level to get the best price. Finally after filling in those, you may click the "Submit button". Your file will be uploaded to the server and your funds will be subtracted and will appear in "Pending". If there is an error and/or your program does not upload then you will see it by the "Submit" button and no money will be subtracted.

The Cold Wallet

The most secure way to hold and transfer funds is by using something called a Cold Wallet. The DCC Cold Wallet only has the ability to send or receive funds, and does not have the ability to upload programs. It generates two 64 MB keys (about 64,000,000 chars long) using windows cryptographic service provider for utmost security and randomness and stores them in a file. There are no inputs for a username or password, those have been replaced by this file. Make sure not to lose this file. If this file is lost or edited then you may lose access to your wallet and it's funds. The wallet file may be copied as a backup, and it is highly recommended that you do so after it is first generated.

Trading

When trading DCC, you must enter the recipient's wallet address and the amount you wish to send them. This will return an error if the amount you are trying to send is larger than your pending and current balance or if the recipient's address is invalid.

The Miner

If you are interested in earning DCC, then you can use the Miner. The miner hashes blocks for verifying the blockchain network, and also runs programs created by Wallets. Just like the Wallets, programs are written in a language called Rust and you will need to install Rust before using the Miner. You can do that by going to the Rust website and following the instructions there, which should only take a few minutes. The miner uses a console interface, instead of the GUIs of the clients but it is very simple to use. You will first be prompted to enter your wallet address. This is where you will receive payment for each block you mine. If you don't have a wallet address yet, then open the Client or Cold-Wallet and sign in. Your wallet will be generated and shown at the top of the window. Next, you will be asked if you want to stay signed in. This will only store your wallet address so you don't need to sign in the next time you open this program. After that, there are a few options for you: ``` Miner commands:

    mine [amount]
        mines [amount] number of blocks, will only mine 1 by default if [amount] is not specified
        
    mineany [block number] [difficulty]
        hashes [block number] with the given [difficulty]. this is for debugging purposes,
        and will not actually submit the block
        
    help
        displays this dialogue
```
Inputting one of these commands and pressing the Enter key will execute the command. To begin mining, simply type "mine" (and a block amount, if you want to mine more than one).

Downloading, Distributing, and Editing the Source Code

If you wish to download, distribute, or edit the source, read the license. Contributing to the official repository doesn't require any permissions and anyone is free to do so. Downloading and editing or redistributing the source code or binary is fine, but you must make your source public, and include the license and a link to the official source. Finally, if you edit the work, you may not attempt to connect it to the main network. You may only do that if you have explicit written permission from the author of this work. For example, if a company wishes to create their own client for trading, (such as Coinbase or Binance), then it wouldn't be permitted to enter the network until an author gave them explicit written permission, such as an E-Mail or a Direct Message. If an approved program begins to appear malicious, it may be taken down at the author's notice.

Not yet implemented:

After submitting a program, it will appear in the list at the bottom of your client window. All of your active and inactive programs will be listed here. When a program ends, it along with all of its data will still be cached within your client. The list will contain information regarding if it is being computed, the number of minutes remaining, and a button to download the collected data so far. The data collected will automatically be deleted from the server after all of the minutes have been computed AND they were done getting computed more than 30 days ago, so make sure to download it to your system before then.

You will have an option when submitting a program for how you wish the collected data to be handled. You can either collect all data, which copies the out.txt file from all miners and saves a version of it. You can also keep data with elimination, which checks the first line of each out.txt file received and keeps the one with the largest integer value. Finally, you can collect data based on key-value, which will keep a version of each out.txt that contains a specified string which you will specify in the appropriate box.

Every Wallet and miner will connect to trusted wallets called "Nodes" the first time they start. These nodes will provide a list of IP addresses of other miners/Wallets. These programs will then use these to create a P2P (peer-to-peer) network for exchanging information.

Each Standard-Wallet, cold wallet, and miner will send a hash of its binary (itself) along with any data it is sending. This will ensure that only legitimate versions enter the network, and also help with version control.

Standard-Wallets will check blocks to make sure money printing isn't happening. This is when a malicious user edits a block manually and mines it, giving themselves or others money that does not exist. This is prevented by timestamps for every transaction and a time each block is mined, where only one single-style transaction may occur per block (a transaction that creates money, ex. when you get a reward for mining a block), and it's timestamp must be equal to the timestamp on the block for when it was mined. If any of these are incorrect, then the block is completely discarded and the chain is re-synced.