Last active
May 24, 2023 02:19
-
-
Save nuke-web3/f8a9e80e6b2f9429a7fe7c1e0173c484 to your computer and use it in GitHub Desktop.
PBA Signature Demos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Subkey Signature and HDKD (Hierarchical Deterministic Key Derivation) Demo
All the subkey examples also exist in a jupyter notebook for reference.
As an alternative, here are subkey examples to compliment/replace using the REPL.
Key Generation
Sign
Verify
Tamper with the Message
Hard Derivation
Soft Derivation from Secret
Soft Derivation from Public
Note: We use addresses here because Subkey does not derive paths from a raw public key (AFAIK).
subkey inspect 12mzv68gS8Zu2iEdt4Ktkt48JZSKyFSkAVjvtgYhoa42NLNa/0 Public Key URI `12mzv68gS8Zu2iEdt4Ktkt48JZSKyFSkAVjvtgYhoa42NLNa/0` is account: Network ID/Version: polkadot Public key (hex): 0x40f22875159420aca51178d1baf2912c18dcb83737dd7bd39dc6743da326dd1c Account ID: 0x40f22875159420aca51178d1baf2912c18dcb83737dd7bd39dc6743da326dd1c Public key (SS58): 12UA12xuDnEkEsEDrR4T4Cf3S1Hyi2C7B6hJW8LTkcsZy8BX SS58 Address: 12UA12xuDnEkEsEDrR4T4Cf3S1Hyi2C7B6hJW8LTkcsZy8BX
subkey inspect 12mzv68gS8Zu2iEdt4Ktkt48JZSKyFSkAVjvtgYhoa42NLNa/1 Public Key URI `12mzv68gS8Zu2iEdt4Ktkt48JZSKyFSkAVjvtgYhoa42NLNa/1` is account: Network ID/Version: polkadot Public key (hex): 0xc62ec5cd7d83e1f41462d455bb47b6bad9ed5a14741a920ead8366c63746391b Account ID: 0xc62ec5cd7d83e1f41462d455bb47b6bad9ed5a14741a920ead8366c63746391b Public key (SS58): 15UrNnNSMpX49F3mWcCX7y4kMGcvnQxCabLMT3d8U5abpwr3 SS58 Address: 15UrNnNSMpX49F3mWcCX7y4kMGcvnQxCabLMT3d8U5abpwr3