def combine_signatures(*sig_dicts)
      combined = {}
      sig_dicts.each do |sig_dict|
        sig_dict.each do |tree, signature|
          decoded_sig = decode_base58(signature)
          low_s_der_sig = Bitcoin::Script.is_low_der_signature?(decoded_sig) ?
            decoded_sig : Bitcoin::OpenSSL_EC.signature_to_low_s(decoded_sig)
          combined[tree] = Bitcoin::OpenSSL_EC.repack_der_signature(low_s_der_sig)
        end
      end

      # Order of signatures is important for validation, so we always
      # sort public keys and signatures by the name of the tree
      # they belong to.
      combined.sort_by { |tree, value| tree }.map { |tree, sig| sig }
    end
def combine_signatures(*sig_dicts)
      combined = {}
      sig_dicts.each do |sig_dict|
        sig_dict.each do |tree, signature|
          decoded_sig = decode_base58(signature)
          low_s_der_sig = Bitcoin::Script.is_low_der_signature?(decoded_sig) ?
            decoded_sig : Bitcoin::OpenSSL_EC.signature_to_low_s(decoded_sig)
          combined[tree] = Bitcoin::OpenSSL_EC.repack_der_signature(low_s_der_sig)
        end
      end

      # Order of signatures is important for validation, so we always
      # sort public keys and signatures by the name of the tree
      # they belong to.
      combined.sort_by { |tree, value| tree }.map { |tree, sig| sig }
    end
Takes any number of "signature dictionaries", which are Hashes where
 the keys are tree names, and the values are base58-encoded signatures
 for a single input.

 Returns an Array of the signatures in binary, sorted by their tree names.