Map<String, dynamic> toJson() { return { 'tree': tree, 'signature': signature, 'delegation': delegation?.toJson() ?? {}, }; }