-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DRVL-16] - Documentation Site Updates (#7699)
Co-authored-by: Raymond Jacobson <ray@audius.co>
- Loading branch information
1 parent
2738765
commit 5125501
Showing
68 changed files
with
4,575 additions
and
2,344 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,58 @@ | ||
abi | ||
audius | ||
blockhash | ||
ciphertexts | ||
delegater | ||
delegaters | ||
docusaurus | ||
erc | ||
esque | ||
eth | ||
ethereum | ||
etherscan | ||
figcaption | ||
fn | ||
fs | ||
goerli | ||
graphql | ||
gravatar | ||
img | ||
io | ||
ioredis | ||
js | ||
jwt | ||
mainnet | ||
metamask | ||
multisig | ||
nodejs | ||
nonpayable | ||
npm | ||
oauth | ||
off-chain | ||
on-chain | ||
onclick | ||
pauser | ||
permissionless | ||
polyfill | ||
postgres | ||
postgresql | ||
py | ||
redis | ||
screensnippet | ||
sdk | ||
sequelize | ||
skrillex | ||
sla | ||
sp | ||
spl | ||
staker | ||
stakers | ||
testnet | ||
ts | ||
typehash | ||
undelegate | ||
unrepost | ||
unstake | ||
userbase | ||
wei | ||
whitepaper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
--- | ||
id: hedgehog | ||
title: Hedgehog | ||
pagination_label: Hedgehog | ||
sidebar_label: Hedgehog | ||
description: Audius Protocol Documentation | ||
--- | ||
|
||
> Build DApps Like Apps | ||
--- | ||
|
||
Hedgehog is an open-source, client-side Ethereum wallet that uses a username and password. It aims | ||
to lower the barrier of entry to crypto projects for non tech-savvy users. | ||
|
||
Allow users to interact with your DApp just like they would any other website, no extensions | ||
required, without centralizing control of keys. | ||
|
||
Hedgehog is alternative to Metamask that manages a user's private key and wallet on the browser. It | ||
exposes a simple API to allow you to create an authentication scheme to let users sign up and login | ||
to their wallet across multiple browsers and devices. | ||
|
||
--- | ||
|
||
## Not All Transactions Are Created Equal | ||
|
||
Decentralized apps today require lots of technical knowledge to configure and use, limiting your | ||
user base and reducing the potential for growth. | ||
|
||
Currently available wallets treat every transaction as if it were moving around your life’s savings. | ||
Hedgehog was built for use-cases involving low-to-no financial value. | ||
|
||
Current Ethereum wallets treat every transaction as if it were moving your life’s savings. Hedgehog | ||
was built for use-cases involving low-to-no financial value. | ||
|
||
--- | ||
|
||
## Is Hedgehog Right for your DApp? | ||
|
||
:::note | ||
|
||
The primary improvement to end-user experience is gained by hiding wallet complexity and not forcing | ||
users to constantly confirm transactions - The opposite of what you’d want when moving significant | ||
money around. | ||
|
||
::: | ||
|
||
Hedgehog isn’t right for every DApp. Massive improvements in user experience are only possible | ||
through tradeoffs. As a general rule Hedgehog should not be used for apps involving significant sums | ||
of money. As a bridge, one could start users on Hedgehog and suggest migrating to a more secure | ||
wallet if their stored value increases beyond a certain threshold; the Hedgehog paradigm is | ||
interoperable with existing web3 providers too. | ||
|
||
### Good Use Cases | ||
|
||
- **Signing data** - If you’re building decentralized applications that rely on user signed data | ||
(eg. via EIP-712-esque signing schemes), Hedgehog could help simplify the experience if the stakes | ||
are low enough. | ||
- **Gaming DApp** - Nothing ruins fun as much as signing transactions. If you’re building a gaming | ||
DApp that doesn’t use significant financial assets, improving UX is key. | ||
- **Decentralized Music Player** - If you’re building consumer-facing DApps, Hedgehog will | ||
dramatically improve user experience and significantly increase your potential userbase. | ||
|
||
### Not So Good Use Cases | ||
|
||
If your DApp involves moving around significant sums of money, then the tradeoff in security is most | ||
likely not worth it. Hedgehog’s primary improvement to end-user experience is by hiding the wallet | ||
and not forcing users to confirm transactions - The opposite of what you’d want when moving money | ||
around. We absolutely don’t recommend using Hedgehog in situations like these: | ||
|
||
- Banking DApp | ||
- Decentralized Lending | ||
- Prediction Markets | ||
|
||
--- | ||
|
||
## A Closer Look | ||
|
||
Hedgehog is a package that lives in your front end application to create and manage a user's entropy | ||
(from which a private key is derived). Hedgehog relies on a username and password to create auth | ||
artifacts, so it's able to simulate a familiar authentication system that allows users to sign up or | ||
login from multiple browsers or devices and retrieve their entropy. Those artifacts, through | ||
hedgehog, are persisted to a backend of your choosing. | ||
|
||
:::note | ||
|
||
A private key is only computed and available client side and is never transmitted or stored anywhere | ||
besides the user's browser. | ||
|
||
::: | ||
|
||
```javascript | ||
// Provide getFn, setAuthFn, setUserFn as requests to your database/backend service (more details in docs). | ||
|
||
const hedgehog = new Hedgehog(getFn, setAuthFn, setUserFn) | ||
|
||
let wallet | ||
|
||
if (hedgehog.isLoggedIn()) { | ||
wallet = hedgehog.getWallet() | ||
} else { | ||
wallet = await hedgehog.login('username', 'password') | ||
// or | ||
wallet = await hedgehog.signUp('username', 'password') | ||
} | ||
``` | ||
|
||
After creating or retrieving a user's wallet, you can either **fund their wallet directly** to pay | ||
transaction fees or **relay their transactions through a EIP-712 relayer**. | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i --save @audius/hedgehog | ||
``` | ||
|
||
--- | ||
|
||
## Docs & Examples | ||
|
||
For a quick browser-side demo, [look no further](https://codesandbox.io/embed/pp9zzv2n00). For a | ||
full end-to-end auth demonstration, see our | ||
[demo repo](https://github.com/AudiusProject/audius-hedgehog-demo). | ||
|
||
Ready to learn more? | ||
[Take a deeper dive into the docs](https://audiusproject.github.io/hedgehog-docs) and find the | ||
source code on [Github](https://github.com/AudiusProject/hedgehog). |
Oops, something went wrong.