Room-House.com Russia
  • SkyPirl (Pirl)
    • О SkyPirl
    • Создать кошелек SkyPirl 2.0
    • Как стать номинатором (Stake)
    • Запустить валидатор
    • как вывести средства со стейка
    • Как работает выплата
    • Как проголосовать за Совет
    • Как установить личность
    • косая черта
    • Refund of slashed
    • ХАРАКТЕРИСТИКИ МОНЕТ
    • Правительство и казначейство
    • Telemetry
    • Source Code
  • PIRLmeet
    • О PIRLmeet.com
    • Бесплатная пробная версия
    • CINEMA
    • Microphone On-Off
    • Демонстрация экрана
      • Поделитесь или не делитесь своим аудио
      • Учебное пособие по записи видео + камера + загрузка видео в формате mp4
    • Руки вверх
    • Изменить мелодию звонка при поднятии руки
    • Потоковое видео в формате MP4
    • Потоковое видео mp4 в браузере Firefox
    • Замок шкафа
      • Учетная запись блокировки кабинета
      • Как я могу «запереть шкаф» и не дать посторонним войти в комнату?
      • Как я могу добавить людей в комнату, когда комната заблокирована?
    • Подключить кошелек SkyPirl к PIRLmeet
    • Изменить обложку
    • Название видео
    • Настройка собственного PIRLmeet
    • Как скачать видео на ютуб, фейсбук и конвертировать в мп4 файлы
    • Используйте приложение для улучшения камеры во время прямой трансляции
    • PIRLmeet может организовывать встречи, которые длятся 24/7 и 365 дней в году.
    • Как PIRLmeet защищает продукты?
    • Получите монету Pirl при воспроизведении видео на PIRLmeet
    • Source Code
  • SkyPirl Light Wallet
  • Сообщество SkyPirl
  • Бизнес-парадигма R-H
  • Дорожная карта
  • Команда SkyPirl
  • хТер . Технологии
    • О xTER SafeContainer
    • xTer Экосистема
    • xTer SkyPirl
    • xTer Room-House
      • Как Room-House
    • xTer Room-House Plus
      • Как xTer room-House plus
    • xTer TrueAD
    • xTer SmartFilter
  • Белая бумага
  • Блог
    • Новости
      • ------ Что такое Web 1.0, 2.0, 3.0?------
      • Первый в мире децентрализованный аудиочат Room-House
      • Что такого особенного в децентрализованных аудиочатах?
      • Особенности, которые делают децентрализованные чаты Room-House.com конкурентоспособными с гигантами
      • Вы когда-нибудь слышали о децентрализованном благотворительном фонде?
      • Что такое онлайн-встреча? 4 самых эффективных решения для онлайн-конференций
      • Что такое онлайн-встреча? Легко или сложно организовать?
      • Каков стандарт профессиональной онлайн-комнаты для совещаний?
      • История первого в мире программного обеспечения для онлайн-конференций
      • Децентрализованное приложение Room-House.com (Daap)
      • В каком году родился интернет? И рождение проекта SkyPirl
      • Сотрудничество между Room-House и Российским государственным социальным университетом
    • Технические
      • Что такое биткойн? Как создаются биткойны?
      • Export Your Private Key from Third-Party Wallets
      • Что такое стейблкоин?
      • Что такое обернутый биткойн?
      • 7 способов получения пассивного дохода с помощью криптовалюты
      • Что такое децентрализованная социальная сеть?
      • Сколько биткойнов можно добыть за день?
      • Сколько биткойнов в мире?
      • Что такое децентрализованная биржа? отличается от централизованного этажа?
      • Что такое стейкинг? 5 вещей, которые следует учитывать при инвестировании в стейкинг
      • Что такое блокчейн-мосты?
      • Сравните горячий кошелек и холодный кошелек, какой из них вам следует использовать?
      • Что такое НФТ?
      • Создание децентрализованного интернета в космосе
      • Веб 3.0 Парадокс
      • Споры о будущем Интернета
      • Виртуальная вселенная метавселенной может произвести революцию в Интернете
      • «Блокчейн — самая влиятельная технология со времен Интернета»
      • Web3 - Ожидания от децентрализованного Интернета
      • Что такое дапп? Понятие Dapp и их классификация
      • Как децентрализованные веб-браузеры обеспечивают непревзойденную конфиденциальность
      • Web 3.0 раскручен?
      • Что такое узлы? Типы узлов в блокчейне
      • Блокчейн можно взломать или нет?
      • Что такое закрытый ключ и открытый ключ в биткойнах?
      • Что такое одноразовый номер в блокчейне?
      • Что такое децентрализованный автономный кооператив (DAC)?
      • Что такое Генезис Блок?
      • Что такое Веб3? Объяснение децентрализованного Интернета будущего
  • FAQ?
    • General
      • Getting Started
      • Claims
      • Redenomination of DOT
      • Grants
      • Polkadot Ambassador Programme
      • Research Pages
      • Community
      • Contributing
      • Contributors
      • Glossary
      • Adding accounts to an ENS domain
      • Ledger Application
      • How to Protect Yourself from Scams
      • How to Do Your Own Research
      • Thousand Validators Programme
      • Frequently Asked Questions (FAQs)
      • Miscellaneous
      • Programmes
        • Grants
        • Bug Bounty
        • Substrate Builders Program
        • Thousand Validators Programme
        • Thousand Contributors Programme
    • Learn
      • Basics
        • Token and Assets
          • Assets
          • DOT
          • NFTs
          • Statemint
          • Teleporting Assets
        • Components
          • Architecture
          • Collator
          • Consensus
          • Governance
          • Identity
          • Network Security
          • Nominator
          • Polkadot Host
          • PolkadotJS
          • W3F Registrar
          • Runtime Upgrades
          • Transaction Fees
          • Treasury
          • Validator
        • Staking
          • Staking Concepts
          • Staking FAQ
          • Nomination Pools
        • Account
          • Account Generation
          • Backing up and Restoring Accounts
          • Balance Transfers
      • Advanced
        • Availability and Validity
        • Cross-Consensus Message Format (XCM)
        • Sequential Phragmén Method
        • Proxy Accounts
        • Randomness
        • Simple Payouts
        • SPREE
        • WebAssembly (Wasm)
      • Cryptography
        • Cryptography Explainer
        • Keys
      • Paraobjects
        • Parachains
          • Common Good Parachains
          • Parachain Slots Auction
          • Parachain Crowdloans
          • Teleporting Assets
        • Parathreads
        • Bridges
      • Polkadot Comparisons
        • Polkadot and Kusama
        • Other Comparisons
        • Ethereum 2.0
        • Cosmos
      • Polkadot Lauch Phased
      • Video Tutorials
    • Build
      • Builder's Guides
      • Development Guide
        • Builders Starter's Guide
        • Parachain Development
        • Decentralized Storage Systems
        • Smart Contracts
        • Oracles
        • Data Analytics
        • Wallets
        • Substrate Connect
        • SS58 Registry
        • Opening HRMP Channels
      • Integration Guide
        • Polkadot Integration Guide
        • Polkadot Protocol Information
        • Integration Assets
        • Node Management
        • Node Interaction
        • Transaction Construction and Signing
      • Tool
      • Resources
    • Maintain
      • Network Maintainers
      • Parameters
      • Node Endpoints
      • Node And Dapps
        • Set up a Full Node
        • Networks
        • Set up Secure WebSocket for Remote Connections
        • Resolving Errors
      • Nominated Guides
        • Nominate
        • Unbonding and Rebonding
      • Validator Guides
        • How to run a Validator on Polkadot
        • Validator Payout Overview
        • Using systemd for a Validator Node
        • Secure Validator
        • How to use Polkadot Validator setup
        • Set Up a Validator with NGINX Reverse Proxy
        • How to Upgrade Your Validator
        • Monitor your node
        • How to Chill
        • How to Stop Validating
        • Validator Community Overview
      • Governance Guides
        • Participate in Democracy
        • Join the Council
        • Voting for Councillors
  • Agency policy
    • Information privacy policy
Powered by GitBook
On this page
  • Polkadot Keys
  • Account Keys​
  • Session Keys​
  • FAQ​
  • Resources​
  • Appendix A: On the security of curves​
  1. FAQ?
  2. Learn
  3. Cryptography

Keys

PreviousCryptography ExplainerNextParaobjects

Last updated 2 years ago

Polkadot Keys

Public and private keys are an important aspect of most crypto-systems and an essential component that enables blockchains like Polkadot to exist.

Account Keys

Account keys are keys that are meant to control funds. They can be either:

  • The vanilla ed25519 implementation using Schnorr signatures.

  • The Schnorrkel/Ristretto sr25519 variant using Schnorr signatures.

  • ECDSA signatures on secp256k1

There are no differences in security between ed25519 and sr25519 for simple signatures.

We expect ed25519 to be much better supported by commercial HSMs for the foreseeable future.

At the same time, sr25519 makes implementing more complex protocols safer. In particular, sr25519 comes with safer version of many protocols like HDKD common in the Bitcoin and Ethereum ecosystem.

"Controller" and "Stash" Keys

When we talk about "controller" and "stash" keys, we usually talk about them in the context of running a validator or nominating DOT, but they are useful concepts for all users to know. Both keys are types of account keys. They are distinguished by their intended use, not by an underlying cryptographic difference. All the info mentioned in the parent section applies to these keys. When creating new controller or stash keys, all cryptography supported by account keys are an available option.

The controller key is a semi-online key that will be in the direct control of a user, and used to submit manual extrinsics. For validators or nominators, this means that the controller key will be used to start or stop validating or nominating. Controller keys should hold some DOT to pay for fees, but they should not be used to hold huge amounts or life savings. Since they will be exposed to the internet with relative frequency, they should be treated carefully and occasionally replaced with new ones.

The stash key is a key that will, in most cases, be a cold wallet, existing on a piece of paper in a safe or protected by layers of hardware security. It should rarely, if ever, be exposed to the internet or used to submit extrinsics. The stash key is intended to hold a large amount of funds. It should be thought of as a saving's account at a bank, which ideally is only ever touched in urgent conditions. Or, perhaps a more apt metaphor is to think of it as buried treasure, hidden on some random island and only known by the pirate who originally hid it.

Since the stash key is kept offline, it must be set to have its funds bonded to a particular controller. For non-spending actions, the controller has the funds of the stash behind it. For example, in nominating, staking, or voting, the controller can indicate its preference with the weight of the stash. It will never be able to actually move or claim the funds in the stash key. However, if someone does obtain your controller key, they could use it for slashable behavior, so you should still protect it and change it regularly.

Session keys are hot keys that must be kept online by a validator to perform network operations. Session keys are typically generated in the client, although they don't have to be. They are not meant to control funds and should only be used for their intended purpose. They can be changed regularly; your controller only need create a certificate by signing a session public key and broadcast this certificate via an extrinsic.

Polkadot uses four session keys:

  • GRANDPA: ed25519

  • BABE: sr25519

  • I'm Online: sr25519

  • Parachain: sr25519

In the future, we plan to use a BLS key for GRANDPA because it allows for more efficient signature aggregation.

The original key derivation cryptography that was implemented for Polkadot and Substrate chains was ed25519, which is a Schnorr signature algorithm implemented over the Edward's Curve 25519 (so named due to the parameters of the curve equation).

CHOOSING SCHNORR SIGNATURES OVER ECDSA SIGNATURES

There is one sacrifice we make by choosing Schnorr signatures over ECDSA signatures for account keys: Both require 64 bytes, but only ECDSA signatures communicate their public key. There are obsolete Schnorr variants that support recovering the public key from a signature, but they break important functionality like hierarchical deterministic key derivation. In consequence, Schnorr signatures often take an extra 32 bytes for the public key.

But ultimately the benefits of using Schnorr signatures outweigh the tradeoffs, and future optimizations may resolve the inefficiencies pointed out in the quote above.

These exploits were due to one peculiarity in Ed25519, which is known as its cofactor of 8. The cofactor of a curve is an esoteric detail that could have dire consequences for the security of implementation of more complex protocols.

The implementation of Schnorr signatures that is used in Polkadot and implements the Schnorrkel protocols over the Ristretto compression of the Curve25519 is known as sr25519.

Not yet, but they will be. BLS signatures allow more efficient signature aggregation. Because GRANDPA validators are usually signing the same thing (e.g. a block), it makes sense to aggregate them, which can allow for other protocol optimizations.

FROM THE BLS LIBRARY'S README

Boneh-Lynn-Shacham (BLS) signatures have slow signing, very slow verification, require slow and much less secure pairing friendly curves, and tend towards dangerous malleability. Yet, BLS permits a diverse array of signature aggregation options far beyond any other known signature scheme, which makes BLS a preferred scheme for voting in consensus algorithms and for threshold signatures.

Even though Schnorr signatures allow for signature aggregation, BLS signatures are much more efficient in some fashions. For this reason it will be one of the session keys that will be used by validators on the Polkadot network and critical to the GRANDPA finality gadget.

The reason is the following: During summer of 2013, revelations from ex- consultant at [the] NSA Edward Snowden gave proof that [the] NSA willingly inserts backdoors into software, hardware components and published standards. While it is still believed that the mathematics behind ECC (Elliptic-curve cryptography) are still sound and solid, some people (including Bruce Schneier [SCHNEIER]), showed their lack of confidence in NIST-published curves such as nistp256, nistp384, nistp521, for which constant parameters (including the generator point) are defined without explanation. It is also believed that [the] NSA had a word to say in their definition. These curves are not the most secure or fastest possible for their key sizes [DJB], and researchers think it is possible that NSA have ways of cracking NIST curves. It is also interesting to note that SSH belongs to the list of protocols the NSA claims to be able to eavesdrop. Having a secure replacement would make passive attacks much harder if such a backdoor exists.

However an alternative exists in the form of Curve25519. This algorithm has been proposed in 2006 by DJB [Curve25519]. Its main strengths are its speed, its constant-time run time (and resistance against side-channel attacks), and its lack of nebulous hard-coded constants.

Session Keys

BABE requires keys suitable for use in a as well as for digital signatures. Sr25519 keys have both capabilities and so are used for BABE.

FAQ

Why was ed25519 selected over secp256k1?

Most cryptocurrencies, including Bitcoin and Ethereum, currently use ECDSA signatures on the secp256k1 curve. This curve is considered much more secure than NIST curves, which . The Curve25519 is considered possibly even more secure than this one and allows for easier implementation of Schnorr signatures. A recent patent expiration on it has made it the preferred choice for use in Polkadot.

The choice of using Schnorr signatures over using ECDSA is not so cut and dry. As stated in Jeff Burdges' (a Web3 researcher) on the topic:

What is sr25519 and where did it come from?

Some context: The Schnorr signatures over the Twisted Edward's Curve25519 are considered secure, however Ed25519 has not been completely devoid of its bugs. Most notably, were vulnerable to a double spend exploit that could have potentially led to undetected, infinite inflation.

Conveniently, provides a possible path forward to solving this potential bug. Decaf is basically a way to take Twisted Edward's Curves cofactor and mathematically change it with little cost to performance and gains to security.

The Decaf paper approach by the was extended and implemented in Rust to include cofactor-8 curves like the Curve25519 and makes Schnorr signatures over the Edward's curve more secure.

Web3 Foundation has implemented a Schnorr signature library using the more secure Ristretto compression over the Curve25519 in the repository. Schnorrkel implements related protocols on top of this curve compression such as HDKD, MuSig, and a verifiable random function (VRF). It also includes various minor improvements such as the hashing scheme STROBE that can theoretically process huge amounts of data with only one call across the Wasm boundary.

Are BLS signatures used in Polkadot?

Resources

- Forum post detailing a potential attack on BIP32-Ed25519. A motivation for transition to the sr25519 variant.

- Original forum post by Web3 researcher Jeff Burdges.

Appendix A: On the security of curves

FROM THE INTO libssl

​
​
​
Verifiable Random Function
​
​
have possible backdoors from the NSA
original forum post
​
Monero and all other CryptoNote currencies
Mike Hamburg's Decaf paper
Ristretto Group
Schnorrkel
​
​
Key discovery attack on BIP32-Ed25519
Account signatures and keys in Polkadot
Are Schnorr signatures quantum computer resistant?
​
INTRODUCTION OF CURVE25519