Unfortunately, I can't tell you what the cause is. It can be caused by a number of different things - lichen planus, lichen sclerosus, angiokeratomas, psoriasis - and you'd have to have a biopsy to determine what is causing yours.
It's not syphilis, for sure. A syphilis sore is a round, open, painless sore that appears 10-90 days after infection, and lasts for 3-6 weeks. It will go away with or without treatment.
If you don't get treatment, the next stage is a rash that you get over different parts of your body. That will go away, too. At some point, you'd have noticed the symptoms. Also, you can get a test and easily determine if you have it or not, and put that matter to rest.
It would be really unlikely that a child just a few years older than you - around 12 or 13? - would have syphilis.
If you were 9, and are 35 now, let's say this happened in 1996. In 1996, there were 11,387 in the entire US. (https://wonder.cdc.gov/wonder/std/STDD011.PCW.html) It's highly unlikely your friend was one of them, and then infected you.
For comparison, in 2019, 129,813 cases of all stages of syphilis were reported. (https://www.cdc.gov/std/statistics/2019/overview.htm)
Since you're so concerned about what the spots are, why not see a dermatologist?