{"id":13850586,"url":"https://github.com/zold-io/zold","last_synced_at":"2025-12-24T22:31:41.551Z","repository":{"id":41240217,"uuid":"119125227","full_name":"zold-io/zold","owner":"zold-io","description":"An Experimental Non-Blockchain Cryptocurrency for Fast Micro Payments","archived":false,"fork":false,"pushed_at":"2024-05-22T11:51:54.000Z","size":4425,"stargazers_count":191,"open_issues_count":83,"forks_count":52,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-22T12:53:35.378Z","etag":null,"topics":["blockchain","cryptocurrency","money","payment","pgp-key","ruby","rubygem","wallet"],"latest_commit_sha":null,"homepage":"https://www.zold.io","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zold-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-27T02:31:37.000Z","updated_at":"2024-05-31T07:49:28.387Z","dependencies_parsed_at":"2024-03-14T00:30:37.183Z","dependency_job_id":"66fa72be-615e-41bb-9518-2a39a614fb89","html_url":"https://github.com/zold-io/zold","commit_stats":{"total_commits":1435,"total_committers":30,"mean_commits":"47.833333333333336","dds":"0.18327526132404182","last_synced_commit":"620ba21684f14adb588fd601fe4d87f8808ec9cd"},"previous_names":[],"tags_count":313,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zold-io%2Fzold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zold-io%2Fzold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zold-io%2Fzold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zold-io%2Fzold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zold-io","download_url":"https://codeload.github.com/zold-io/zold/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225048055,"owners_count":17412725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cryptocurrency","money","payment","pgp-key","ruby","rubygem","wallet"],"created_at":"2024-08-04T20:01:19.678Z","updated_at":"2025-12-24T22:31:41.543Z","avatar_url":"https://github.com/zold-io.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Non-Blockchain Cryptocurrency\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/zold)](https://www.rultor.com/p/yegor256/zold)\n[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)\n\n[![PDD status](https://www.0pdd.com/svg?name=zold-io/zold)](https://www.0pdd.com/p?name=zold-io/zold)\n[![Gem Version](https://badge.fury.io/rb/zold.svg)](https://badge.fury.io/rb/zold)\n[![Test Coverage](https://img.shields.io/codecov/c/github/zold-io/zold.svg)](https://codecov.io/github/zold-io/zold?branch=master)\n[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/zold-io/zold/master/frames)\n[![Maintainability](https://api.codeclimate.com/v1/badges/2861728929db934eb376/maintainability)](https://codeclimate.com/github/zold-io/zold/maintainability)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/takes/blob/master/LICENSE.txt)\n[![Hits-of-Code](https://hitsofcode.com/github/zold-io/zold)](https://hitsofcode.com/github/zold-io/zold)\n\nTo understand what Zold cryptocurrency is about, you may want\nto watch [this video][video] first. Then, you may\nwant to read [this blog][blog] post.\nThen, you have to read the [Green Paper][green-paper]\n(just four pages). In a nutshell, Zold is a cryptocurrency with the following\nfeatures:\n\n* No Blockchain\n* No General Ledger\n* Very fast, because decentralized\n* 100 times cheaper than Bitcoin\n* Proof-of-work\n* Unique consensus protocol\n* Pre-mined with a total capacity of 2 billion ZLD\n* Anonymous\n* Written in Ruby\n\nYou can find more details in the [White Paper][white-paper].\n\nYou can also find us at the [Bitcointalk][bitcointalk] forum.\n\nJoin our [Telegram group][telegram] to discuss it all live.\n\n## How to Use\n\nYou can try the [web wallet][wts], but the best way\nto use Zold is through the command line tool, which has all the features\nand should remind you of Git, if you are a programmer.\n\nFirst, install [Ruby 2.3+][ruby], [Rubygems][rubygems], and the [gem][zold-gem].\nHere is [how][install].\n\nTo make sure it's installed, try:\n\n```bash\nzold --help\n```\n\nYou will need RSA private and public keys in `~/.ssh`.\nIf you don't have them yet, run this in order to generate a new pair\n(just hit `Enter` when it asks you for a password):\n\n```bash\nssh-keygen -t rsa -b 4096\n```\n\nThen, create a new wallet (instead of `5f96e731e48ae21f` there will be your\npersonal wallet ID, use it everywhere below):\n\n```bash\n$ zold create\n5f96e731e48ae21f\n```\n\nThen, push it to the network:\n\n```bash\nzold push 5f96e731e48ae21f\n```\n\nThen, give this ID to your friend, who is going to pay you.\nWhen the payment is sent, ask him or her for the ID of the wallet\nthe payment has been sent from and then fetch that wallet\n(let's say it is `5555444433332222`):\n\n```bash\n$ zold fetch 5555444433332222\n5.00 ZLD added to 5f96e731e48ae21f: To my friend!\n```\n\nNow, you have the money in your wallet!\n\nNext, you can pay your friend back:\n\n```bash\n$ zold pay 5f96e731e48ae21f 5555444433332222 2.50 'Here is a refund'\n-2.50 ZLD added to 5f96e731e48ae21f: Here is a refund\n```\n\nFinally, you have to push your wallet to the network so that your friend\nknows about the payment:\n\n```bash\nzold push 5f96e731e48ae21f\n```\n\nThat's it.\n\n## How to Start a Node\n\nYou can also contribute to Zold by running a node on your server.\nIn order to do that, just run (with your own wallet ID, of course):\n\n```bash\nzold node --invoice=5f96e731e48ae21f\n```\n\nThen, open the page `localhost:4096` in your browser\n(you may need to open the inbound port in your [IP firewall]).\nIf you see a simple JSON document, everything is fine.\nNext, hit `Ctrl`+`c` and run it again, but with `--nohup`:\n\n```bash\nzold node --nohup --invoice=5f96e731e48ae21f\n```\n\nNow you can close the console;\nthe software will work in the background, saving the output logs to `zold.log`.\nThe software will update itself automatically to new versions.\nThe software will never stop, even if it crashes internally with any error.\nIn order to terminate it forcefully, do:\n\n```bash\nkillall -9 zold\n```\n\nGrateful users of the system will pay \"taxes\" to your wallet\nfor the maintenance of their wallets, and the system will occasionally\nsend you bonuses for keeping the node online (approximately 1 ZLD per day).\n\nIf you are lost, run this:\n\n```bash\nzold node --help\n```\n\nYou can also run a node in a Docker container, using [yegor256/zold][docker]\nbuilt from this [Dockerfile][dockerfile].\n\n```bash\ndocker run -d -p 4096:4096 yegor256/zold /node.sh --host=\u003cyour host IP\u003e --invoice=5f96e731e48ae21f\n```\n\nTo store Zold data between container restarts, create a volume or bind\na directory from the host:\n\n```bash\ndocker volume create zold\ndocker run -d -p 4096:4096 -v zold:/zold yegor256/zold \\\n  /node.sh --host=\u003cyour host IP\u003e --invoice=5f96e731e48ae21f\n```\n\nYou may find this blog post useful: [How to Run Zold Node?][node-blog]\n\n## If Your File System is on Fire (or How to Reduce Your Hard Disk Usage)\n\nAt the moment, the file system is utilized too aggressively and if you\nwould like to calm this process down and have a bit of spare memory, you may\nfind the following approach handy (directly applicable to FreeBSD OS).\n\nThe application data can be moved to [a memory-backed memory disk][freebsd-disk]\nwith periodic syncing of `farm`, `zold.log` and `.zolddata` to the\nhard disk.\n\nThe `/etc/fstab` entry:\n\n```text\nmd /usr/home/zold/app-in-mem mfs rw,-M,-n,-s512m,-wzold:zold,-p0755 2 0\n```\n\nThe `/etc/crontab` entry:\n\n```text\n*/10 * * * * zold /usr/local/bin/rsync -aubv \\\n  /usr/home/zold/app-in-mem/farm /usr/home/zold/app-in-mem/zold.log \\\n  /usr/home/zold/app-in-mem/.zoldata /usr/home/zold/app/\n```\n\n## Frequently Asked Questions\n\n\u003e Is there a configuration file?\n\nAny command line flag can also be put in the `~/.zold` file, one per line:\n\n```text\n--home=~/.zold_home\n--verbose\n```\n\n\u003e Where are my RSA private/public keys?\n\nThey are in `~/.ssh/id_rsa` (private key) and `~/.ssh/id_rsa.pub` (public key).\nMake sure you have a copy of your private key in some safe place.\nIf you lose the public key, it's not a problem, since your wallet has it.\nBut the private key is your personal asset.\nAnyone can use your wallet if they have the private key.\nKeep it safe and secure!\n\n\u003e How do I use my RSA private key from \u003chttps://wts.zold.io\u003e?\n\nRetrieve the key via \u003chttps://wts.zold.io/key\u003e. It can then be used with\nthe command line flag `--private-key` (e.g., for the `pay`, `node` and\n`taxes` commands).\n\nIf you need the public key, you can generate it with\n`ssh-keygen -y -f .ssh/zold_key \u003e .ssh/zold_key.pub`. It can then be used\nwith the command line flag `--public-key` (e.g., for the `create` command).\n\n\u003e What is the best way to check the balance of the rewards collected by nodes?\n\nYou just do `zold pull \u003cWallet_ID\u003e` and the rewards (taxes) will be visible there.\n\n\u003e Can I set up multiple nodes with one wallet address?\n\nYes, you can run many nodes with the same wallet ID.\n\n\u003e Is there a way to increase the number of threads in order to maximize\n\u003e computing power of multi-core machines?\n\nYes, you can use `--threads` command line argument for your node\nand the number of threads will be as big as you wish.\n\n## Front-end JSON Details\n\nWhen you open up the front web page of your node, you will see a JSON document\nwith a lot of technical details. Here is the explanation of the majority of them:\n\n`version` is the current version of the running software.\nThe node is supposed to update itself automatically (if you run it via `zold-nohup`)\nevery time it discovers another node with a higher version.\n\n`network` is the name of the network the node belongs to.\nThe production network's name is `zold`.\nFor testing purposes, you can start a node in a test network, using `--network=test`.\n\n`score` is the current score your node is exposing to the network now.\nAll other nodes are using this information in order to decide how much\nthey can trust your node with the information it provides about wallets.\nThe higher the score, the better.\n\n* `value` is the number of suffixes the score contains; this is the\n  number all other nodes rely on.\n\n* `host` is the host name of the node, it must be equal to the public\n  IP or domain name of the node; it is provided in `--host` command line\n  option of `zold-nohup`.\n\n* `port` is the TCP port number, which usually is equal to 4096;\n  it is provided in `--port` command line option.\n\n* `invoice` is the address of your wallet, where the system\n  will send you rewards for keeping the node online and some\n  users will pay taxes; it is provided in `--invoice` command line option.\n\n* `time` is the ISO-8601 UTC date and time of when your node\n  started to calculate the score.\n\n* `strength` is the number of trailing zeros the hash contains.\n\n* `hash` is the SHA-256 hash of the score text.\n\n* `minutes` is the age of the score, in minutes since the moment\n  it was created.\n\n`pid` is the Unix process ID of the running software.\n\n`cpus` is the number of CPUs detected on the server.\n\n`threads` is the number of running threads vs. the total number of\nthreads in the Ruby process. If the second number is over 100, there\nis definitely something wrong with the software.\n\n`wallets` is the total number of wallets managed by the server.\nThe bigger the number, the better. When the server starts, the number\nis small and it starts growing when other nodes are pushing wallets\nto your node.\n\n`remotes` is the total number of remote nodes your node is aware of.\nThe bigger the number, the more \"connected\" your node is to the\nnetwork. You can see the full list of nodes at `/remotes` URL of your node.\n\n`farm` is the score calculating software.\n\n* `threads` is the number of threads this software module is using.\n  This number is configured via the `--threads` command line option.\n  The bigger the number, the more intensively the software will use\n  your CPUs. It is recommended to make this number equal to the\n  number of CPUs available.\n\n* `pipeline` is ... something not important to you.\n\n* `best` is the list of scores known to the farm at the moment\n  (with their ages in minutes).\n\n`entrance` is the place where all new wallets arrive and get merged and pushed\nfurther. The health of this point is critical to the entire node. Some\nnumbers it includes must be watched carefully.\n\nTo be continued...\n\n`date` is the current date and time on the server.\n\n`hours_alive` is the time in hours your server has been alive without a reboot.\n\n## HTTP RESTful API\n\nWell, maybe it's not purely RESTful, but each node has a simple\nset of HTTP entry points, which you can use to retrieve information\nabout wallets, node status, log details, and some other things. Here\nis a more or less complete list of them:\n\n* `GET /`: returns the JSON explained above\n\n* `GET /score`: returns the text presentation of the current Score\n\n* `GET /version`: returns the version of the software\n\n* `GET /protocol`: returns the protocol ID\n\n* `GET /wallet/ID`: returns the JSON with wallet details\n\n* `GET /wallet/ID/balance`: returns wallet balance in zents (text/plain)\n\n* `GET /wallet/ID/key`: returns wallet public RSA key\n\n* `GET /wallet/ID/mtime`: returns ISO-8601 time of wallet file modification\n\n* `GET /wallet/ID/size`: returns the size of the wallet file in bytes\n\n* `GET /wallet/ID/age`: returns the age of the wallet, in seconds\n\n* `GET /wallet/ID/txns`: returns the number of transactions in the wallet\n\n* `GET /wallet/ID/debt`: returns the tax debt of the wallet in zents\n\n* `GET /wallet/ID/digest`: returns SHA-256 digest of the wallet file\n\n* `GET /wallet/ID/mnemo`: returns the mnemo short string of the wallet\n\n* `GET /wallet/ID/txns.json`: returns the full list of transactions\n  in the wallet as a JSON document\n\n* `GET /wallet/ID.txt`: returns the text presentation of the wallet\n\n* `GET /wallet/ID.html`: returns the HTML presentation of the wallet\n\n* `GET /wallet/ID.bin`: returns the entire wallet file\n\n* `GET /wallet/ID/copies`: returns the list of copies of the wallet\n\n* `GET /wallet/ID/copy/NAME`: returns the entire content of a single copy\n  of the wallet\n\n* `PUT /wallet/ID`: accepts new content for the wallet, in order to\n  modify the one stored on the server (PUSH operation)\n\n* `GET /wallets`: returns the list of all wallets maintained by the node,\n  in plain text, separated by EOL\n\n* `GET /remotes`: returns the list of remote nodes in JSON\n\n* `GET /ledger`: returns the list of recently visible transactions\n\n* `GET /ledger.json`: returns the list of recently visible transactions, in JSON\n\nThere are a few other entry points, which exist mostly for debugging purposes;\nthey may not be supported by alternative implementations of the node software:\n\n* `GET /pid`: returns the process ID of the software\n\n* `GET /trace`: returns the entire log of the node\n\n* `GET /farm`: returns the statistics of the Farm\n\n* `GET /metronome`: returns the statistics of the Metronome\n\n* `GET /threads`: returns the statistics of all Ruby threads\n\n* `GET /ps`: returns the statistics of all currently running Unix processes\n\n* `GET /queue`: returns the statistics of the node queue\n\n* `GET /journal`: returns the journal, in HTML\n\n* `GET /journal/item?id=ID`: returns the content of a single journal entry\n\nThere may be other entry points not documented here.\n\n## SDK\n\nHere is how you use Zold SDK from your Ruby app. First, you should\nadd `zold` [gem][zold-gem] to your [`Gemfile`][gemfile] or just:\n\n```bash\ngem install zold\n```\n\nThen, you will need a directory where wallets and other supplementary data\nwill be kept.\nThis can be any directory, including a temporary one. If it doesn't exist,\nit will automatically be created:\n\n```ruby\nhome = '/tmp/my-zold-dir'\n```\n\nThen, you need to create three objects:\n\n```ruby\nrequire 'zold/wallets'\nrequire 'zold/sync_wallets'\nrequire 'zold/remotes'\nwallets = Zold::SyncWallets.new(Zold::Wallets.new(home))\nremotes = Zold::Remotes.new(File.join(home, 'remotes'))\ncopies = File.join(home, 'copies')\n```\n\nThe first step is to update the list of remote nodes, in order\nto be properly connected to the network:\n\n```ruby\nrequire 'zold/commands/remote'\nZold::Remote.new(remotes: remotes).run(['remote', 'update'])\n```\n\nNow you are ready to create a wallet:\n\n```ruby\nrequire 'zold/commands/create'\nZold::Create.new(wallets: wallets, remotes: remotes).run(\n  ['create', '--public-key=/tmp/id_rsa.pub', '--skip-test']\n)\n```\n\nHere `--public-key=/tmp/id_rsa.pub` points to the absolute location of\na public RSA key for the wallet you want to create.\n\nYou can also pull a wallet from the network:\n\n```ruby\nrequire 'zold/commands/pull'\nZold::Pull.new(wallets: wallets, remotes: remotes, copies: copies).run(\n  ['pull', '00000000000ff1ce']\n)\n```\n\nThen, you can make a payment:\n\n```ruby\nrequire 'zold/commands/pay'\nZold::Pay.new(wallets: wallets).run(\n  ['pay', '17737fee5b825835', '00000000000ff1ce', '19.99', 'For a pizza', '--private-key=/tmp/id_rsa']\n)\n```\n\nHere `--private-key=/tmp/id_rsa` points to the\n  absolute location of the private RSA key of the paying wallet.\n\nFinally, you can push a wallet to the network:\n\n```ruby\nrequire 'zold/commands/push'\nZold::Push.new(wallets: wallets, remotes: remotes).run(%w[push 17737fee5b825835])\n```\n\nBy default, all commands will work quietly, reporting absolutely nothing\n  to the console.\nTo change that, you can use the `log` argument of their constructors.\nFor example, `Loog::VERBOSE` will print a lot of information to the console:\n\n```ruby\nrequire 'zold/commands/push'\nrequire 'loog'\nZold::Push.new(wallets: wallets, remotes: remotes, log: Loog::VERBOSE).run(['push'])\n```\n\nAlso, all commands by default assume that you are working in a `test` network.\nThis is done in order to protect our production network from your test cases.\nIn order to instruct them to deal with real data and real nodes, you should\ngive them `--network=zold` argument, for example:\n\n```ruby\nrequire 'zold/commands/push'\nZold::Push.new(wallets: wallets, remotes: remotes).run(\n  %w[push 17737fee5b825835 --network=zold]\n)\n```\n\nIf anything doesn't work as explained above, please\n[submit a ticket][issues] or join our [Telegram group][telegram] and complain there.\n\n## How to Contribute\n\nIt is a Ruby command line gem. First, install\n[Ruby 2.3+][ruby], [Rubygems][rubygems], and [Bundler][bundler]. Then:\n\n```bash\nbundle update\nbundle exec rake\n```\n\nThe build has to be clean. If it's not, [submit an issue][issues].\n\nThen, make your changes, make sure the build is still clean,\nand [submit a pull request][pr-guide].\n\nIf some test fails and you need to run it individually,\ncheck the logging configuration inside `test__helper.rb` and make\nsure the `Verbose` log is assigned to `$log`. Then, run, for example:\n\n```bash\nruby test/commands/test_node.rb\n```\n\nIf you need to run a single test method, do this:\n\n```bash\nruby test/test_wallet.rb -n test_adds_transaction\n```\n\n[video]: https://youtu.be/5A9uBwMow0M\n[blog]: https://blog.zold.io/2018/07/08/mission.html\n[green-paper]: https://papers.zold.io/green-paper.pdf\n[white-paper]: https://papers.zold.io/wp.pdf\n[bitcointalk]: https://bitcointalk.org/index.php?topic=5095078\n[telegram]: https://t.me/zold_io\n[wts]: https://wts.zold.io\n[ruby]: https://www.ruby-lang.org/en/documentation/installation/\n[rubygems]: https://rubygems.org/pages/download\n[zold-gem]: https://rubygems.org/gems/zold\n[install]: https://github.com/zold-io/zold/blob/master/INSTALL.md\n[IP firewall]: https://www.howtogeek.com/177621/the-beginners-guide-to-iptables-the-linux-firewall/\n[docker]: https://hub.docker.com/r/yegor256/zold\n[dockerfile]: https://github.com/zold-io/zold/blob/master/Dockerfile\n[node-blog]: https://blog.zold.io/2019/01/10/how-to-run-node.html\n[freebsd-disk]: https://www.freebsd.org/doc/handbook/disks-virtual.html\n[gemfile]: https://bundler.io/gemfile.html\n[issues]: https://github.com/zold-io/zold/issues\n[bundler]: https://bundler.io/\n[pr-guide]: https://www.yegor256.com/2014/04/15/github-guidelines.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzold-io%2Fzold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzold-io%2Fzold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzold-io%2Fzold/lists"}