Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sismo-core/sismo-commitment-mapper


https://github.com/sismo-core/sismo-commitment-mapper

Last synced: 5 days ago
JSON representation

Awesome Lists containing this project

README

        




Logo


Commitment Mapper


Made by Sismo












# Commitment Mapper

The commitment mapper is an off-chain trusted service provided by Sismo.

It enables account owners to convert a proof of account ownership into a proof of secret knowledge.

The account owner receives a receipt from the Commitment Mapper, which maps their account with their commitment (e.g hash of their secret). The commitment mapper ensures that only one commitment can be associated to an account.

The combination of the user's secret and the commitment mapper receipt form the Delegated Proof Of Ownership.

You will find more information in the [documentation](https://commitment-mapper.docs.sismo.io/).

# Public keys

## Hydra Delegated Proof Of Ownership

- URI: https://x5y521b36b.execute-api.eu-west-1.amazonaws.com
- EdDSAPubKey:
- X: `0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d644`
- Y: `0x12c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642`

# Commitment mapper implementations

The commitment mapper can have multiple implementations where the signature algorithm from the commitment mapper varies. The map which stores the commitments is then namespaced for each type of implementation.

## Hydra
### Specification

The Hydra was designed for an easy verification inside a Snark Circuit. Its specifications are:

- Signature algorithm: `EdDSA` using `poseidon` hash function and the `BabyJubJub` elliptic curve.
- `CommitmentReceipt = Signature(PoseidonHash(Ethereum Address, Commitment))`

A commitment is generated based on the following specification:

- `Commitment = PoseidonHash(secret)`, where the secret is a random number choosen by the user and hashed in the browser.

The Poseidon hash algorithm makes the commitmentReceipt easy to verify inside a snark circuit (~ 5000 constraints). That means a snark circuit can easily verify that a specific secret is only known by the owner of an Ethereum Address. This secret then acts as a proof of ownership for the Ethereum Address.

### API Endpoint

#### Commit Ethereum account
Endpoint: `https://x5y521b36b.execute-api.eu-west-1.amazonaws.com/commit-ethereum-eddsa`

Method: `POST`

Parameters:

- `ethAddress` : Ethereum Address to map with the commitment
- `ethSignature` : Signature of [this message](./src/commitment_logic/ownership.ts) by the Ethereum Address to prove the ownership
- `commitment` : The commitment choosen by the user

Response:

- `commitmentMapperPubKey` : The EdDSA public key of the commitment Mapper. This public key will never change.
- `commitmentReceipt` : The Signature(HashPoseidon(EthereumAddress, Commitment))

Example:

```bash
$ curl -X POST -H 'content-type: application/json' https://x5y521b36b.execute-api.eu-west-1.amazonaws.com/commit-ethereum-eddsa -d @- <
bottom