", "Adrian Wrona "]>" />

Casper - Addresses

Author , "Adrian Wrona
Discussions-To https://github.com/ChainAgnostic/namespaces/pull/100
Status Draft
Type Standard
Created 2024-01-12
Requires CAIP-10

CAIP-10

For context, see the CAIP-10 specification.

Rationale

The Casper blockchain uses an on-chain account-based model, uniquely identified by an AccountHash derived from a specific PublicKey. The AccountHash is derived from any of the supported PublicKey variants below to standardize keys that can vary in length.

Casper supports two types of keys for creating accounts and signing transactions:

  • Ed25519 keys, which use the Edwards-curve Digital Signature Algorithm (EdDSA).

  • Secp256k1 keys, which use the Elliptic Curve Digital Signature Algorithm (ECDSA) with the P-256 curve.

Syntax

An Account hash is a 32-byte length hash derived from the public key by applying the blake2b hash function.

Public key length depends on the key type:

  • For Ed25519, length is 66 bytes (the prefix 0x01 and the 64 bytes of the public key).

  • For Secp256k1, length is 68 bytes (the prefix 0x02 and the 66 bytes corresponding to the compressed form of the public key).

Keys are usually represented with lowercase letters. However, CEP-57 introduced an opt-in checksum scheme, based on EIP-55, to protect against copy errors by encoding a checksum in the capitalization of hexadecimal strings.

Test Cases

Ed25519 public key - checksummed 01d51D4d7e1Dc8166405EC6fFb21C94434Cfd4D9021Ed6D94A1FF3d7D613046710

Ed25519 public key - without checksum 01cd4f2ed572ea555ca46c17c83c43e609d2e916871236f40faa9ba747478e8dee

AccountHash for previous public key account-hash-79c9563deeb7bbd05e91c7dddddec9328717fea1ae846dd54ab9dfeaae015bc0

Secp256k1 public key - checksummed 02038a9932973F5632BcF31ff9Ba83e7eB3Bd7457F85af79258bd6b0A1FF06017B5a

Secp256k1 public key - not checksummed 02022ade9bd8e06033e99b1bfbf789db4e2db0349045818469bbcaf756996900e838

AccountHash for previous public key account-hash-5b7e450d8b1e58de5f012db6c6e934431a6b6b063e5d4955914675e791797712

Ed25519 public key - invalid checksum 01D51D4d7e1Dc8166405EC6fFb21C94434Cfd4D9021Ed6D94a1FF3d7d613046710

Secp256k1 public key - invalid checksum 02038A9932973f5632BcF31ff9Ba83e7eB3Bd7457F85af79258bd6b0A1FF06017b5A

References

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

, "Adrian Wrona, "namespaces/casper-caip10: Casper - Addresses [DRAFT]," Chain Agnostic Namespaces, casper-caip10, January 2024 / . [Online serial]. Available: https://github.com/ChainAgnostic/namespaces/casper-caip10.md