-
Notifications
You must be signed in to change notification settings - Fork 161
Description
The purpose of this issue is to explain product requirements of Chain Signatures. We don't go into implementation details because those are changeable.
Description
Chain Signatures allow for a smart contract to call an async method
async sign(payload: Bytes) -> SignatureThe signature is of the paylaod provided using a key unique to the caller. The output will always be the same if the caller and payload remain the same. The signature is an ECDSA signature on the Secp256k1 curve.
Use cases
For the sake of clarity I've broken down the use cases into simple component parts, but practically we're going to be using all of these use cases in a single application.
Oauth controlled Etherium accounts
On-boarding is a huge problem for decentralized applications. If we want widespread adoption we can't expect people to keep seed phrases safe in order to use an application.
An attractive way of managing Web3 accounts is to use existing Web2 accounts to on-board users. This can be done in the following way:
- Deploy a NEAR contract that allows the bearer of a users JWT token to sign an Etherium transactions
- The user validates their identity with a third party receiving a JWT Token
- The user uses that JWT token1 to interact with Etherium applications via the NEAR contract for for the duration of it's validity
Any method of controlling a NEAR account can also be used to control a cross chain account.
Keypom on Polygon
Keypom provides zero friction onboarding and transactions for NEAR. They are generally used for NFT drops, FT drops and ticketing.
They uses unique features of the NEAR account model to allow for easier user on-boarding:
- The developer creates a restricted NEAR account
- The account is funded with NEAR
- The user is give a key with limited control of the account
- The user uses the funded account to call controlled endpoints on NEAR
- The user returns the remaining funds to the developer and their account is unlocked
This allows easy on-boarding to decentralized apps. The accounts are initially restricted to prevent the user being able to simply withdraw the NEAR from the account.
With Chain Signatures you can do the same thing but across many chains, for example Polygon:
- The developer creates a restricted NEAR account with a key
- The account is funded with NEAR and MATIC
- The user is give a key with limited control of the account
- The user uses the funded account to sign payloads calling controlled endpoints on Polygon
- The user returns the remaining funds to the developer and their account is unlocked
This allows developers to pay for users to use arbitrary contracts on arbitrary chains.
Decentralized Clients
One of the big problems in decentralized applications is that while the smart contracts are tamper-proof, the clients that access them generally aren't. This allows practically complete control over any users account provided they are using the frontend assets that you serve. This has security, trust and regulatory implications.
When smart contracts can sign payloads you can start using signed exchanges (or polyfills) to require HTTP exchanges to be signed by a certain key. If it is not signed with this key the SSL certificate is considered invalid. This means that individual users cannot be served invalid frontends without it being generally observable and non repudiable.
Communication with private NEAR Shards
Currently companies like Calimero make private NEAR shards. Currently sending messages to and from these NEAR shards is a pain. If each shard had the ability to sign their message queues, they could be securely sent from one shard to another. Thus you could communicate bidirectionally with any shard as easily as you can with a contract on your own shard.
Furthermore this could dramatically simplify the sharding model of NEAR, by treating each NEAR shard like one would a private shard.
Future use cases
Chain decryptable messages 2
Certain on chain keys allow the following flow:
- The sender sends encrypted data onto the chain
- When a receiver proves they have a right to the data it is re-encrypted with their key
- The receiver then decrypts the data
This is useful for paid content, whatsapp messages and any private data on chain.
Apart from the obvious this also enables:
- Secret-bid auctions with MEV protection Users can submit bids that are encrypted at the end of the auction, the smart contract can decrypt all bids with a single evaluation.
- Dead man’s switch. Journalists or whistleblowers can ensure that compromising information in their possession is automatically published if they were to become incapacitated
- One-time programs Programs that can be executed only once on a single input, and that don’t leak anything about the program other than the result of the computation
On Chain Domain Control3
It may be possible to use DNSSEC & email signatures to control the DNS record and the sending of emails from a domain.
There are practical issues
Footnotes
-
JSON Web Tokens are a standard RFC 7519 method for representing claims securely between two parties. They are used in this example to represent the claim that someone is the owner of an Oauth account. ↩
-
This might require BLS signatures and further work description of one implementation exists here ↩
-
This is speculative ↩
Metadata
Metadata
Assignees
Labels
Type
Projects
Status