There is a tree which has similar characteristics with what you described.It is called Dracaena cinnabari, or hamabusu in some parts of Ghana, the Socotra dragon tree or dragon blood tree, is a dragon tree native to the Socotra archipelago in the Indian Ocean. It is so called due to the red sap that the trees produce.
Dragon’s blood is used as a stimulant and abortifacient. The root yields a gum-resin, used in gargle water as a stimulant, astringent and in toothpaste. The root is used in rheumatism, the leaves are a carminative.
The trees can be harvested for their crimson red resin, called dragon’s blood, which was highly prized in the ancient world and is still used today. Around the Mediterranean basin it is used as a dye and as a medicine, Socotrans use it ornamentally as well as dying wool, gluing pottery, a breath freshener and lipstick. Because of the belief that it is the blood of the dragon it is also used in ritual magic and alchemy. In 1883, the Scottish botanist Isaac Bayley Balfour identified three grades of resin; the most valuable were tear-like in appearance, then a mixture of small chips and fragments, with a mixture of fragments and debris being the cheapest. The resin of D. cinnabari is thought to have been the original source of dragon’s blood until during the mediaeval and renaissance periods when other plants were used instead.
The local inhabitants of the city in the Socotra Island use the dragon’s blood resin as a cure-all. They use it in general wound healing, as a coagulant, cure for diarrhea, for dysentery diseases, for lowering fevers. It is also taken for ulcers in the mouth, throat, intestines and stomach.
Dragon’s blood from D. cinnabari was used as a source of varnish for 18th-century Italian violin-makers. It was also used as tooth-paste in the 18th century. It is currently still used as varnish for violins and for photoengraving.