{"id":19879511,"url":"https://github.com/pvlbzn/blockchan","last_synced_at":"2025-08-05T04:16:15.161Z","repository":{"id":260192357,"uuid":"98916832","full_name":"pvlbzn/blockchan","owner":"pvlbzn","description":"Blockchain implementation","archived":false,"fork":false,"pushed_at":"2017-08-03T20:03:58.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T02:41:23.676Z","etag":null,"topics":["blockchain","cryptography"],"latest_commit_sha":null,"homepage":"","language":"Go","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/pvlbzn.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-31T18:20:37.000Z","updated_at":"2018-02-02T19:16:16.000Z","dependencies_parsed_at":"2024-10-30T03:52:27.074Z","dependency_job_id":null,"html_url":"https://github.com/pvlbzn/blockchan","commit_stats":null,"previous_names":["pvlbzn/blockchan"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pvlbzn/blockchan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fblockchan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fblockchan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fblockchan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fblockchan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvlbzn","download_url":"https://codeload.github.com/pvlbzn/blockchan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fblockchan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268832577,"owners_count":24314432,"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","status":"online","status_checked_at":"2025-08-05T02:00:12.334Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","cryptography"],"created_at":"2024-11-12T17:08:44.187Z","updated_at":"2025-08-05T04:16:15.132Z","avatar_url":"https://github.com/pvlbzn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blockchain Implementation\n\nCode prior to this [point](https://github.com/pvlbzn/blockchan/tree/a22d842dbaad3232bbb9758d0e2697749618dbea)\nwas written at my housewarming party knowing little about blockchain. Later commits contains refactoring\non a sober mind.\n\n\n### Architecture\n\nBlocks are chosen to be stored as files in a file system rather than in memory (runtime) data structure.\nFiles are less abstract and more concrete so that one can see the content of a block straight away.\n\nBlocks are stored in `blocks` directory and they are named `{0..n}.block`. `0.block` is a genesis block\nand should not be changed.\n\nA number of transactions in a block is currently from 1 to n.\n\n\n### `block` Package\n\nBlock package implements core block chain logic: `Block`, `Transaction` and their methods.\n\n```Go\n// Create a new block\nb, err := block.NewBlock()\nif err != nil {\n    // handle it\n}\n\n// Add a transaction into the block\nb.AddTransaction(block.NewTransaction(\"from\", \"to\", amount))\n\n// \"perform\" transaction\nb.Write()\n\nstatus, err := block.ValidateChain()\nif err != nil {\n    // handle it\n}\n\nfmt.Println(status)   // Should be true\n```\n\nTo parse some block out of the file into runtime memory layout (data structure) one should\nuse `func Read(n int) (*Block, error)` function. It will parse `n`th block into `Block`\nstructure.\n\n\n### Future Hackaton Plan\n\n* Web server/interface to blockchain\n    * Transaction queue\n    * Transaction processing\n    * Public API\n* Form a cryptocurrency on top of blockchain\n    * Nonce\n    * Rules\n* Parallel mining software\n    * Find a hash to transaction\n    * Send a hash to public API\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvlbzn%2Fblockchan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvlbzn%2Fblockchan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvlbzn%2Fblockchan/lists"}