1. What is SpareCycles.org?
SpareCycles.org is an experiment.
SpareCycles.org is a market for spare computing cycles.
SpareCycles.org is an advertising board. Computers advertise their spare cycles. Taskers advertise their tasks. Escrows advertise their payment processing and dispute resolution services.
SpareCycles.org is not a business. It holds no customer money. It charges no fees. It is done for the love of empowering people with computational cycles on-demand at a price near that of electricity.
2. What are the economics?
From oil exploration to media processing to scientific simulations, there is always need for more computing power. As former employees at one of the world's largest supercomputers, we know first hand that there is an unending demand for compute resources.
Supercomputers and cloud computing companies must cover infrastructure, operating costs, and salaries. Our infrastructure is personal computers which are already paid for. Our costs are electricity and optional escrow fees. Our salaries are zero. Furthermore, our market is worldwide and has zero barriers to entry -- perhaps a perfect market.
Fees are whatever the computer and tasker agree upon, plus fees for optional escrow. To promote market-depth, we ask market makers to charge an extra convenience fee to market takers.
3. What should taskers consider?
- SpareCycles.org is for anyone who needs computational power. Possible uses include media production, CAD, scientific computing, stateless webapps, compiling and testing, machine learning and decision science, etc.
- Taskers can offer a higher price for immediate computation, or an economical price for eventual batch processing.
- Taskers provide a Webassembly .wasm or .wast file. See Why WebAssembly? below.
- Parallelism is possible by breaking tasks into independent subtasks which can be executed concurrently. Future versions of Wasm will support threads and SIMD.
- GPGPU support is planned through WebGL shaders. Although this has many challenges.
- The tasker must submit the following form with parameters.
rate: .00001 eth/cycle,
size: 200 kB
number: 1 //arg with index 0 to n
chunks_out_of_order: yes //serial or not
channel: no //since only one chunk; but if have then can get updates
output_scheme: wait-until-end}, //location/offset of each chunk
deposit: 0.01 eth //higher for important computation
deposit_requested: 0.001 eth
scheme: [third-party, sparecycles.org]
//in-order chunks is more expensive to check but might use binary search; out-of-order just compute the bad chunk
dispute value ie required stake
dispute resolution period}
3.1. What about misbahaving computers?
This problem difficult. A practical solution is dispute resolution with the threat of confiscating security deposits, see below. Another practucal solution is web-of-trust and reputation.
The following heuristics can be used to help limit and identify whether junk data was returned.
- Redundancy. Compare results from (hopefully) independent computers.
- If the computation is long but can be quickly verified (e.g. NP with exponential runtime), then verify the result.
- Combine the code of many programs into one program, and evaluate a specific sub-program based on the arguments. This is difficult to reverse-engineer.
- Embed another computation for which the result is known. Return this known result along with the output, and check whether the known result is correct.
- If the solution takes a certain form, verify that the returned value has that form.
- For example, use visual inspection or automate based on known properties of the output.
- For example, select a Hamming code to encode the result of each task. Verify locally.
- Submit some computations with known outputs, do this for a percentage of programs so you will catch them eventually with high probability.
- Timing analysis over different length computations, dispute if data is returned too early.
- Frequently re-obfuscate the code to hinder reverse-engineering any of the above methods.
- More coming soon.
3.2. What about data privacy?
Nothing protects data which is sent, received, and used during computation. But some options for privacy follow.
- Strong solutions:
- Use cryptographic tricks. For example homomorphic encryption allows operating on the encrypted data without decrypting it.
- Require the computer to use an enclave (memory encryption) such as SGX or SEV. Must trust the hardware maker, and be aware of recent security vulnerabilities.
- Weak solutions (these can be combined):
- Encryption: Send encrypted data, then use the program to decrypt it and encrypt the result.
- Obfuscation: Obfuscate the data with junk data. Perform computations over all of the data.
- Security through obscurity: define an obscure VM, then execute opcodes in this VM.
- Break the computation into parts which are executed by (hopefully) independent computers.
4. What should computers consider?
- One can rent any idle CPUs including phones, laptops, desktops, even servers.
- To begin, enter your crypto-currency address into
computer_config.json and click "Start/Stop computing.".
- Lower the "CPU utilization" slider to make your computer more responsive.
- Security was a top priority from day one. Web browsers are battle-tested to execute untrusted code in a sandbox, enforcing memory safety and same-origin policy. But it is still wise to backup your computer before using SpareCycles.org.
- Earning higher rates per cycle often requires a security deposit, which can be confiscated upon proof of your bad behavior. See below.
- Even if your behavior is good, you may be victim to cosmic rays, bad memory chip, failing network, or cpu giving wrong output (consider disabling Intel hyperthreading).
- Stop computing by clicking "Start/Stop computing.", which will finish all current tasks. If you close your browser before finishing a task, your security deposit may be confiscated.
- It may be wise to set your fees such that your earnings are greater than cost of electricity, unless you benefit from electric heat.
- If you have many cpus, webworker support will allow using all of them. For now, you can use multiple tabs.
- The following form must be filled out:
cryptocurrency: eth, //three or four letter currency symbol
address: sparecycles.eth} //used for signing administrative requests, released to escrow
escrow_agents: [jackson, jefferson, eskrow] //list of agents
5. What should escrows consider?
- Anybody could be an escrow agent.
- You log in to SpareCycles.org/escrow and set your policies, including fees.
- Escrow accepts deposits, holds balances, and allows withdrawals.
- All account administration is done with signed crypto-currency messages.
- Set your dispute resolution policies.
6. How are disputes handled?
- The computer and tasker have the option to require a third-party escrow.
- Disputes can only be resolved by an escrow agent. Or a heirarchy of escrow agents.
- Security deposit is confiscated by escrow, given "proof" of misbehavior.
- How to avoid errors:
- Prepare how to protect yourself from disputes raised against you, and how disputes which you raise can fail.
- Only use small amounts, because anything can happen.
- Taskers can test their code execution on many architectures and execution environments.
- Computers can request escrow agents who use similar hardware and software to verify a computation.
7. How do I perform account administration?
Site administration is performed by signing a request. Similar for communicating with escrow agents. The format of these requests is being developed.
8. Why WebAssembly?
- WebAssembly is a standard supported by most modern browser.
- WebAssembly is fast, approaching native speed.
- WebAssembly is safe, designed to execute arbitrary downloaded code. All memory and variables are zero'd before they can be used. In the name of performance, WebAssembly is being executed it in security ring 0, see nebulet or cervus.
- WebAssembly is executable after one linear pass through the code.
- WebAssembly has a structure which allows static analysis for things like metering and transforming the code.
Please do not send us your private information.
10. What about decentralization?
We are still centralized running on SpareCycles.org servers. We plan to build a concurrent decentralized version if we meet our funding goals.
11. What currencies do you support?
Whatever the tasker or excrow supports.
12. Why does the website look so outdated?
13. What are the licenses or restrictions of SpareCycles.org?
We will open-source everything if we meet our funding goals.
14. Creating a Task
TODO: How to compile sample C/C++ to a task.