{
  "description": "ECDSA signature DER encoding test vectors",
  "secp256k1_n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
  "secp256k1_half_n": "7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",
  "der_round_trips": [
    {
      "description": "Simple r=1, s=1",
      "r": "01",
      "s": "01",
      "der_hex": "3006020101020101"
    },
    {
      "description": "r and s with high bit set (need leading 0x00 pad)",
      "r": "ff",
      "s": "ff",
      "der_hex": "3008020200ff020200ff"
    },
    {
      "description": "Real Bitcoin signature (from transaction)",
      "r": "4e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd41",
      "s": "181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09",
      "der_hex": "304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09"
    },
    {
      "description": "r with leading high bit",
      "r": "813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc9832365",
      "s": "6ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba",
      "der_hex": "3045022100813ef79ccefa9a56f7ba805f0e478584fe5f0dd5f567bc09b5123ccbc983236502206ff18a52dcc0336f7af62400a6dd9b810732baf1ff758000d6f613a556eb31ba"
    },
    {
      "description": "Both r and s with leading high bits",
      "r": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",
      "s": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",
      "der_hex": "3046022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140022100fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140"
    }
  ],
  "low_s_normalization": [
    {
      "description": "S already low (S <= N/2)",
      "r": "4e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd41",
      "s": "181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09",
      "is_low_s": true,
      "normalized_s": "181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09"
    },
    {
      "description": "S is high (S > N/2), needs normalization to N-S",
      "r": "4e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd41",
      "s": "e7eadd137135f821b79f5b5322ed6f6137921779f39c5a19b7b03ce459a92438",
      "is_low_s": false,
      "normalized_s": "181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09"
    }
  ],
  "compact_encoding": [
    {
      "description": "Standard 64-byte compact signature",
      "r": "4e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd41",
      "s": "181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09",
      "compact_hex": "4e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd41181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d09"
    }
  ]
}
