The butterfly stroke is arguably the most difficult stroke to learn and swim. The video I cited here is to instruct how to swim butterfly, but I only wish to use it for "dolphin kick", the very first step toward learning butterfly stoke. It's a technique more about body undulation rather than kicking even though it's called dolphin kick or butterfly kick; in several videos I watched, Phelps' coach, Bob Bowman called it, "body dolphin". Likely, Bob just wanted to place the focus on body.
As this video suggests, dolphin kick begins at body core (core muscle), but to put things simple, it's just "move your hips up and down"; such body undulation makes legs create whiplash effect, which subsequently propels the body forward. "Trying to keep your legs straight, specially while going up , and just bend your knees a little while doing down." Then "practice this movement, hips up, hips down."
At this practice, besides keeping your legs straight, it helps a lot if you also point your toes (plantar flexion) while legs going up (up-kick), which incrases the surface of up-kick and would also prevent you from over-bending the knees.