Remember, you aren't building a startup, you are building a company. If you're only building a startup, then just write a few lines of code and push it out.
What do you really want? Do you always want to be a startup? Or do you want to be a business? Businesses aren't startups. Businesses are built to last decades. Are you looking for a quick exit?
Is that what you are really asking? How do you prevent another startup from exiting in your place?
Why are you even thinking about another startup? Envy? Greed? Do you want more users? Is it a competition?
What do you really want? It is impossible to prevent your startup from being knocked off. No number of patents or trademarks or copyrights are going to prevent someone from knocking off your startup.
Do you think Nike asks, "How do we prevent adidas from making tennis shoes?"
You should be asking, "How does one make a successful company? How does one last through the startup phase?" Neither of those questions have anything to do with competition.