Skip to content
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions docs/ADR/0012-initial-precompiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# ADR_0012: Initial Precompiles

## Date

Decision date: YYYY-MM-DD
Last status update: YYYY-MM-DD

## Status

- [x] Proposed
- [ ] Accepted
- [ ] Deprecated
- [ ] Superseded

### Implementation Status

- [x] Planned
- [ ] In Development
- [ ] Implemented
- [ ] Verified
- [ ] Discontinued

## People

### Author/Decision Owner

- Alisher Khassanov, [@khssnv](https://github.com/khssnv)

### Consulted

### Informed

## Decision

We will create a set of initial precompiles for the smart contracts platform.

## Options

### Option 1: [Name of option] (SELECTED)

[Brief description of this option.]

**Selected because:**

- [Benefit 1 that led to selection]
- [Benefit 2 that led to selection]

**Selected despite:**

- [Drawback 1 that we accept]
- [Drawback 2 that we accept]

**Risks and Mitigations:**

- [Risk 1]
- [Mitigation strategy 1]
- [Risk 2]
- [Mitigation strategy 2]

**Failure Recovery:**
[How will we recover if this option fails?]

### Option 2: Expose governance functionality to smart contracts

See <https://github.com/paritytech/polkadot-sdk/issues/8366>.

**Rejected because:**

- Implementation already taken by Polkadot Technical Fellowship member.

**Rejected despite:**

- [Potential benefit 1 we're giving up]
- [Potential benefit 2 we're giving up]

### Option 3: ERC721, ERC1155 for `pallet-nfts`

**Rejected because:**

- Not related to QF Network priorities.

### Option 4: Utility pallets interface

- `pallet-scheduler` for scheduling runtime calls to occur at a specified block number or at a specified period.
- `pallet-multisig` to access existing multisig functionality from a smart contract.
- `pallet-indices` for smart contracts to be able to use short form address.

### Option 5: XCM precompile

- Proxy to Ethereum smart contracts. Data availability restrictions.

## Advice (Optional)

[Raw, unfiltered contributions from people who offered advice. his section provides transparency into the decision process and serves as a learning resource.]

- [Advice given] ([Advice-giver's name, role], YYYY-MM-DD)
- [Advice given] ([Advice-giver's name, role], YYYY-MM-DD)

Copy link
Member

@AlexLgn AlexLgn Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Avoid using centralized randomness sources, or at least not as a default, due to potential for accusations and reliance on external services (Denis Pisarev, 2025-07-23)
- Any quantum randomness solution for blockchains will require to be decentralized by default (Denis Pisarev, 2025-07-23)
- Pursue the implementation of the governance precompile, acknowledging that it is not yet fully specced and may require further specification (Denis Pisarev, 2025-07-23)
- Consider XCM and governance precompiles as a second priority (Denis Pisarev, 2025-07-23, Alisher Khassanov)

## Glossary

- **Precompile**: runtime function available to smart contracts via a cross-contract call.

## References

- Revive project review, <https://coda.io/d/_df6rzXCWZj8/Revive-project-review_suwtiLjr>.
- How precompiles work, <https://coda.io/d/QF-Network_df6rzXCWZj8/How-precompiles-work_supZxHtN>.
- Governance for modifying precompiles set, <https://coda.io/d/_df6rzXCWZj8/Governance-for-modifying-precompiles-set_suEXoFy->.