More directly, the origin of most modern yakuza organizations can be traced to two groups which emerged in 18th century Japan: tekiya (peddlers) and bakuto (gamblers). Although the modern yakuza has diversified, some gangs still identify with one group or the other. For example, a gang whose primary source of income is illegal gambling may refer to themselves as bakuto.
As they began to form organisations of their own, they took over some administrative duties relating to commerce, such as stall allocation and protection of their commercial activities. For example, during Shinto festivals, these peddlers opened stalls and some members were hired to act as security. Each peddler paid rent in exchange for a stall assignment and protection during the fair.
Had a much lower social standing even than traders, as gambling was completely illegal. Many small gambling houses cropped up in abandoned temples or shrines at the edge of towns and villages all over Japan. Most of these gambling houses ran loan sharking businesses for clients, and they usually maintained their own security personnel. The places themselves, as well as the bakuto, were regarded with disdain by the society at large, and much of the undesirable image of the yakuza originates from bakuto. This includes the name "yakuza" itself.