The problem of estimating nonlinear systems is an important issue in many engineering applications. One of these applications is in the nanosatellite for Vehicle-to-everything (V2X) communications, which is used to replace sensors in the event of failure or error. Therefore, the accuracy of pre-filter estimation is of great importance. To control the orientation of a satellite, it is important to estimate the attitude accurately. Time-series estimation is especially important in micro and nanosatellites, whose sensors are usually low-cost and have higher noise levels than high-end sensors. Also, the algorithms should be able to run on systems with very restricted computer power. In this paper, an overview of the algorithms used to determine the attitude of nanosatellites, and especially using only the magnetometer sensor, will be discussed. This paper aims to simulate a nanosatellite system to estimate the magnetic field derivative vector using only the magnetometer data with the desired accuracy. The estimated vectors in the pre-filter, along with the magnetometer sensor data, are used to estimate the attitude of the satellite. The estimation of the state vector consisting of the vector part of quaternion and the angular velocity vector is used for the control calculation. To evaluate the accuracy of this pre-filter, a comparison of the magnetometer vector estimator with the body sensor data has been used.