Skip to content

is there a bug with signMessageOfBIP322Simple #13

@zhangliugang

Description

@zhangliugang

I cloned this repo and create a new test

  it('bip322-simple 2', async () => {
    const wallet = new LocalWallet("L3VFeEujGtevx9w18HD1fhRbCH67Az2dpCymeRE1SoPK6XQtaN2k", AddressType.P2WPKH, NetworkType.MAINNET);
    expect(wallet.address).eq("bc1q9vza2e8x573nczrlzms0wvx3gsqjx7vavgkx0l");
    const signature = await wallet.signMessage("", "bip322-simple");
    expect(signature).eq('AkcwRAIgM2gBAQqvZX15ZiysmKmQpDrG83avLIT492QBzLnQIxYCIBaTpOaD20qRlEylyxFSeEA2ba9YOixpX8z46TSDtS40ASECx/EgAxlkQpQ9hYjgGu6EBCPMVPwVIVJqO4XCsMvViHI=')
    
    const signature2 = await wallet.signMessage("Hello World", "bip322-simple");
    expect(signature2).eq('AkcwRAIgZRfIY3p7/DoVTty6YZbWS71bc5Vct9p9Fia83eRmw2QCICK/ENGfwLtptFluMGs2KsqoNSk89pO7F29zJLUx9a/sASECx/EgAxlkQpQ9hYjgGu6EBCPMVPwVIVJqO4XCsMvViHI=')
  });

these two cases is provided by https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki and the signature seems not correct at all

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