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

Laksa::Crypto::Schnorr.sign signature size issue #6

@yivo

Description

@yivo

Sometimes Laksa::Crypto::Schnorr.sign returns 126 bytes signature.

When trying to submit TX ZIL node returns: {"error":{"code":-8,"data":null,"message":"Invalid Signature size"},"id":1,"jsonrpc":"2.0"}

I noticed this issue on production account so I can't provide private key for testing but I will keep monitoring this in testing environment and if I catch this I will provide you a private key.

Here is how I use this gem:

      tx_parameters = Laksa::Account::TxParams.new.tap do |x|
        x.version        = 65537
        x.nonce          = nonce_of(issuer.fetch(:address)) + 1
        x.amount         = convert_to_base_unit(amount)
        x.gas_price      = 1000000000
        x.gas_limit      = 1
        x.sender_pub_key = issuer.fetch(:public_key)
        x.to_addr        = Laksa::Util::Bech32.from_bech32(recipient.fetch(:address))
      end

      tx = Laksa::Account::Transaction.new(tx_parameters, nil).tap do |t|
        t.signature = Laksa::Crypto::Schnorr.sign(Laksa::Util.encode_hex(t.bytes), issuer.fetch(:private_key), issuer.fetch(:public_key))
      end

      payload = tx.to_payload.tap do |p|
        p.merge! \
          amount:    p[:amount].to_s,
          gasPrice:  p[:gasPrice].to_s,
          gasLimit:  p[:gasLimit].to_s,
          signature: p[:signature].to_s
      end

Then I submit payload to ZIL by using CreateTransaction JSON-RPC call.

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