Skip to content

[Node.js] deserialize fails because Buffers are converted to arrays #364

Description

@0xrouss-miden

Packages versions

@miden-sdk/miden-sdk@0.16.0-rc.5

Bug description

In Node.js, the SDK wrapper converts Buffer and Uint8Array arguments into plain arrays.
AuthSecretKey.deserialize() expects a Buffer, so it fails through the public SDK export.

This also affects Word.deserialize(). Calling the same method through getNativeModule() works because it bypasses the wrapper.

How can this be reproduced?

import { AuthSecretKey } from "@miden-sdk/miden-sdk";

const key = AuthSecretKey.rpoFalconWithRNG(new Uint8Array(32));
const base64 = key.serialize().toString("base64");

AuthSecretKey.deserialize(Buffer.from(base64, "base64"));

Relevant log output

Failed to get Buffer pointer and length

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions