Believe it or not, most cats do not attack because of hostility. Many cats, particularly
ones with a low threshold for stimulation, nip and bite when they are happy. This is perfectly normal cat behavior.
If you notice your cat stalking your feet, he is doing what is called predatory-play. By instinct,
cats attack moving objects. Since your feet are about the only moving target he has, it is normal behavior for you
cat to ambush you.