How was Shylock punished by the law? How did Antonio prove his generosity to the Jew in The Merchant of Venice?
1. At the beginning of Act 4, Shylock believes that Venice's adherence to the letter of the law will help his case. He insists on Antonio's sentence being carried out exactly as the bond states. He will not accept substitute monetary payment, etc., because he wants Antonio's humiliation and life. However, Portia uses Shylock's stubbornness to her advantage. She reads over the bond and points out that it states that Antonio's payment is to be a pound of flesh. Since it is impossible to remove a pound of someone's flesh without also removing blood, Portia insists on the letter of the law and warns Shylock that he can proceed with his retrieval of payment but that he must not take anything other than a pound of flesh. If he does, then he will violate the law.
In addition to Shylock not getting his payment because of the law, he could have been put to death because he sought another's life, but his punishment is to convert to Christianity, put half of his fortune in a trust for Lorenzo and Jessica, and bequeath his entire fortune to his son-in-law upon his death.
2. Your second question does not have such an objective answer. When Shylock faces the death penalty and the loss of everything he owns at the end of Act 4, Antonio steps in and recommends the punishment above. By doing so, Shylock gets to keep some of his possessions, including his house, until his death. However, one could argue that this is a form of manipulation on Antonio's part. If he gets Shylock to convert to Christianity, then he doesn't have to worry about Shylock charging other people interest because Christians cannot practice usury. This benefits Antonio because it might make more people dependent upon him, and he gets to realize the business downfall and religious humiliation of his enemy. Moreover, Antonio suggests that half of Shylock's fortune be put in a trust under his (Antonio's) care to be eventually bestowed upon Lorenzo. Antonio knows that Shylock disdains Lorenzo as a Christian and as the man who stole his daughter and his jewels; so this is still a painful punishment for Shylock. One could argue that at least Antonio spares Shylock's life and makes it possible for him to live in his house until his death, but what kind of life would that be for such a man as Shylock?