3
3
Iroha 2 is a complete re-write of Hyperledger Iroha in Rust. As of writing
4
4
the two projects are developed concurrently.
5
5
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
+
6
15
## Fault Tolerance
7
16
8
17
Iroha 2 learned a great deal from the development of the original Iroha. Of
9
18
particular importance is the new and improved Byzantine-fault-tolerant
10
19
consensus 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.
12
21
13
22
::: info
14
23
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
17
26
nodes _ 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.
22
33
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.
28
39
29
40
:::
30
41
31
42
## Minimalist Code Base
32
43
33
44
Iroha 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.
46
60
47
61
## Flexibility
48
62
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,
52
68
just compile Iroha 2 without the ` expensive-metrics ` feature. Don't use
53
69
telemetry 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.
56
74
57
75
## Smart Contracts
58
76
59
77
Iroha 2 is an event-driven ledger. Each change in the state of the
60
78
blockchain 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.
62
80
63
81
For smart contracts, Iroha 2 supports two approaches:
64
82
65
83
- [ Iroha Special Instructions (ISI)] ( ./advanced/isi.md )
66
84
- [ Web ASseMbly (WASM)] ( ./advanced/wasm.md )
67
85
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.
73
91
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
75
93
our
76
94
[ Wiki] ( https://wiki.hyperledger.org/display/iroha/Scripting+Languages+and+Runtimes+for+Iroha2+Smart+Contracts ) .
77
95
82
100
Iroha 2 smartly chooses when to use dynamic linking. This strikes a balance
83
101
between it being easy to patch a Critical security vulnerability in a
84
102
vendored library like OpenSSL, but also remaining reproducible and portable
85
- across platforms, architectures and deployments.
103
+ across platforms, architectures, and deployments.
86
104
87
105
::: info
88
106
@@ -97,11 +115,12 @@ Iroha after an upgrade.
97
115
## Testing
98
116
99
117
Iroha 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.
104
120
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