{"id":18772409,"url":"https://github.com/shu223/blockchainswift","last_synced_at":"2025-04-06T02:09:31.918Z","repository":{"id":140525474,"uuid":"116793816","full_name":"shu223/BlockchainSwift","owner":"shu223","description":"A simple Blockchain with Swift","archived":false,"fork":false,"pushed_at":"2024-05-04T00:44:31.000Z","size":178,"stargazers_count":366,"open_issues_count":0,"forks_count":25,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-30T01:06:16.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","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/shu223.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["shu223"],"custom":["https://paypal.me/shu223"]}},"created_at":"2018-01-09T09:19:02.000Z","updated_at":"2025-03-25T17:38:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"662ab03b-8927-4468-8b72-6e9a61c13492","html_url":"https://github.com/shu223/BlockchainSwift","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/shu223%2FBlockchainSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shu223%2FBlockchainSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shu223%2FBlockchainSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shu223%2FBlockchainSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shu223","download_url":"https://codeload.github.com/shu223/BlockchainSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"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-07T19:28:55.208Z","updated_at":"2025-04-06T02:09:31.900Z","avatar_url":"https://github.com/shu223.png","language":"Swift","readme":"# BlockchainSwift\n\nA simple Blockchain with Swift.\n\n[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat\n)](http://mit-license.org)\n[![Twitter](https://img.shields.io/badge/twitter-@shu223-blue.svg?style=flat)](http://twitter.com/shu223)\n\n## What is this?\n\nThis is an implementation of Blockchain with Swift based on **this great article**:\n\n[Learn Blockchains by Building One – Hacker Noon](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)\n\n\n## How to build\n\n- Open `BlockchainSwift.xcodeproj` with Xcode\n- Build and Run!\n\n![](blockchainsample.gif)\n\n## What is interesting?\n\nJust seeing the sample app is NOT fun at all. Trying to implement by yourself according to the reference articles would be fun :)\n\nThe implementation is quite simple, **less than 200 lines**.\n\nFor example, Here is the `Block`:\n\n```swift:Block.swift\nstruct Block: Codable {\n    let index: Int\n    let timestamp: Double\n    let transactions: [Transaction]\n    let proof: Int\n    let previousHash: Data\n\n    // Hashes a Block\n    func hash() -\u003e Data {\n        let encoder = JSONEncoder()\n        let data = try! encoder.encode(self)\n        return data.sha256()\n    }\n}\n```\n\nHere are the articles:\n\n- [Learn Blockchains by Building One – Hacker Noon](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)\n\n\n日本語版（Python）:\n\n- [ブロックチェーンを作ることで学ぶ 〜ブロックチェーンがどのように動いているのか学ぶ最速の方法は作ってみることだ〜](https://qiita.com/hidehiro98/items/841ece65d896aeaa8a2a)\n\n日本語版（Swift）:\n\n- [Swiftでブロックチェーンを実装してみる](https://qiita.com/shu223/items/ebe59325f36fbf25e3d6)\n\n\n*The \"Consensus\" part is available in the [feature/consensus](https://github.com/shu223/BlockchainSwift/tree/feature/consensus) branch.\n","funding_links":["https://github.com/sponsors/shu223","https://paypal.me/shu223"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshu223%2Fblockchainswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshu223%2Fblockchainswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshu223%2Fblockchainswift/lists"}