code: func deriveChainId(v *big.Int) *big.Int {
  	if v.BitLen() <= 64 {
  		v := v.Uint64()
  		if v == 27 || v == 28 {
  			return new(big.Int)
  		}
  		return new(big.Int).SetUint64((v - 35) / 2)
  	}
  	v = new(big.Int).Sub(v, big.NewInt(35))
  	return v.Div(v, big.NewInt(2))
  }
docs: // deriveChainId derives the chain id from the given v parameter