Kickstarting the space economy requires identification of critical resources that can lower the cost of space transport, sustain logistic bases and communication relay networks between major nodes in the network. One important challenge with this space-economy is ensuring the low-cost transport of raw materials from one gravity-well to another. The escape delta-v of 11.2 km/s from Earth makes this proposition very expensive. Transporting materials from the Moon takes 2.4 km/s and from Mars 5.0 km/s. Based on these factors, the Moon and Mars have the potential to export material into this space economy. Water has been identified as a critical resource both to sustain human-life but also for use in propulsion, attitude-control, power, thermal storage and radiation protection systems. Water may be obtained off-world through In-Situ Resource Utilization (ISRU) in the course of human or robotic space exploration. There is also important need for construction materials such as aluminum, iron/steel, and titanium. Based upon these important findings, we have developed an energy model to determine the feasibility of developing a mining base on the Moon and Mars. These mining base mine and principally exports water, aluminum, titanium and steel. The moon has significant reserves of water known to exists at the permanently shadowed crater regions and there are significant sources of titanium, aluminum and iron throughout the Moon's surface. Mars also has significant quantities of water in the form of hydrates, in addition to reserves of iron, titanium and aluminum Our designs for a mining base utilize renewable energy sources namely photovoltaics and solarthermal concentrators to provide power to construct the base, keep it operational and export water and other resources using a Mass Driver. Using the energy model developed, we will determine the energy per Earth-day to export 100 tons each of water, titanium, aluminum and low-grade steel into escape velocity of the Moon and Mars. We perform a detailed comparison of the energy required for construction of similar bases on the Moon and Mars, in addition to the operating energy required for regolith excavation, processing, refining and finally transport off-the-body. In this process, we consider multiple critical technologies including use of humans predominantly to construct and operate the base and alternately the use of robot teams. In addition, we also consider the use of additive manufacturing to print a base out of local materials or use of traditional building techniques. Our comparative study finds that an equivalent Martian base requires twice as much energy for construction than a lunar base, this is to enable the base to withstand the higher gravity. This also accounts for the energy required to process the local raw material into construction feedstock. A Martian base requires significantly more energy for day to day operations due to the higher gravity, requiring 2.4-folds more energy, primarily for operating the mass-driver to export the 400-tons of export mate...