putDERContents signature = do
  Put.putWord8 0x02
  putWithLength
    (putDERInt . sign_r $ signature)
  Put.putWord8 0x02
  putWithLength
    (putDERInt . getLowS . sign_s $ signature)
    
-- Multiple s values can yield the same signature
-- to prevent transaction malleability, s values are required to use the "low s" value
-- See: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#low-s-values-in-signatures
putDERContents signature = do
  Put.putWord8 0x02
  putWithLength
    (putDERInt . sign_r $ signature)
  Put.putWord8 0x02
  putWithLength
    (putDERInt . getLowS . sign_s $ signature)
    
-- Multiple s values can yield the same signature
-- to prevent transaction malleability, s values are required to use the "low s" value
-- See: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#low-s-values-in-signatures
putDERContents signature = do
  Put.putWord8 0x02
  putWithLength
    (putDERInt . sign_r $ signature)
  Put.putWord8 0x02
  putWithLength
    (putDERInt . getLowS . sign_s $ signature)
    
-- Multiple s values can yield the same signature
-- to prevent transaction malleability, s values are required to use the "low s" value
-- See: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#low-s-values-in-signatures