Skip to content

I3: ec_mul intrinsic — point scalar multiplication for DVM #104

Description

@liqdmetal

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions