fix valid() in blockchain format