Repository navigation
sr25519 accounts next to ED25519, as the optional [sr25519] extra: keys, extrinsic signing, ECIES encryption for the report envelope, and import of a wallet's JSON backup. The 3.0 API only grows; Keypair.from_mnemonic(m) still gives the ED25519 address, and every ED25519 package, signature and extrinsic is what 3.0.0 produced. The core installs and works without the extra.
pip install 'robonomics-interface[sr25519]'- Migration guide, section 9 (sr25519): MIGRATION.md
- Documentation: https://airalab.github.io/robonomics-interface/
- The full list of changes is in the changelog under 3.1.0rc1; 3.1.0 has the code of 3.1.0rc1.
Added
- The
[sr25519]extra (py-sr25519-bindings,rbcl; wheels for musl and aarch64,
no compiler), imported lazily: without it, an sr25519 key raises anImportError
that names the extra. SR25519next toED25519,Keypair.crypto_type, and a keyword-only
crypto_type=(the constant or"sr25519") onfrom_seed,from_mnemonic,
from_uri,from_secret,from_public_keyandfrom_address. Addresses, derivation
paths (//,/,///password) and signatures match substrate-interface and
polkadot.js. The default stays ED25519.- Extrinsics signed with sr25519 keys; the
MultiSignaturevariant comes from the key. Keypair.encrypt_message/decrypt_messagefor sr25519: the ECIES scheme of
py-sr25519-encryption(Ivan Berman) and SubMessage, the same bytes, so blobs open in
both and in polkadot.js. Every failure is aDecryptionError; the MAC is checked
before decrypting. The scheme does not authenticate the sender.- The report envelope for sr25519: the type of a package is the type of the sender's
key; a mixed recipient list raisesRecipientError, and opening with a key of the
wrong type raisesPayloadErrorthat names the mismatch. Keypair.from_json(backup, password): import of a polkadot.js keyring backup
(version 3), ED25519 or sr25519 as the file says. Scrypt parameters are limited to
those polkadot.js accepts.
Changed
- The development-chain tests run for both key types and include an encrypted report
end to end. They still use the runtime v50 wasm (Sudo is needed to set the RWS
oracle); mainnet runs spec 53, where Sudo is gone, OpenGov and CPS v1.1 are in, and
Datalog, RWS, System, Balances and the signed extensions are unchanged. The mainnet
smoke test passes on 53 for both key types. - CI runs the tests with and without the extra, and in
python:3.13-alpineon aarch64
and x86_64 without a compiler.
Checked
- On Polkadot with 3.1.0rc1 installed from PyPI: an sr25519 account wrote two datalog
records, read them back, and an sr25519 integrator opened an encrypted report whose
id it read from the datalog. A report for a recipient of the other key type is refused. - CI installs the wheel with
[sr25519]inpython:3.13-alpineon aarch64 and x86_64
without a compiler, and runs the core without the extra.