You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ADR/0013-native-rust-sdk-for-smart-contracts.md
+25-58Lines changed: 25 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,9 @@
1
-
# ADR Template
2
-
3
-
## ADR_[ADR_id]: [Descriptive title of the architectural decision]
4
-
5
-
*Note: This template maintains the Reader-focused design principle. Template sections can be completed out of order. Recommended sequence: Date → Status → People → Context → Consequences → Options → Decision. See ADR Guide for detailed working methods.*
1
+
# ADR_0013: Native Rust SDK for smart contracts
6
2
7
3
## Date
8
4
9
-
Decision date: YYYY-MM-DD
10
-
Last status update: YYYY-MM-DD
5
+
Decision date: YYYY-MM-DD.
6
+
Last status update: 2025-07-23.
11
7
12
8
## Status
13
9
@@ -26,58 +22,41 @@ Last status update: YYYY-MM-DD
26
22
27
23
## People
28
24
29
-
### Author/Decision Owner (Single Point of Accountability)
30
-
31
-
[Name of person or team accountable for this decision and point of contact for questions]
25
+
### Author/Decision Owner
32
26
33
-
-[Person 1]
34
-
-[Person 2]
35
-
-[Person 3]
27
+
Alisher Khassanov, [@khssnv](https://github.com/khssnv).
36
28
37
29
### Consulted (Subject Matter Experts)
38
30
39
-
[List of people with relevant expertise who provided advice]
40
-
41
-
-[Person 1]
42
-
-[Person 2]
43
-
-[Person 3]
44
-
45
-
### Informed (Affected Parties)
46
-
47
-
[People/teams affected by this decision who should be aware]
*Note: People listed in "Informed" should submit a PR to check their name after reading this ADR. This can be done during the initial review process of the ADR upload/commit PR (when the file is first uploaded to GitHub and the author requests reviews), or in a separate PR after the ADR is merged.*
36
+
-[ ] Alex Vyatkin, [@actinfer](https://github.com/actinfer).
37
+
-[ ] Alexander Lygin, [@alexlygin](https://github.com/AlexLgn).
[Briefly describe the decision made in "We will..." format. This section should be concise - it's a declaration of intent for implementers. Detailed reasoning belongs in other sections.]
42
+
We will develop a native Rust SDK for PolkaVM and Revive project smart contracts, focusing on delivering a developer-friendly and ergonomic API.
58
43
59
44
## Context
60
45
61
-
[Describe the situation that calls for a decision. Focus on forces, constraints, and circumstances that led to needing this decision. Answer "What is the problem?" not "What's the solution?" Include:
46
+
- The official Polkadot documentation, <https://docs.polkadot.com/develop/smart-contracts/>, offers ink! as the Rust option for smart contracts development. The other option offered is Solidity.
62
47
63
-
- Technical, business, and organizational context
64
-
- Applicable requirements (functional and cross-functional)
65
-
- Current state and why change is needed
66
-
- Key stakeholders and their concerns]
48
+
- Native Rust smart contracts for PolkaVM exist only as test fixtures within the Polkadot SDK, see <https://github.com/paritytech/polkadot-sdk/tree/7a747ff/substrate/frame/revive/fixtures/contracts>.
67
49
68
-
### Decision Criteria (Optional)
50
+
- The QF Network's `qf-polkavm-sdk` project has a minimal set of abstractions, example contracts, and a CLI tool for deploying and invoking smart contracts, see <https://github.com/QuantumFusion-network/qf-polkavm-sdk/tree/850e169/>.
69
51
70
-
[Explicit criteria for evaluating options, such as:
52
+
## Problem
71
53
72
-
- Performance requirements
73
-
- Cost constraints
74
-
- Security requirements
75
-
- Maintainability needs
76
-
- Time-to-market considerations]
54
+
Developing native Rust smart contracts currently faces several challenges due to limitations in the platform's public API.
77
55
78
-
## Problem (Optional)
79
-
80
-
[Clearly state the problem being addressed. What issue or opportunity requires this architectural decision?]
56
+
- Leaky abstractions. Smart contracts must directly interact with both PolkaVM and `pallet-revive` entities, exposing internal implementation details.
57
+
- Excessive boilerplate. Developers need to repeatedly write similar code across different contracts.
58
+
- Insufficient separation of concerns. Smart contract authors are required to handle low-level operations, rather than focusing solely on business logic.
59
+
- Non-ergonomic API.
81
60
82
61
## Decision in Details (Optional)
83
62
@@ -88,24 +67,14 @@ Last status update: YYYY-MM-DD
88
67
- Timeline considerations
89
68
- Who is responsible for implementation]
90
69
91
-
### Decision Drivers (Optional)
70
+
### Decision Drivers
92
71
93
-
-[Driver 1: Key force or requirement influencing the decision]
94
-
-[Driver 2: Another key consideration]
95
-
-[...]
72
+
- Why are we doing this?
73
+
- Why ink! isn't a sufficient replacement for Rust? What's the niche for native Rust smart contracts?
96
74
97
75
## Options
98
76
99
-
[Briefly list the considered options. Each option is numbered for easy reference, with the selected option marked clearly as `(SELECTED)`. Aim for 3-5 options minimum. Always include at least "do nothing" option. A detailed description of each option can be written in the Consequences section below.]
100
-
101
-
1. (SELECTED) [Name of selected option]
102
-
2.[Name of alternative option]
103
-
3.[Name of alternative option]
104
-
4.[Do nothing / Status quo option]
105
-
106
-
## Consequences (Optional)
107
-
108
-
### Option 1: [Name of option] (SELECTED)
77
+
### Option 1: Native Rust SDK for smart contracts
109
78
110
79
[Brief description of this option.]
111
80
@@ -143,8 +112,6 @@ Last status update: YYYY-MM-DD
143
112
-[Potential benefit 1 we're giving up]
144
113
-[Potential benefit 2 we're giving up]
145
114
146
-
*(Repeat for additional options if applicable)*
147
-
148
115
## Implementation Notes (Optional)
149
116
150
117
[Any specific guidance for implementing this decision, including:
0 commit comments