33Iroha 2 is a complete re-write of Hyperledger Iroha in Rust. As of writing
44the two projects are developed concurrently.
55
6+ Here we aspire to outline the differences between two versions of Iroha and
7+ highlight the new features of Iroha 2. This introduction should be of
8+ particular interest to those who are already familiar with Iroha but wish
9+ to upgrade and start using the newer version.
10+
11+ <!-- This list of headlining features goes on. As we are nearing our first
12+ long-term supported preview release, we'll be updating the guide with
13+ relevant changes. -->
14+
615## Fault Tolerance
716
817Iroha 2 learned a great deal from the development of the original Iroha. Of
918particular importance is the new and improved Byzantine-fault-tolerant
1019consensus algorithm: _ Sumeragi_ . This new consensus allowed us to expand
11- what could be done on a blockchain, without any security risks.
20+ what could be done on a blockchain without any security risks.
1221
1322::: info
1423
15- The first version of Iroha used a consensus algorithm called _ Yac_ . It is
16- _ crash-fault-tolerant_ , which means that it can survive a set number of
24+ The first version of Iroha used a consensus algorithm called _ Yac_ . _ Yac _
25+ is _ crash-fault-tolerant_ , which means that it can survive a set number of
1726nodes _ crashing_ : i.e. losing power, being cut off from the network, or
18- being destroyed with a sledgehammer. _ Sumeragi_ , by contrast, was designed
19- to be _ Byzantine-fault-tolerant_ . This means that Iroha 2 can tolerate not
20- only peers being inactive on the network, but also running malicious
21- software, and actively trying to falsify data in the blockchain.
27+ being destroyed with a sledgehammer.
28+
29+ _ Sumeragi_ , by contrast, was designed to be _ Byzantine-fault-tolerant_ .
30+ This means that Iroha 2 can tolerate not only peers being inactive on the
31+ network, but also running malicious software and actively trying to falsify
32+ data in the blockchain.
2233
23- We can mathematically prove that ** Iroha 2 can work when up to 33% of its
24- nodes are actively trying to stop Iroha 2 from working properly** ( _ or at
25- all _ ). In other words, even if someone gained control of a _ third_ of all
26- of your network nodes, an Iroha 2 deployment is _ mathematically guaranteed_
27- to keep working.
34+ We can mathematically prove that Iroha 2 can work when ** up to 33%** of its
35+ nodes are actively trying to stop Iroha 2 from working properly or at all.
36+ In other words, even if someone gained control of a _ third_ of all of your
37+ network nodes, an Iroha 2 deployment is _ mathematically guaranteed_ to keep
38+ working.
2839
2940:::
3041
3142## Minimalist Code Base
3243
3344Iroha 2 is a minimalist code base. We take great care to vet our
34- dependencies, and avoid large inter-dependent chunks of code. We provide a
35- few telemetry APIs, including ` prometheus ` tooling, structured logging in
36- JSON, as well as compatibility with
37- [ standard tools] ( https://wiki.sora.org/sora-faq ) used in Parity Substrate.
38- Our data is strongly-typed, and our methods — statically dispatched. We
39- make use of the best that Rust has to offer: ` serde ` and
40- ` parity_scale_codec ` for serialisation, ` tokio ` for co-operative
41- multi-threading, as well as wealth of testing, bench-marking, static
42- analysis and code auditing tools that come packaged with the exemplary
43- ` cargo ` . Our code is easy to reason about, and quick to compile, whilst
44- also being ergonomic to use and thoughtfully crafted. We have no ` panics `
45- and no ` unsafe ` code.
45+ dependencies and avoid large inter-dependent chunks of code.
46+
47+ We provide a few telemetry APIs, including ` prometheus ` tooling, structured
48+ logging in JSON, as well as compatibility with standard tools used in
49+ Parity Substrate.
50+
51+ Our data is strongly-typed, our methods are statically dispatched. We make
52+ use of the best that Rust has to offer: ` serde ` and ` parity_scale_codec `
53+ for serialisation, ` tokio ` for co-operative multi-threading, as well as
54+ testing, bench-marking, static analysis and code auditing tools that come
55+ packaged with the exemplary ` cargo ` .
56+
57+ Our code is easy to reason about, and quick to compile, whilst also being
58+ ergonomic to use and thoughtfully crafted. We have no ` panics ` and no
59+ ` unsafe ` code.
4660
4761## Flexibility
4862
49- Iroha 2 is also more flexible than the original Iroha due to modular
50- design. It is possible to add or remove features based on the particular
51- use-case. If you want to be extremely fast, and work on embedded hardware,
63+ Iroha 2 is also more flexible than the original Iroha due to its modular
64+ design.
65+
66+ It is possible to add or remove features based on a particular use-case. If
67+ you want the blockchain to be extremely fast and work on embedded hardware,
5268just compile Iroha 2 without the ` expensive-metrics ` feature. Don't use
5369telemetry at all? Remove it entirely and enjoy even more performance.
54- _ Permission_ sets are plugins that can be upgraded during run-time. We have
55- an extensive module system as well as a robust WASM runtime framework.
70+ _ Permission_ sets are plugins that can be upgraded during run-time.
71+
72+ We have an extensive module system as well as a robust WASM runtime
73+ framework.
5674
5775## Smart Contracts
5876
5977Iroha 2 is an event-driven ledger. Each change in the state of the
6078blockchain is necessarily accompanied by its own event that can _ trigger_ a
61- smartcontract : complex logic designed for use in on-chain scripting.
79+ smart contract : complex logic designed for use in on-chain scripting.
6280
6381For smart contracts, Iroha 2 supports two approaches:
6482
6583- [ Iroha Special Instructions (ISI)] ( ./advanced/isi.md )
6684- [ Web ASseMbly (WASM)] ( ./advanced/wasm.md )
6785
68- The first approach is useful when you want very simple transparent logic,
69- and want to minimise the footprint in the blockchain. All interactions with
70- the _ World state_ , that is, the state of the blockchain at this point in
71- time, has to be done using the aforementioned instructions. There is also
72- rudimentary support for domain-specific conditional logic.
86+ The first approach is useful when you want very simple transparent logic
87+ and also want to minimise the footprint in the blockchain. All interactions
88+ with the _ World state_ , that is, the state of the blockchain at this point
89+ in time, has to be done using the aforementioned instructions. There is
90+ also rudimentary support for domain-specific conditional logic.
7391
74- If you want to learn more about smartcontracts in Iroha 2, please consult
92+ If you want to learn more about smart contracts in Iroha 2, please consult
7593our
7694[ Wiki] ( https://wiki.hyperledger.org/display/iroha/Scripting+Languages+and+Runtimes+for+Iroha2+Smart+Contracts ) .
7795
82100Iroha 2 smartly chooses when to use dynamic linking. This strikes a balance
83101between it being easy to patch a Critical security vulnerability in a
84102vendored library like OpenSSL, but also remaining reproducible and portable
85- across platforms, architectures and deployments.
103+ across platforms, architectures, and deployments.
86104
87105::: info
88106
@@ -97,11 +115,12 @@ Iroha after an upgrade.
97115## Testing
98116
99117Iroha 2 is extensively tested. Despite being in active development, Iroha
100- has 80% line coverage (keep in mind, line coverage includes documentation
101- comments, some of which are also tests). There are plans to include Fuzz
102- testing, property-based testing and failure-point testing to ensure that
103- Iroha is reliable.
118+ has 80% line coverage. Keep in mind that line coverage includes
119+ documentation comments, some of which are also tests.
104120
105- The list of headlining features goes on. As we are nearing our first
106- long-term supported preview release, we'll be updating the guide with
107- relevant changes.
121+ ::: info
122+
123+ There are plans to include Fuzz testing, property-based testing, and
124+ failure-point testing to ensure that Iroha is reliable. <!-- Check -->
125+
126+ :::
0 commit comments