ssbc / ssb-keys

keyfile operations for ssb
36 stars 26 forks source link

support for ethereum keys #54

Closed dominictarr closed 4 years ago

dominictarr commented 5 years ago

To make ssb more inviting for the ethereum community, we are investigating adding feeds based on ethereum keys. (secp256k1) simply supporting messages signed by this curve would be easy, but we should take into account how ethereum signatures are actually formatted. I have received these tips from @danfinlay

Question: are there any example contracts (in the wild) which already use this?

interested parties: @ameba23 @dan-mi-sun

dominictarr commented 5 years ago

@ameba23 posted elsewhere:

i'm interested to get some more clarity on what this would enable us to do. in best case before our call with the eth foundation tomorrow, where we are gonna show them what we've been doing with secp256k1 signing.

i get the idea, with EIP712, that standardisation is needed in order to get the same non-binary data to reliably give the same hash or signature. this is much needed and makes total sense to me.

but i think you mentioned in the metamask meeting we had something about putting ethereum transactions into an SSB feed. and elsewhere (but i can't find the message now) you mentioned that is important that a valid SSB message should never ever be a valid ethereum transaction, as it would create a vulnerability that allows someone to post an existing message to the other system.

i feel like im still missing something as to what the ultimate goal we want to achieve is with interoperability, which cannot be achieved today by simply using SSB as off-chain transport, adding signatures made with an ethereum key.

dominictarr commented 5 years ago

The first goal (and only definite thing) is to simply be aware of the work the ethereum community has done with signatures. They'll have questions and we'll look better if we can answer them.

State channels is the main thing that would want you to be able to post a message that is accepted some way by a contract. Lets say, it's an auction - many people place bids (by signing something that would be accepted by the contract) but the contract may only accept one, so the seller sees many bids then sends the best one to the contract.

Maybe it's better to just post a message containing a signTypedData_v3 signature, but not try to also be a signTypedData signature.

dominictarr commented 5 years ago

notes: @danfinley tells me signTypedData has been slow to catch on, and he can't point me at a contract which uses it.

ethereum people seem interested in ssb for state channels, so should check that out... this thing, i think: https://www.counterfactual.com/statechannels/

helxsz commented 5 years ago

I am quite interested in state channels, how ssb is applied in state channel theoretically ?

stale[bot] commented 5 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

danfinlay commented 5 years ago

Oh hey, sorry for the slow reply.

signTypedData_v3 has been picking up some usage, and signTypedData_v4 is coming soon (supports arrays and recursive types, useful for nested comment threads, for example).

I think there's some great potential if some ssb feeds used one of those eth signature feeds, because it would mean that SSB posts could be provided as "proof" to Ethereum smart contracts, which seems like it could have a lot of interesting implications to me, but definitely has a fair amount of ecosystem growth to go before it would be practical or easy to use for developers.

stale[bot] commented 5 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

danfinlay commented 5 years ago

It's possible this could be removed, and ssb in MetaMask could be enabled using the current ssb key pattern using MetaMask Snaps, our upcoming plugin system, which allows a plugin to receive recoverable entropy to seed its own cryptography.

Given that, and the lack of energy towards this otherwise, it is probably the path of least resistance, and we could probably close this.

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?