{"id":16842785,"url":"https://github.com/eapache/gocoin","last_synced_at":"2025-04-10T13:40:46.819Z","repository":{"id":15213067,"uuid":"17941522","full_name":"eapache/gocoin","owner":"eapache","description":"A toy bitcoin-like experiment in Go","archived":false,"fork":false,"pushed_at":"2014-07-05T02:43:15.000Z","size":180,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:21:27.266Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/eapache.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-20T12:23:31.000Z","updated_at":"2023-04-10T19:20:51.000Z","dependencies_parsed_at":"2022-09-12T06:10:39.951Z","dependency_job_id":null,"html_url":"https://github.com/eapache/gocoin","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/eapache%2Fgocoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eapache%2Fgocoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eapache%2Fgocoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eapache%2Fgocoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eapache","download_url":"https://codeload.github.com/eapache/gocoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225952,"owners_count":21068090,"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-10-13T12:48:33.260Z","updated_at":"2025-04-10T13:40:46.802Z","avatar_url":"https://github.com/eapache.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\nGocoin implements a toy version of the bitcoin protocol for demonstration\npurposes. It is written in Golang (http://golang.org/) so should be easily\ncompilable on all major platforms (Windows, Mac, Linux).\n\nAs with any toy security system, there are numerous practical attacks that make\nthis system insecure; the real bitcoin software and protocol are substantially\nmore complicated for this reason (far too complicated to implement for this kind\nof project). However, gocoin does use \"real\" RSA signing as implemented by\nGolang's standard crypto library.\n\nUnlike bitcoin, which has an algorithm for adjusting mining speed and reward,\ngocoin hard-codes values which should require about 10-15 seconds to mine a\nblock on a modern CPU. Each block mined rewards the miner with exactly 10 coins.\nThese values seem to work well for demonstration purposes.\n\nBuilding a Network\n==================\n\nThe program automatically starts listening on a random network port and mining\nnew blocks on a fresh blockchain. It takes four optional flags:\n\n  --listen=ADDR  Choose a specific address to listen on; if not specified the\n                 default is a random ephemeral port on localhost.\n  --connect=ADDR Connect to the peer at the given address. The network is P2P,\n                 so you only have to specify one peer and you will automatically\n                 end up connected to the entire network of peers. In this case\n                 the client will not start a new blockchain but will download\n                 and use the network's existing longest blockchain.\n  --delay        Adds random delays to certain network events in order to\n                 simulate a flaky network and cause block-chain forks. Useful\n                 for demoing divergence and recovery of peers with different\n                 block-chains.\n  --verbose      Print logs to standard output on most events, including new\n                 blocks, transactions, etc.\n\nWhen the program starts, the very first line it prints contains the listening\naddress so you can connect to it from other peers.\n\nInterface\n=========\n\nThese are the available commands in the UI:\n  state  - prints out the current internal state, including details of each\n           block and transaction in the primary blockchain (this can get quite\n           long when the network has been running a while)\n  wallet - prints out a summary of your wallet, mapping keys to coin amounts\n\n  cons   - consolidates the value of your current wallet into single key\n  pay    - allows you to pay coins to another peer out of your wallet\n\n  addr   - prints the listening network address of the peer\n  help   - displays a summary of the interface and flag help\n  quit   - shuts down the peer (wallet is lost)\n\nLimitations\n===========\n\nReal P2P network logic is quite complicated, so we fake it by simply connecting\nevery peer to every other peer; this doesn't scale particularly well, but for\nthe toy examples we're running it's just fine. Don't expect to be able to run\nmore than about a hundred peers though without hitting OS limits on number of\nopen sockets.\n\nDue to the networked nature of the software it must handle a bunch of events in\nparallel. Mutexes are used to avoid race conditions, but the user-driven UI\ncannot hold a lock for the entire time it takes the user to enter payment\ndetails or the rest of the program would grind to a halt. For this reason,\nmaking a payment might occasionally fail if the underlying state changes while\nyou enter the payment details. This won't corrupt any internal data, so just\ntry the payment again.\n\nApplication state is not persisted in any way outside of memory. When a peer\nexits, its wallet is gone forever. When the last peer in a network exits, that\nblockchain and all its transactions are gone forever.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feapache%2Fgocoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feapache%2Fgocoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feapache%2Fgocoin/lists"}