or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Secure Deterministic Social Wallet Address
User Story
I want to send some erc20s to someone, but I don't have their address, I only have their twitter handle.
I want to be able to send crypto to a wallet generated by their twitter handle, but that wallet currently does not exist.
Solution
1. In the SDK, someone calls getAddressOffline(twitter handle, rpc, entrypoint address, factory) and we return
Newly Generated Wallet Address = CREATE2(factory contract address, twitter handle, fun wallet bytecode)
Done, do FunWallet.getAddressOffline(uniqueId, index, rpcUrl, factoryAddress)
Then, they can just transfer eth to that address.
Time estimate: 2-3 hours
2. Add a commit function in FunWallet.sol Then, the twitter user who has possession of the twitter handle can call commit
Put this in a FunWallet.sol
TODO: Add this function and tests in the funwallet
Time estimate: 1-2 hours
3. The owner can then post the seed onto their twitter, an oracle comes in and gets the seed, then the wallet is deployed.
Call
createAccount
withsalt = can be anything
loginType = LoginTypes.TWITTER
socialHandle = twitter###paradigmeng420
TODO: Create a Oracle that monitors a given user's twitter posts OR that given a tweet link, can return the contents. Then, using the tweet contents, call the reveal function.
Time estimate: 6-8 hours
Scraping twitter:
https://www.scrapingdog.com/blog/scrape-twitter/
https://github.com/trevorhobenshield/twitter-api-client#get-all-usertweet-data
https://www.npmjs.com/package/rettiwt-api
Test everything
TODO: Write an E2E test transferring stuff from twitter accounts and claiming it.
Also, write a few unit tests
Total Time estimate: 9 - 13 hours
TODOs
Security
The Oracle Problem
Basically, we want some permissioned system to fetch the secret from twitter, then pass it into reveal. Here are a few ways to do this:
Scratch Work
Alternate implementation
Tradeoff: This will make createAccount more expensive for everyone, but idk where else we can put a check for this since we need this everytime someone calls createAccount to make sure they can't just create a funwallet from a twitter account