Nearly Optimal State Merklization