Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Changing between installed versions of this package fails to update the associated native node module #134

@tplooker

Description

@tplooker

When changing between installed versions of node-bbs-signatures it appears that the native node module './index.node' is not always being downloaded and updated by node-pre-gyp leading to issues, especially when changing between versions of the library that feature breaking API changes.

How to reproduce

Start with new empty project and install node-bbs-signatures

yarn add @mattrglobal/node-bbs-signatures@0.10.0

Then run the following

node
require("./node_modules/@mattrglobal/node-bbs-signatures/native/index.node")

Which will output

{ bls_generate_blinded_g2_key: [Function],
  bls_generate_blinded_g1_key: [Function],
  bls_generate_g2_key: [Function],
  bls_generate_g1_key: [Function],
  bls_secret_key_to_bbs_key: [Function],
  bls_public_key_to_bbs_key: [Function],
  bbs_sign: [Function],
  bbs_verify: [Function],
  bbs_blind_signature_commitment: [Function],
  bbs_verify_blind_signature_proof: [Function],
  bbs_blind_sign: [Function],
  bbs_get_unblinded_signature: [Function],
  bbs_create_proof: [Function],
  bbs_verify_proof: [Function],
  bls_verify_proof: [Function] }

Now change the installed version of the package

yarn add @mattrglobal/node-bbs-signatures@0.9.0

And run

node
require("./node_modules/@mattrglobal/node-bbs-signatures/native/index.node")

Note the output

{ bls_generate_blinded_g2_key: [Function],
  bls_generate_blinded_g1_key: [Function],
  bls_generate_g2_key: [Function],
  bls_generate_g1_key: [Function],
  bls_secret_key_to_bbs_key: [Function],
  bls_public_key_to_bbs_key: [Function],
  bbs_sign: [Function],
  bbs_verify: [Function],
  bbs_blind_signature_commitment: [Function],
  bbs_verify_blind_signature_proof: [Function],
  bbs_blind_sign: [Function],
  bbs_get_unblinded_signature: [Function],
  bbs_create_proof: [Function],
  bbs_verify_proof: [Function],
  bls_verify_proof: [Function] }

Which is incorrect for the 0.9.0 package which did not feature blinded key generation support and the function bls_generate_g2_key was instead called bls_generate_key

Intermediary Solution

It is recommended when changing between installed versions of the library to uninstall and reinstall the library at the new targeted version to ensure the correct native node module is downloaded.

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