{"id":16163816,"url":"https://github.com/sug0/bafomet","last_synced_at":"2025-10-10T16:41:03.982Z","repository":{"id":98037358,"uuid":"510072059","full_name":"sug0/bafomet","owner":"sug0","description":"A modular and efficient BFT SMR implementation in Rust","archived":false,"fork":false,"pushed_at":"2024-01-23T16:40:54.000Z","size":1909,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-13T08:54:16.628Z","etag":null,"topics":["bft","consensus","distributed-systems","middleware","rust","state-machine-replication"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sug0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2022-07-03T16:09:13.000Z","updated_at":"2023-07-20T05:31:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"d1e8b3a3-7f52-4242-9c36-872f3460df93","html_url":"https://github.com/sug0/bafomet","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sug0%2Fbafomet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sug0%2Fbafomet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sug0%2Fbafomet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sug0%2Fbafomet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sug0","download_url":"https://codeload.github.com/sug0/bafomet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595374,"owners_count":20963942,"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":["bft","consensus","distributed-systems","middleware","rust","state-machine-replication"],"created_at":"2024-10-10T02:44:31.760Z","updated_at":"2025-10-10T16:40:58.930Z","avatar_url":"https://github.com/sug0.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Evil Byzantine fault tolerant middleware library/framework!\n\nThis project forks an early version of [FeBFT](https://github.com/SecureSolutionsLab/febft).\n\n---\n\n# A bit of context\n\n`bafomet` is an efficient BFT SMR middleware library implementation, directly descendant\nof protocols such as PBFT and BFT-SMaRt, where a static group of `n = 3f + 1` nodes\nare responsible for replicating a service, that is usually exposed via a RPC interface.\nThe properties of these systems are such that despite the failure of (up to) `f` nodes\n(due to software bugs, power outages, malicious attackers, etc) the service abstraction\nwill continue operating as usual.\n\nDifferent from prior art in this field, usually implemented in Java, Rust was\nthe language of choice to implement all the typical SMR sub-protocols present\nin `bafomet`. Many people are (rightfully so!) excited about the use of Rust\nin new (and even older) software, because of its safety properties associated\nwith the many compile time checks present in the compiler, that are able to\nhunt down common use-after-free as well as concurrency related bugs.\n\nThere are infinitely many use cases for BFT systems, which will undoubtedly improve the\navailability of a digital service. However, a less robust class of systems, called CFT\nsystems, are often utilized in place of BFT systems, based on their greater performance.\nDespite this, with the evolution of hardware, and especially the growing popularity of\nblockchain technology, BFT systems are becoming more attractive to distributed system\ndevelopers.\n\nPeople who are interested in the inner workings of these protocols can\nconsult the following papers:\n\n* Castro, Miguel, and Barbara Liskov. \"Practical Byzantine fault tolerance and proactive recovery.\" ACM Transactions on Computer Systems (TOCS) 20.4 (2002): 398-461.\n* Bessani, Alysson, Joao Sousa, and Eduardo EP Alchieri. \"State machine replication for the masses with BFT-SMART.\" 2014 44th Annual IEEE/IFIP International Conference on Dependable Systems and Networks. IEEE, 2014.\n\n\u003c!-- TODO: include link to thesis --\u003e\nTo read more about the architecture of `bafomet`, a MsC thesis describing it\nin detail is available upon request. Please contact `t1ag0_ at outlook.com`\nif you want a copy.\n\n# How to use this library?\n\nGenerally, to use this library, you will need to implement the following trait:\n\n```rust\npub trait Service {\n    /// The data types used by the application and the SMR protocol.\n    ///\n    /// This includes their respective serialization routines.\n    type Data: SharedData;\n\n    /// Returns the initial state of the application.\n    fn initial_state(\u0026mut self) -\u003e Result\u003cState\u003cSelf\u003e\u003e;\n\n    /// Process a user request, producing a matching reply,\n    /// meanwhile updating the application state.\n    fn update(\n        \u0026mut self,\n        state: \u0026mut State\u003cSelf\u003e,\n        request: Request\u003cSelf\u003e,\n    ) -\u003e Reply\u003cSelf\u003e;\n}\n```\n\nYou may want to check out [client-local.rs](examples/client-local.rs) and\n[replica-local.rs](examples/replica-local.rs) for examples of how to write\nservices utilizing `bafomet`. Run them with:\n\n```\n# Start the service replicas in a terminal window\n$ cargo run --release --example replica-local\n\n# In another terminal window, start the client(s)\n$ cargo run --release --example client-local\n```\n\n# For contributors\n\nThe code is organized as follows:\n\n* `src/bft/core/client` is the main entry point for a client.\n* `src/bft/core/server` is the main entry point for a replica.\n* `src/bft/consensus` implements the normal phase consensus code.\n* `src/bft/consensus/log` implements the message log.\n* `src/bft/sync` implements the view change code.\n* `src/bft/cst` implements the state transfer code.\n* `src/bft/communication` and its sub-modules implement the network code.\n* `src/bft/executable` implements the thread responsible for running the\n  user's application code.\n* `src/bft/ordering` defines code for sequence numbers resistant to overflows.\n\nOther modules should be somewhat self explanatory, especially if you read\nthe documentation generated with `cargo doc --features expose_impl` for `bafomet`.\n\n# Licensing\n\nChoose the MIT or Apache license at your option!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsug0%2Fbafomet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsug0%2Fbafomet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsug0%2Fbafomet/lists"}