Wash and peel the green plantains, be careful as green plantains tend to stain clothes and cutting boards. It works best to do this under running cold water.
Cut three of the plantains in half. Keep the remaining peeled plantain in a bowl of cold water.
Bring water to boil in a large saucepan and add the 3 plantains. Cook until tender, about 30 minutes. Exact time will vary based on the greenness of the plantains.
Remove from heat and let the cooked plantains sit in the water they cooked in until they are cool enough to handle (but still warm), if you remove them from the warm water they will get too hard.
In the meantime, grate the remaining raw plantain using a very fine grater.
Place the cooked plantains in a food processor and pulse until you have a thick coarse mix. Add the egg and butter or oil, and pulse until the ingredients are well mixed and the dough is a little smoother.
Remove the plantain mix and place it into a large bowl. Rub your hands with a bit of butter or oil, and mix in the finely grated raw plantain and ½ to 1 teaspoon of salt (adjust based on how large the plantains are and your level of tolerance for salt). Use your hands to work the dough until you have a smooth mix. If the dough is very dry or too sticky, you can add a bit of the cooking water from the plantains – you will likely need to this if you didn’t use an egg.
Form the dough into a ball and let rest in a bowl at room temperature for about 15-30 minutes. You can also save it to use later and store in the refrigerator for 24 hours, but when you remove it from the refrigerator, let it rest for at least 30 minutes at room temperature.