RIM has filed suit against Kik Messenger, a small company that has built a tremendously popular chat application, claiming patent infringement.

We’re still trying to get more details about the case, which was filed in Canada’s Federal Court in Toronto. But our best guess is that it stems from Kik’s imitation of RIM’s own chat service for its Blackberry phones, called Blackberry Messenger (BBM). Kik uses the same “sent,” “delivered,” and “read” flags when a message is sent. RIM may be concerned because Kik does BBM one better by allowing chat across multiple smartphone platforms, including Android phones and iPhones. Kik is also blazing fast, and its adoption by 2 million users in just a few weeks threatens to outshine RIM’s own service.

This all puts a nail in the coffin of Kik’s chances to serve RIM’s Blackberry phones, and it seriously endanger’s the company’s chances of survival overall.

However, it’s still not clear why the service hurt Blackberry per se. According to our understanding, RIM isn’t suffering any loss of revenue if users adopt Kik instead of BBM. On the contrary, a fast, enjoyable chat application like Kik was one of the first apps built that worked really well on Blackberry, showcasing a great experience on the RIM platform at a time when most developers are focused more on the iPhone and Android platforms.

Evidently, RIM must feel its BBM service still has some sort of quality edge on its main rivals and that it must fight to protect its patent to protect that lead. But by moving to protect an app within its walled garden, RIM is fighting a questionable battle, now that we’re in an age where cross-platform apps are more relevant.

Here’s the bigger worry for RIM: With this move, is it inadvertently poisoning its own ecosystem? If people know they can work at RIM and then start a successful startup that rides on top of the BlackBerry platform, RIM becomes a more attractive place to work and BlackBerry becomes a more attractive platform to develop on. By making an example of Kik and its chief executive, Ted Livingston, a 23-year-old former strategist at BBM who set up shop across the street from its headquarters, RIM could be shooting itself in the foot for extremely questionable gain. Yes, RIM’s always been protective of its intellectual property, but as Apple’s iPhone and now more recently Google with its Android platform have shown, you have to leave something on the table for innovators to seize.

We’ve requested comment from both sides and will update if we hear back. [Update: Kik’s Livingston has blogged about the suit.]