ComposableFi / near-rs

Utilities that faciliatate a trust-less bridge between Near and Polkadot
The Unlicense
5 stars 2 forks source link

Research signature verification in NEAR #10

Closed blasrodri closed 2 years ago

blasrodri commented 2 years ago

An important piece of the bridge between our para-chain and NEAR is the light client that will be running in NEAR. For this, we'll need to have a smart contract that updates the state of the world on-chain, and that's also capable of validating transactions and account states in a reliable way (through merkle proofs for instance).

There are certain unknowns in this task. In particular with regards to signature validation, which is a key piece of the smart contract logic. We'd like to have a PoC of a simple smart contract that performs signature verifications using Polkadot's schemes so that we can figure out how expensive these operations can be.

blasrodri commented 2 years ago

@ahlinc with regards to signature schemes: https://wiki.polkadot.network/docs/learn-keys

blasrodri commented 2 years ago

For our discussion: https://near.zulipchat.com/#narrow/stream/295302-general/topic/light_client

ahlinc commented 2 years ago

I've added a demo of a minimal environment to operate with sp_io functions in a ahl/poc/minimal-sp-io-environment branch. All sp_io functions communicates with a Substrate environment and have checks that the environment exists, at the same time the environment provides crypto keys storage for private keys and the storage handles all actions with private keys by itself.

blasrodri commented 2 years ago

I've added a demo of a minimal environment to operate with sp_io functions in a ahl/poc/minimal-sp-io-environment branch.

All sp_io functions communicates with a Substrate environment and have checks that the environment exists, at the same time the environment provides crypto keys storage for private keys and the storage handles all actions with private keys by itself.

Great! Do you have the numbers in gas cost?