Blackbeard: "Law... I'm not going to kill you... myself, anyway. But... if I want to rule the world completely, I have to live forever, right? So, here's my deal: if you perform the surgery that makes me live forever... then I won't torture your crew to death in front of your face, and, after you die, I'll let them go. Sounds good?"
I think this is the real reason Teach is attacking Law: he wants immortality. He can get the Road Ponyglyphs from the islands they're on if he needs to. Only one person can perform the surgery, though.