To add a spell to his spellbook, a wizard has to pay a fee depending on the level of the spell. I remember seeing somewhere that this is because of the need to use magical ink though I am not certain about that.
During a standard campaign usually the origin of this ink is hand-waved and the wizard would just pay the fee. However I am currently playing a campaign during which the PCs are lost on a boat somewhere in the middle of the sea, so there is no place to buy this ink.
The GM ruled that somehow I managed to craft the components from what we have on the boat, deducing the price from the price of the merchandise (which seems a fair ruling to me), but since then I am wondering if there is an official ruling for that. After all the ink can't be appearing by itself in shops.
I would prioritize as an answer direct citations from rulebooks, but even vague lore information would be better than nothing.