Towards an Optimal Social Security Design