Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base58-encoding signature consisting of all zero bytes produces edsig encoding, which doesn't match reference #50

Closed
lierdakil opened this issue Nov 27, 2023 · 0 comments · Fixed by #61

Comments

@lierdakil
Copy link

lierdakil commented Nov 27, 2023

Describe the bug

Base58-encoding signature consisting of all zero bytes produces edsig encoding, which doesn't match Octez implementation:

$ octez-client --mode mockup --protocol PtN normalize data 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 of type signature --unparsing-mode Readable
...
"sigMzJ4GVAvXEd2RjsKGfG2H9QvqTSKCZsuB2KiHbZRGFz72XgF6KaKADznh674fQgBatxw3xdHqTtMHUZAGRprxy64wg1aq"

but tezos_crypto_rs::hash::Signature([0; 64].to_vec()).to_b58check() produces "edsigtXomBKi5CTRf5cjATJWSyaRvhfYNHqSUGrn4SdbYRcGwQrUGjzEfQDTuqHhuA8b2d8NarZjz8TRf65WkpQmo423BtomS8Q"

Note, however, that base58-encoded ed25519 signature survives the round-trip:

$ octez-client --mode mockup --protocol PtN normalize data '"edsigtXomBKi5CTRf5cjATJWSyaRvhfYNHqSUGrn4SdbYRcGwQrUGjzEfQDTuqHhuA8b2d8NarZjz8TRf65WkpQmo423BtomS8Q"' of type signature --unparsing-mode Readable
"edsigtXomBKi5CTRf5cjATJWSyaRvhfYNHqSUGrn4SdbYRcGwQrUGjzEfQDTuqHhuA8b2d8NarZjz8TRf65WkpQmo423BtomS8Q"

To Reproduce

    #[test]
    fn test() {
        assert_eq!(
            &tezos_crypto_rs::hash::Signature([0; 64].to_vec()).to_b58check(),
            "sigMzJ4GVAvXEd2RjsKGfG2H9QvqTSKCZsuB2KiHbZRGFz72XgF6KaKADznh674fQgBatxw3xdHqTtMHUZAGRprxy64wg1aq"
        );
    }

Expected behavior

Test passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant