const Scalar = require("ffjavascript").Scalar; const ZqField = require("ffjavascript").ZqField; // Prime 0x30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001 const F = new ZqField(Scalar.fromString("21888242871839275222246405745257275088548364400416034343698204186575808495617")); class SMTMemDb { constructor() { this.nodes = {}; this.root = F.zero; } async getRoot() { return this.root; } _key2str(k) { // const keyS = bigInt(key).leInt2Buff(32).toString("hex"); const keyS = k.toString(); return keyS; } _normalize(n) { for (let i=0; i