Mix the paste ingredients except for the onion and vinegar in a food processor or mortar and pestle.
Cook the onion in a pan with some butter for about a half hour until lightly caramelized. Add in the paste you just made and cook another 3 minutes. Add in the vinegar and stir. Remove from heat.
For the sauce, just mix all the ingredients in the blender until smooth.
Grate the potatoes. Put them into a bowl with water and stir them around. Strain. Repeat. Squeeze the potatoes to remove moisture. Toss the potatoes with a little oil and salt and spread them onto a baking sheet. Bake at 450 for about 20 minutes.
Allow potatoes to cool for 10 minutes and then transfer to a bowl.
Mix the onion mixture into the potatoes. Add in the egg and potato flakes. Stir well. Squeeze some with your hand to make sure it forms and holds together. If it is too wet, add more flakes, too dry, add another splash of vinegar.
Preheat frying oil to 350
Form your tots and fry them for about 5 minutes to brown.
Serve the tots while hot with the sauce.