π₯Accounts (Low-Level)
Pre-Readings
Accountsβ
For accounts (standard senders of transactions) , we support users from four L1 blockchain ecosystems currently (Ethereum, Bitcoin, Solana, and Cosmos). These are mapped behind the scenes through mapping addresses to an equivalent BitBadges address and being signature compatible (able to verify signatures of the native signature schemes).
Signing Transactions
For non-Cosmos signatures, we map everything to a SHA256 content hash to get a string such as:
We then verify the signatures of the transaction string as a personal message signature via the respective signature algorithm (e.g. ECDSA for Ethereum).
Cosmos
Normal Cosmos accounts are also supported with all the Cosmos SDK's native functionality. We refer you to their documentation for further information.
Ethereum
BitBadges allows Ethereum addresses to use Ethereum's ECDSA secp256k1 curve for keys.
Solana
BitBadges also extends the SDK's functionality to support Solana signatures signing with a ed25519 key. Addresses are expected to be in the native Base58 format.
Bitcoin
BitBadges supports Bitcoin P2WPKH addresses and BIP322 signature verification.
Public Key Types
For standard Cosmos accounts and Bitcoin accounts, the public key will have the "@type": "/cosmos.crypto.secp256k1.PubKey"
.
For Solana accounts, the public key will have the "@type": "/cosmos.crypto.ed25519.PubKey"
.
For standard Ethereum accounts, the public key will have the "@type": "/ethereum.PubKey"
.
{"@type":"/ethereum.PubKey","key":"AsV5oddeB+hkByIJo/4lZiVUgXTzNfBPKC73cZ4K1YD2"}
Deriving BitBadges Ethereum Account from a private key/mnemonicβ
Below you will see an example code snippet on how to derive a BitBadges Account from a private key and/or a mnemonic phase:
Let's see an example code snipped on how to derive a public key from a private key:
Acknowledgements
Credit to https://docs.injective.network/learn/basic-concepts/accounts and https://docs.evmos.org/protocol/concepts/accounts.
Last updated