Summary
I3 from the intrinsic agenda: ec_mul(point_hex String, scalar Uint64) -> String — point scalar multiplication for the DVM, gated >= 9.0.0, 30k gas.
What it does
Multiplies a compressed bn256 G1 point (DERO's 33-byte encoding) by a uint64 scalar, returning the compressed result. The homomorphic counterpart to ec_add (I2, already in DVM v9 PR #84):
| Op |
Property |
ec_add(c1, c2) |
c1 + c2 (commitment accumulation) |
ec_mul(c, k) |
k·c (point derivation, key blinding, commitment scaling) |
Together they give a contract complete in-VM group arithmetic on commitments — point derivation for key blinding, commitment scaling, and accumulation — without oracle dependence.
Tests (TestEcMul)
ec_mul(c, 2) == ec_add(c, c) — the homomorphic pair
- scalar composition:
ec_mul(ec_mul(c, 3), 2) == ec_mul(c, 6)
ec_mul(c, 1) == c (identity)
ec_mul(c, 0) produces a valid point encoding
- output is always a 33-byte compressed point (66 hex)
- version gate: invisible to
1.2.3 contracts
Relationship
Branch: feature/dvm-i3-ecmul in the fork liqdmetal/derohe-improvements-by-liqdmetal (stacked on feature/dvm-v9-intrinsics).
Summary
I3 from the intrinsic agenda:
ec_mul(point_hex String, scalar Uint64) -> String— point scalar multiplication for the DVM, gated>= 9.0.0, 30k gas.What it does
Multiplies a compressed bn256 G1 point (DERO's 33-byte encoding) by a uint64 scalar, returning the compressed result. The homomorphic counterpart to
ec_add(I2, already in DVM v9 PR #84):ec_add(c1, c2)ec_mul(c, k)Together they give a contract complete in-VM group arithmetic on commitments — point derivation for key blinding, commitment scaling, and accumulation — without oracle dependence.
Tests (
TestEcMul)ec_mul(c, 2) == ec_add(c, c)— the homomorphic pairec_mul(ec_mul(c, 3), 2) == ec_mul(c, 6)ec_mul(c, 1) == c(identity)ec_mul(c, 0)produces a valid point encoding1.2.3contractsRelationship
>= 9.0.0gate, same group-arithmetic familyec_add/ec_mulpair; the AMM-reserve/confidential-settlement use case is now fully expressible in-VMBranch:
feature/dvm-i3-ecmulin the forkliqdmetal/derohe-improvements-by-liqdmetal(stacked onfeature/dvm-v9-intrinsics).