Adding uPort

This commit is contained in:
KamesCG 2018-09-13 22:44:15 +02:00 committed by GitHub
parent 54f0bdecb5
commit 9a8f9b62da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 0 deletions

39
uport.org.md Normal file
View File

@ -0,0 +1,39 @@
### Format
```
{
uint8 sigV,
bytes32 sigR,
bytes32 sigS,
address destination,
bytes data,
address listOwner
}
```
### Rx
```
{
Coming Soon
}
```
### Tx
```
{
// only allow senders from the whitelist specified by the user,
// 0x0 means no whitelist.
require(listOwner == 0x0 || whitelist[listOwner][msg.sender]);
address claimedSender = getAddress(data);
// use EIP 191
// 0x19 :: version :: relay :: whitelistOwner :: nonce :: destination :: data
bytes32 h = keccak256(byte(0x19), byte(0), this, listOwner, nonce[claimedSender], destination, data);
address addressFromSig = ecrecover(h, sigV, sigR, sigS);
require(claimedSender == addressFromSig);
nonce[claimedSender]++; //if we are going to do tx, update nonce
require(destination.call(data));
}
```