Hydrogen-resist lithography with the tip of a scanning tunnelling microscope can be used to fabricate atomic-scale dopant devices in silicon substrates and could potentially be used to build a dopant-based quantum computer. However, all devices fabricated so far have been based on the n-type dopant precursor phosphine. Here, we show that diborane can be used as a p-type dopant precursor, allowing p-type and bipolar dopant devices to be created. Characterization of diborane δ-layers reveals that similar mobilities and densities can be achieved as for phosphine, with sheet resistivities as low as 300 Ω □−1. Scanning tunnelling microscope imaging and transport measurements of a 5.5-nm-wide p-type dopant nanowire give an estimated upper bound of 2 nm for the lithographic resolution of the p-type dopant profiles. By combining our p-type doping approach with established phosphine-based n-type doping, we fabricate a 100-nm-wide p–n junction and show that its electrical behaviour is similar to that of an Esaki diode.