In this work we explicitly construct polynomial vector fields L k , k = 0, 1, 2, 3, 4, 6 on the complex linear space C 6 with coordinates X = (x 2 , x 3 , x 4 ) and Z = (z 4 , z 5 , z 6 ). The fields L k are linearly independent outside their discriminant variety ∆ ⊂ C 6 and tangent to this variety.We describe a polynomial Lie algebra of the fields L k and the structure of the polynomial ring C[X, Z] as a graded module with two generators x 2 and z 4 over this algebra. The fields L 1 and L 3 commute. Any polynomial P (X, Z) ∈ C[X, Z] determines a hyperelliptic function P (X, Z)(u 1 , u 3 ) of genus 2, where u 1 and u 3 are coordinates of trajectories of the fields L 1 and L 3 .The function 2x 2 (u 1 , u 3 ) is a 2-zone solution of the KdV hierarchy and ∂ ∂u1 z 4 (u 1 , u 3 ) = ∂ ∂u3 x 2 (u 1 , u 3 ).