Inspired by the question I thought maybe a photon thruster can be used for precisely giving thrust to maintain spacecraft attitude. But soon I realized that for high precision attitude control, one requires high precision sensor. So, in principle(even if not possible by current technology) what is the best absolute attitude reference one can get?
This is the (attitude) lost in space problem. This problem arises, for example, when a spacecraft is first released from the upper stage after launch or when a spacecraft awakens after having been shut down for a long time. Many modern star trackers have a "lost in space" mode to address this problem. Star trackers solve the lost in space problem the same way our ancestors did when lost at sea: They looked for familiar patterns (aka constellations) in the stars. Star trackers don't look at just one star. They look at many.
It can take such star trackers several seconds to arrive at an attitude solution when the attitude is completely unknown. The time between updates is much shorter (and oftentimes more accurate) once the star tracker has solved this lost in space problem.
As discussed in comments below the question, precise pointing of an optical component of a spacecraft does not require attitude to the same level of precision.
From this comment:
A small unit placed at the focal plane can contain both a light emitter (fiber pigtail attached to a laser diode+modulator) and a CCD monitoring positions of stars, planets, or other objects within a degree or so of the target which may be invisible. A computer + ephemeris will know the orientation of one with respect to the other, and be able to do the light time and other corrections. If image processing detects a misalignment, tiny MEMS actuators can move the FP unit, or just the fiber by microns in order to compensate. No need to change the attitude of the whole spacecraft.
Here is an existing example of a focal plane device with an actuator used to maintain alignment of pixels with the focal points from distant objects to sub-arc-second accuracy.
The Phys.org article Astrophysics CubeSat could be used to study planets orbiting other stars descrbies the NASA 6U cubesat
Holding steady on a faraway star is difficult because there are many things that subtly push and pull on the satellite, such as Earth's atmosphere and magnetic field. ASTERIA's payload achieved a pointing stability of 0.5 arcseconds RMS, which refers to the degree to which the payload wobbles away from its intended target over a 20-minute observation period. The pointing stability was repeated over multiple orbits, with the stars positioned on the same pixels on each orbit.
"That's like being able to hit a quarter with a laser pointer from about a mile away," said Christopher Pong, the attitude and pointing control engineer for ASTERIA at JPL. "The laser beam has to stay inside the edge of the quarter, and then the satellite has to be able to hit that exact same quarter—or star—over multiple orbits around the Earth. So what we've accomplished is both stability and repeatability." (emphasis added)
below: "This gif shows a series of images from a single observation of a star by the ASTERIA spacecraft. In the first few images, the star appears to move as ASTERIA slews to and then locks onto the target star. Throughout the remainder of the frames, the spacecraft remains locked on the target star."" From here. Credit: NASA/JPL-Caltech
The pointing precision of ASTERIA's optical telescope payload does not require attitude control of the entire spacecraft, floppy solar panels and all. As described in the JPL ASTERIA Mission page Arcsecond Space Telescope Enabling Research in Astrophysics (ASTERIA):
ASTERIA is a 6U CubeSat (roughly 10 x 20 x 30 cm, 12 kg) that will operate in low-Earth orbit. The payload consists of a lens and baffle assembly, a CMOS imager, and a two-axis piezoelectric positioning stage on which the focal plane is mounted. A set of commercial reaction wheels provides coarse attitude control. Fine pointing control is achieved by tracking a set of guide stars on the CMOS sensor and moving the piezoelectric stage to compensate for residual pointing errors. Precision thermal control is achieved by isolating the payload from the spacecraft bus, passively cooling the detector, and using trim heaters to perform small temperature corrections over the course of an observation. (emphasis added)
below: "Electrical Test Engineer Esha Murty (left) and Integration and Test Lead Cody Colley (right) prepare the ASTERIA spacecraft for mass properties measurements in April 2017 prior to spacecraft delivery."
Gravity Probe B sensed its attitude relative to a star called IM Pegasi (whose own absolute position was measured relative to distant quasars by Earth-based radio astronomy) to an accuracy of about 0.1 milli arcsecond.
More details are available in this article. To summarise: they had a telescope about 36cm long and 14cm aperture which formed an image of the guide star (the image was a disk due to diffraction at the telescope aperture). They split that disk into four pieces and measured the total intensity of light in each piece electrically. The differences in intensity (up/down and left/right) told them how close to the centre of the star's disk they were pointing. The telescope (and all of the rest of the satellite) were constructed of very rigid quartz, cooled to 2.3K by liquid helium and carefully protected from stray magnetic fields and other sources of perturbation. The attitude of the spacecraft (and its orbit) were controlled using tiny thrusters powered by the slow boil off of the liquid helium. The spacecraft was continuously pointed to within about 200 milli arcseconds when operating.
This is separate from this answer in order to separate a published solution from a general explanation and hypothesizing.
The Phys.org article Laser-pointing system could help tiny satellites transmit data to Earth describes a system that fits nicely in a ~1 U section of a cubesat.
"Even if the whole satellite is a bit misaligned, you can still correct for that with this mirror," Cierny says. "But these MEMS mirrors don't give you feedback about where they're pointing. Say the mirror is misaligned in your system, which can happen after some vibrations during launch. How can we correct for this, and know exactly where we're pointing?"
As a solution, Cierny developed a calibration technique that determines by how much a laser is misaligned from its ground station target, and automatically corrects the mirror's angle to precisely point the laser at its receiver.
The technique incorporates an additional laser color, or wavelength, into the optical system. So instead of just the data beam going through, a second calibration beam of a different color is sent through with it. Both beams bounce off the mirror, and the calibration beam passes through a "dichroic beam splitter," a type of optical element that diverts a specific wavelength of light—in this case, the additional color—away from the main beam. As the rest of the laser light travels out toward a ground station, the diverted beam is directed back into an onboard camera. This camera can also receive an uplinked laser beam, or beacon, directly from the ground station; this is used to enable the satellite to point at the right ground target.
[...] "This shows that you can fit a low-power system that can make these narrow beams on this tiny platform that is a factor of 10 to 100 smaller than anything that's ever been built to do something like this before," Cahoy says. "The only thing that would be more exciting than the lab result is to see this done from orbit. This really motivates building these systems and getting them up there."
The article links to the recent Open Access paper in Optical Engineering (Ondrej Čierny & Kerri L. Cahoy 2018) On-orbit beam pointing calibration for nanosatellite laser communications
The paper describes the system in detail, including the electronics and pointing algorithm used, and presents the result of a simulation based on measured data from the prototype.
We describe techniques developed to optimize beam pointing control for a CubeSat laser downlink demonstration mission being developed at the MIT Space Telecommunications, Astronomy, and Radiation Laboratory. To fine-point its downlink beam, the mission utilizes an uplink beacon signal at 976 nm captured by an on-board ±5-deg field-of-view detector and tracked by a 3.6-mm commercial, off-the-shelf MEMS fast steering mirror. As these miniature actuators lack feedback sensors, the system design is augmented with an optical calibration signal to provide the mirror’s pointing feedback. We describe the system and introduce calibration algorithms utilizing the feedback signal to achieve higher fidelity beam pointing control. A demonstration in the laboratory is conducted to obtain a quantitative performance analysis using quasi-flight hardware with simulated spacecraft body pointing disturbances. Experimental results show that beacon tracking errors of only 16 μrad root-mean-square are feasible for both axes, significantly exceeding the mission pointing requirement of 0.65 mrad and indicating the feasibility of narrower beams and higher data throughputs for next-generation downlink demonstration missions.