Sorry for double posting.
In the same vein, until the Meiji Revolution in Japan all commoners didn't had an official surname. They used their trade as their own surname since only people of noble origins (like warlords) or people that have been taken in by a clan (become a professional soldier) were allowed to have a surname.
One of the few instances where a commoner had a surname was the case of Toyotomi Hideyosi, who was a peddler of the name Munekita Tokijiro that served Nobunaga to such a great extent that he granted him a new name and a fiefdom, eventually rising to become the most powerful commoner of Japan (he didn't became Shogun because he wasn't of noble origins tho).
AUTISM OVERLOAD TIME!!!
Very little is known about Hideyoshi's very early past and he had no surname originally, it is said that Kinoshita Tokichiro, where Kinoshita is the family name, is the name he gave himself to make it seem like he isn't from peasant stock. He changed his name multiple times too, first changing both his names - the family name became Hashiba, a last name he gave himself which he made by taking a character from the family names of Niwa Nagahide and Shibata Katsuie, who were other high-ranking Oda generals at the time. Also iirc he originally wanted to name himself Yoshihide because Oda compared him to the famous warrior Asahina Yoshihide, but since the current shogun's name started with Yoshi it would be extremely ballsy to do so, so he decided to reverse the order to Hideyoshi.
The second name change is when the imperial court granted him the family name Toyotomi after he arranged to get himself adopted into the Fujiwara clan. That's how he also got the position of kampaku, or the emperor's regent, rather than shogun, since only clans descended from the Minamoto had right to become shogun, while the highest rank a Fujiwara can attain was kampaku.
Now we'll go to the other famous peasant-turned-samurai. Toudou Takatora - he started off as a footsoldier, funnily enough, in the employ of Hideyoshi's brother, Hashiba Hidenaga. When Hideyoshi turned samurai and gave himself the family name Hashiba, he made sure to give cushy samurai positions to his close relatives too. Toudou went on to serve ten samurai, seven of which were daimyo themselves, until he finally became daimyo and the Toudou clan was given rule over Tsu Domain through the entire Edo period. Ashigaru often took their last name to be their birthplace, and Toudou's family name came from the name of his village, which was Toudou. This is often how samurai family names were created, Matsudaira, which is the clan Tokugawa Ieyasu hails from (his original adult name was Matsudaira Motonobu, name changes were very frequent back then), was named after Matsudaira village, and the founder was a Minamoto clan samurai Matsudaira Chikauji.