Skip to content

Commit

Permalink
add walletconnect documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNerdi committed Nov 1, 2023
1 parent 3204775 commit a6c1376
Show file tree
Hide file tree
Showing 6 changed files with 168 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wallet-connect/eip155/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
icon: link
expanded: true
order: 999
---

# EIP155 RPC
80 changes: 80 additions & 0 deletions wallet-connect/eip155/supportedMethods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
icon: link
expanded: true
order: 999
---

# Supported Methods

### personal_sign
The sign method calculates an Ethereum specific signature with: `sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.

By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.

Note See ecRecover to verify the signature.

#### Parameters
message, account

`DATA`, N Bytes - message to sign.
`DATA`, 20 Bytes - address.

#### Returns
`DATA`: Signature

#### Example

```
// Request
{
"id": 1,
"jsonrpc": "2.0",
"method": "personal_sign",
"params":["0xdeadbeaf","0x9b2055d370f73ec7d8a03e965129118dc8f5bf83"],
}
// Result
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
}
```


### eth_sign
The sign method calculates an Ethereum specific signature with: `sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.

By adding a prefix to the message makes the calculated signature recognizable as an Ethereum specific signature. This prevents misuse where a malicious DApp can sign arbitrary data (e.g. transaction) and use the signature to impersonate the victim.

Note the address to sign with must be unlocked.

#### Parameters
account, message

`DATA`, 20 Bytes - address.
`DATA`, N Bytes - message to sign.
#### Returns
`DATA`: Signature

#### Example

```
// Request
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_sign",
"params": ["0x9b2055d370f73ec7d8a03e965129118dc8f5bf83", "0xdeadbeaf"],
}
// Result
{
"id": 1,
"jsonrpc": "2.0",
"result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
}
```

An example how to use solidity ecrecover to verify the signature calculated with eth_sign can be found here. The contract is deployed on the testnet Ropsten and Rinkeby.
28 changes: 28 additions & 0 deletions wallet-connect/guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
icon: book
order: 1000
---

# Guide

`WalletConnect`s `Web3Modal` has many suggestions on wallets on all ecosystems, but these suggestions can be adapted and changed by the dApp developer. If `Bloom` wallet implements features that your app requires, or if you generally want to recomment `Bloom` for your dApp's users, you can include the following code into your code base:

```
createWeb3Modal({
//...
featuredWalletIds: [
'1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369', // Bloom wallet
]
})
```

If your dApp requires a feature that most of the wallets don't implement, but `Bloom` does, you can use the following code instead of the code on top:

```
createWeb3Modal({
//...
includeWalletIds: [
'1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369', // Bloom wallet
]
})
```
14 changes: 14 additions & 0 deletions wallet-connect/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
icon: link
expanded: true
order: 999
---

# WalletConnect

To be able to connect with the IOTA / Shimmer ecosystem, Bloom implements `WalletConnect`(ref: https://docs.walletconnect.com/quickstart). WalletConnect is a generic interface, which offers the user the freedom to connect their trusted wallet to the dApp.

If you're a dApp developer and plan to implement `WalletConnect` into your dApp, checkout https://docs.walletconnect.com/web3modal/about.

[Include Bloom](guide.md)
[Supported Networks and Methods](supported.md)
30 changes: 30 additions & 0 deletions wallet-connect/supported.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
icon: search
order: 998
---

# Supported Networks and Methods

Bloom currently supports the following events for the following chains:

## EIP155

#### Supported Networks
`eip155:1073`, `eip155:1074`

#### Supported Methods
`personal_sign`, `eth_sign`


#### Implemented Events
`accountsChanged`, `chainChanged`


## TIP32

#### Supported Networks

#### Supported Methods

#### Implemented Events
`accountsChanged`, `chainChanged`
9 changes: 9 additions & 0 deletions wallet-connect/tip32/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
icon: link
expanded: true
order: 999
---

# TIP32 RPC

## TBD

0 comments on commit a6c1376

Please sign in to comment.