{"id":20765975,"url":"https://github.com/nvmd/cryptonote-base","last_synced_at":"2025-04-30T10:04:11.056Z","repository":{"id":31168907,"uuid":"34729110","full_name":"nvmd/cryptonote-base","owner":"nvmd","description":"Generic CryptoNote for easy currency bootstrapping and customization","archived":false,"fork":false,"pushed_at":"2020-02-16T13:18:59.000Z","size":12748,"stargazers_count":3,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-24T08:10:24.961Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nvmd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-28T12:28:47.000Z","updated_at":"2024-04-24T08:10:24.961Z","dependencies_parsed_at":"2022-09-08T17:01:15.784Z","dependency_job_id":null,"html_url":"https://github.com/nvmd/cryptonote-base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvmd%2Fcryptonote-base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvmd%2Fcryptonote-base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvmd%2Fcryptonote-base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nvmd%2Fcryptonote-base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nvmd","download_url":"https://codeload.github.com/nvmd/cryptonote-base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225029718,"owners_count":17409746,"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":[],"created_at":"2024-11-17T11:20:17.341Z","updated_at":"2024-11-17T11:20:17.777Z","avatar_url":"https://github.com/nvmd.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is the reference code for [CryptoNote](https://cryptonote.org) cryptocurrency protocol.\n\n* Launch your own CryptoNote currency: [CryptoNote Starter](https://cryptonotestarter.org/)\n* CryptoNote reference implementation: [CryptoNoteCoin](https://cryptonote-coin.org)\n* Discussion board and support: [CryptoNote Forum](https://forum.cryptonote.org)\n\n## CryptoNote forking how-to\n\n### Preparation\n\n1. Create an account on [GitHub.com](github.com)\n2. Fork [CryptoNote repository](https://github.com/cryptonotefoundation/cryptonote)\n3. Buy one or two Ubuntu-based dedicated servers (at least 2Gb of RAM) for seed nodes.\n\n\n\n### First step. Give a name to your coin\n\n**Good name must be unique.** Check uniqueness with [google](http://google.com) and [Map of Coins](mapofcoins.com) or any other similar service.\n\nName must be specified twice:\n\n**1. in file src/cryptonote_config.h** - `CRYPTONOTE_NAME` constant\n\nExample: \n```\nconst char CRYPTONOTE_NAME[] = \"furiouscoin\";\n```\n\n**2. in src/CMakeList.txt file** - set_property(TARGET daemon PROPERTY OUTPUT_NAME \"YOURCOINNAME**d**\")\n\nExample: \n```\nset_property(TARGET daemon PROPERTY OUTPUT_NAME \"furiouscoind\")\n```\n\n**Note:** You should also change a repository name.\n\n\n### Second step. Emission logic \n\n**1. Total money supply** (src/cryptonote_config.h)\n\nTotal amount of coins to be emitted. Most of CryptoNote based coins use `(uint64_t)(-1)` (equals to 18446744073709551616). You can define number explicitly (for example `UINT64_C(858986905600000000)`).\n\nExample:\n```\nconst uint64_t MONEY_SUPPLY = (uint64_t)(-1);\n```\n\n**2. Emission curve** (src/cryptonote_config.h)\n\nBe default CryptoNote provides emission formula with slight decrease of block reward with each block. This is different from Bitcoin where block reward halves every 4 years.\n\n`EMISSION_SPEED_FACTOR` constant defines emission curve slope. This parameter is required to calulate block reward. \n\nExample:\n```\nconst unsigned EMISSION_SPEED_FACTOR = 18;\n```\n\n**3. Difficulty target** (src/cryptonote_config.h)\n\nDifficulty target is an ideal time period between blocks. In case an average time between blocks becomes less than difficulty target, the difficulty increases. Difficulty target is measured in seconds.\n\nDifficulty target directly influences several aspects of coin's behavior:\n\n- transaction confirmation speed: the longer the time between the blocks is, the slower transaction confirmation is\n- emission speed: the longer the time between the blocks is the slower the emission process is\n- orphan rate: chains with very fast blocks have greater orphan rate\n\nFor most coins difficulty target is 60 or 120 seconds.\n\nExample:\n```\nconst uint64_t DIFFICULTY_TARGET = 120;\n```\n\n**4. Block reward formula**\n\nIn case you are not satisfied with CryptoNote default implementation of block reward logic you can also change it. The implementation is in `src/cryptonote_core/Currency.cpp`:\n```\nbool Currency::getBlockReward(size_t medianSize, size_t currentBlockSize, uint64_t alreadyGeneratedCoins, uint64_t fee, uint64_t\u0026 reward, int64_t\u0026 emissionChange) const\n```\n\nThis function has two parts:\n\n- basic block reward calculation: `uint64_t baseReward = (m_moneySupply - alreadyGeneratedCoins) \u003e\u003e m_emissionSpeedFactor;`\n- big block penalty calculation: this is the way CryptoNote protects the block chain from transaction flooding attacks and preserves opportunities for organic network growth at the same time.\n\nOnly the first part of this function is directly related to the emission logic. You can change it the way you want. See MonetaVerde and DuckNote as the examples where this function is modified.\n\n\n### Third step. Networking\n\n**1. Default ports for P2P and RPC networking** (src/cryptonote_config.h)\n\nP2P port is used by daemons to talk to each other through P2P protocol.\nRPC port is used by wallet and other programs to talk to daemon.\n\nIt's better to choose ports that aren't used by other software or coins. See known TCP ports lists:\n\n* http://www.speedguide.net/ports.php\n* http://www.networksorcery.com/enp/protocol/ip/ports00000.htm\n* http://keir.net/portlist.html\n\nExample:\n```\nconst int P2P_DEFAULT_PORT = 17236;\nconst int RPC_DEFAULT_PORT = 18236;\n```\n\n\n**2. Network identifier** (src/p2p/p2p_networks.h)\n\nThis identifier is used in network packages in order not to mix two different cryptocoin networks. Change all the bytes to random values for your network:\n```\nconst static boost::uuids::uuid CRYPTONOTE_NETWORK = { { 0xA1, 0x1A, 0xA1, 0x1A, 0xA1, 0x0A, 0xA1, 0x0A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA1, 0x1A } };\n```\n\n\n**3. Seed nodes** (src/cryptonote_config.h)\n\nAdd IP addresses of your seed nodes.\n\nExample:\n```\nconst std::initializer_list\u003cconst char*\u003e SEED_NODES = {\n  \"111.11.11.11:17236\",\n  \"222.22.22.22:17236\",\n};\n```\n\n\n### Fourth step. Transaction fee and related parameters\n\n**1. Minimum transaction fee** (src/cryptonote_config.h)\n\nZero minimum fee can lead to transaction flooding. Transactions cheaper than the minimum transaction fee wouldn't be accepted by daemons. 100000 value for `MINIMUM_FEE` is usually enough.\n\nExample:\n```\nconst uint64_t MINIMUM_FEE = 100000;\n```\n\n\n**2. Penalty free block size** (src/cryptonote_config.h)\n\nCryptoNote protects chain from tx flooding by reducing block reward for blocks larger than the median block size. However, this rule applies for blocks larger than `CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE` bytes.\n\nExample:\n```\nconst size_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE = 20000;\n```\n\n\n### Fifth step. Address prefix\n\nYou may choose a letter (in some cases several letters) all the coin's public addresses will start with. It is defined by `CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX` constant. Since the rules for address prefixes are nontrivial you may use the [prefix generator tool](https://cryptonotestarter.org/tools.html).\n\nExample:\n```\nconst uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX = 0xe9; // addresses start with \"f\"\n```\n\n\n### Sixth step. Genesis block\n\n**1. Build the binaries with blank genesis tx hex** (src/cryptonote_config.h)\n\nYou should leave `const char GENESIS_COINBASE_TX_HEX[]` blank and compile the binaries without it.\n\nExample:\n```\nconst char GENESIS_COINBASE_TX_HEX[] = \"\";\n```\n\n\n**2. Start the daemon to print out the genesis block**\n\nRun your daemon with `--print-genesis-tx` argument. It will print out the genesis block coinbase transaction hash.\n\nExample:\n```\nfuriouscoind --print-genesis-tx\n```\n\n\n**3. Copy the printed transaction hash** (src/cryptonote_config.h)\n\nCopy the tx hash that has been printed by the daemon to `GENESIS_COINBASE_TX_HEX` in `src/cryptonote_config.h`\n\nExample:\n```\nconst char GENESIS_COINBASE_TX_HEX[] = \"013c01ff0001ffff...785a33d9ebdba68b0\";\n```\n\n\n**4. Recompile the binaries**\n\nRecompile everything again. Your coin code is ready now. Make an announcement for the potential users and enjoy!\n\n\n## Building CryptoNote \n\n### On *nix\n\nDependencies: GCC 4.7.3 or later, CMake 2.8.6 or later, and Boost 1.55.\n\nYou may download them from:\n\n* http://gcc.gnu.org/\n* http://www.cmake.org/\n* http://www.boost.org/\n* Alternatively, it may be possible to install them using a package manager.\n\nTo build, change to a directory where this file is located, and run `make`. The resulting executables can be found in `build/release/src`.\n\n**Advanced options:**\n\n* Parallel build: run `make -j\u003cnumber of threads\u003e` instead of `make`.\n* Debug build: run `make build-debug`.\n* Test suite: run `make test-release` to run tests in addition to building. Running `make test-debug` will do the same to the debug version.\n* Building with Clang: it may be possible to use Clang instead of GCC, but this may not work everywhere. To build, run `export CC=clang CXX=clang++` before running `make`.\n\n### On Windows\nDependencies: MSVC 2012 or later, CMake 2.8.6 or later, and Boost 1.55. You may download them from:\n\n* http://www.microsoft.com/\n* http://www.cmake.org/\n* http://www.boost.org/\n\nTo build, change to a directory where this file is located, and run theas commands: \n```\nmkdir build\ncd build\ncmake -G \"Visual Studio 11 Win64\" ..\n```\n\nAnd then do Build.\nGood luck!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvmd%2Fcryptonote-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnvmd%2Fcryptonote-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnvmd%2Fcryptonote-base/lists"}