Idk, that's like asking how did anyone who did it first came up with it.
Probably he spent his whole life around the sword, did something and it turned black.
I have no idea and neither do you how to turn black blades.
Did nidai have previous owner? Did that previous owner tried to turn it to black blade?
If you try to turn a used sword black, are the previous owners attempts are nullified?
A sword is not a CoA container, because if it was and there was some CoA stored in it, it would naturally hurt logias, but that is clearly not a case.
I think its you providing a blade with overwhelming amount of Ryou in one shot and once you have that level of Ryou you can turn any blade into black blade.
But attaining that level of Ryou is life long process of Haki blooming.
Now Ryou amounts are a thing in One Piece because Enma requires overwhelming amount of Ryou that scabbards don't have and hence they won't be able to weild it.
How does Enma help Zoro turning itself black then? Well Enma already sucks excessive amount of CoA, and if your Haki is already some what overwhelming (and by this I mean Shanks level CoA), its excessive CoA sucking property would suck even more Haki than you can normally supply turning Enma black.
But with turning a blade like Wado, you need even more overwhelming CoA that only Mihawk and Ryuma have/had.
[automerge]1597608463[/automerge]
But we can all show a little patience here and wait for Oda to explain black blades which he obviously will when Zoro turns Enma black.
So we can all hold our horses and stop making hypothesises