A novel 3D ultramicroporous triptycene-based polyimide framework with high surface area (1050 m2 g-1) and thermal stability was synthesized. It exhibits relatively high CO
2 (3.4 mmol g
-1 at 273 K and 1 bar), H
2 (7 mmol g
-1 at 77 K and 1 bar), and olefin sorption capacity, good CO
2/N
2 (45) and CO2/CH4 (9.6) selectivity at 273 K and 1 bar, as well as promising C
2H
4/CH
4 and C
3H
6/CH
4 selectivities at 298 K, making it a potential candidate for CO
2 capture, H
2 storage, and hydrocarbon gas separation applications. © The Royal Society of Chemistry 2016.