forked from FloppyDisck/rs-merkle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a better readme, CONTRIBUTING.md and LICENSE.md files
- Loading branch information
Showing
3 changed files
with
85 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Contributing | ||
|
||
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change. | ||
|
||
## Pull Request Process | ||
|
||
- Please update the [tests](./tests) to reflect the changes. | ||
- Update any documentation comments if required. | ||
- Bump the version number and update the README.md to reflect the changes that this Pull Request would represent. The versioning scheme we use is SemVer. | ||
- You may merge the Pull Request in once you have the sign-off of the repo maintainer, or if you do not have permission to do that, you may request the second reviewer to merge it for you. | ||
|
||
Thank you! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Anton Suprunchuk | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,57 @@ | ||
# rs_merkle | ||
# rs-merkle | ||
|
||
`rs_merkle` is the most advanced Merkle Tree library for Rust. | ||
[![Rayon crate](https://img.shields.io/crates/v/rs_merkle.svg)](https://crates.io/crates/rs_merkle) | ||
[![Rayon documentation](https://docs.rs/rs_merkle/badge.svg)](https://docs.rs/rs_merkle) | ||
[![Build and test](https://github.com/antouhou/rs-merkle/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/antouhou/rs-merkle/actions) | ||
|
||
Basic features include creation and verification of merkle proofs from a set of leaves. | ||
This is often done in various cryptocurrencies. | ||
`rs-merkle` is the most advanced Merkle tree library for Rust. Basic features | ||
include building a Merkle tree, creation, and verification of Merkle proofs for | ||
single and several elements, i.e. multi-proofs. Advanced features include making | ||
transactional changes to the tree and rolling back to any previously committed | ||
tree state, similarly to Git. | ||
|
||
Advanced features include being able to make transactional changes to a tree with | ||
being able to roll back to any previous committed state of tree. This scenario is similar | ||
to Git and can be found in databases and file systems. | ||
`rs-merkle` is | ||
[available on crates.io](https://crates.io/crates/rs_merkle), and | ||
[API Documentation is available on docs.rs](https://docs.rs/rs_merkle/). | ||
|
||
Merkle Trees, also known as Hash Trees, are used to verify that two or more parties have | ||
the same data without exchanging the entire data collection. | ||
## About Merkle trees | ||
|
||
Merkle Trees are used in Git, Mercurial,ZFS, IPFS, Bitcoin, Ethereum, Cassandra and many more. | ||
In Git, for example, Merkle Trees are used to find a delta between the local and remote states, | ||
and transfer only the delta. In Bitcoin, Merkle Trees are used to verify that a transaction was | ||
included into the block without downloading the whole block contents. | ||
Merkle trees, also known as hash trees, are used to verify that two or more | ||
parties have the same data without exchanging the entire data collection. | ||
|
||
Merkle trees are used in Git, Mercurial, ZFS, IPFS, Bitcoin, Ethereum, Cassandra, | ||
and many more. In Git, for example, Merkle trees are used to find a delta | ||
between the local and remote repository states to transfer only the difference | ||
between them over the network. In Bitcoin, Merkle trees are used to verify that | ||
a transaction was included in the block without downloading the whole block | ||
contents. ZFS uses Merkle trees to quickly verify data integrity, offering | ||
protection from silent data corruption caused by phantom writes, bugs in disk | ||
firmware, power surges, and other causes. | ||
|
||
## Usage | ||
|
||
Add the following to your `Cargo.toml`: | ||
|
||
```toml | ||
[dependencies] | ||
rs_merkle = "0.2" | ||
``` | ||
|
||
## Documentation | ||
|
||
[Documentation is available on docs.rs](https://docs.rs/rs_merkle/). | ||
|
||
## Contributing | ||
|
||
Everyone is welcome to contribute in any way or form! For further details, | ||
please read [CONTRIBUTING.md](./CONTRIBUTING.md) | ||
|
||
## Authors | ||
- [Anton Suprunchuk](https://github.com/antouhou) - [Website](https://antouhou.com) | ||
|
||
Also, see the list of contributors who participated in this project. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the | ||
[LICENSE.md](./LICENSE.md) file for details |