Skip to content

Uint8Array pubkeys degrade to plain objects after localStorage round-trip #40

@drimchansky

Description

@drimchansky

When account data is persisted to localStorage and restored on page reload, Uint8Array pubkeys are silently converted to plain objects ({0: 2, 1: 176, …}). This causes signing to fail with "length of pubkey is incorrect" because the signing pipeline expects a real Uint8Array.

See:

async getAccount(): Promise<WalletAccount> {
const existed = this.store.getChainWalletState(this.wallet.info.name, this.chain.chainName)?.account;
if (existed) {
return existed;
}

Reproduction

  1. Connect a Cosmos wallet
  2. Perform a successful transaction (works – pubkey is a real Uint8Array)
  3. Reload the page (account is restored from localStorage)
  4. Attempt to sign another transaction
  5. Transaction fails with "length of pubkey is incorrect"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions