Merge pull request #1 from austintgriffith/master
Update: Add uport, tokensubscription
This commit is contained in:
commit
c16893743e
22
README.md
22
README.md
|
@ -4,7 +4,23 @@
|
|||
|
||||
Let's all post our meta transaction formats here in a digestible format. The TL;DR here is to communicate how someone else could execute your meta transaction for you.
|
||||
|
||||
### Format
|
||||
## Implementations
|
||||
|
||||
[uport](https://github.com/austintgriffith/meta-transaction-format-share/blob/master/uport.org.md)
|
||||
|
||||
[tenzorum](https://github.com/austintgriffith/meta-transaction-format-share/blob/master/tenzorum.org.md)
|
||||
|
||||
[tokenubscription](https://github.com/austintgriffith/meta-transaction-format-share/blob/master/tokensubscription.com.md)
|
||||
|
||||
|
||||
## Important problems to solve
|
||||
|
||||
[relay collisions](https://github.com/austintgriffith/meta-transaction-format-share/issues/3)
|
||||
|
||||
[dynamic gas rewards](https://github.com/austintgriffith/meta-transaction-format-share/issues/4)
|
||||
|
||||
|
||||
## Format
|
||||
```
|
||||
{
|
||||
This is the format of my meta transaction
|
||||
|
@ -21,10 +37,8 @@ Let's all post our meta transaction formats here in a digestible format. The TL;
|
|||
### Tx
|
||||
```
|
||||
{
|
||||
Here is my (pseudo?)code for getting transactions on chain
|
||||
Here is my (pseudo?)code for putting transactions on chain
|
||||
}
|
||||
```
|
||||
|
||||
### Example Implementation Links
|
||||
|
||||
[TokenSubscription](https://github.com/austintgriffith/meta-transaction-format-share/blob/master/tokensubscription.com)
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
# Tenzorum Gasless TXs
|
||||
|
||||
### Format
|
||||
|
||||
```
|
||||
{
|
||||
uint8 _v, bytes32 _r, bytes32 _s,
|
||||
address _from, //the subscriber
|
||||
address _to, //the publisher
|
||||
uint _value, //wei value of transfer
|
||||
bytes _data, //data input
|
||||
address _rewardType, //reward relayers in tokens or ETH
|
||||
uint _rewardAmount //amount to reward
|
||||
}
|
||||
```
|
||||
|
||||
### Rx
|
||||
```
|
||||
##Client SDK
|
||||
|
||||
HTTP POST https://login.tenzorum.app/execute + {payload}
|
||||
GRAPHQL endpoint mutation ExecuteGaslessTx($from: $WalletAddress!, $to: $WalletAddress!, $amount: Int!) {
|
||||
executeTransaction(from: $from, to: $to) {
|
||||
amount
|
||||
}
|
||||
}
|
||||
|
||||
##Relay RPG
|
||||
- Coming
|
||||
```
|
||||
|
||||
### Tx
|
||||
```
|
||||
{
|
||||
function execute(
|
||||
uint8 _v, bytes32 _r, bytes32 _s,
|
||||
address _from,
|
||||
address _to,
|
||||
uint _value,
|
||||
bytes _data,
|
||||
address _rewardType, uint _rewardAmount) public
|
||||
}
|
||||
```
|
||||
|
||||
### Example Implementation Links
|
||||
- Coming
|
||||
|
||||
[Tenzorum](https://github.com/austintgriffith/meta-transaction-format-share/blob/master/tenzorum.org.md)
|
|
@ -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));
|
||||
}
|
||||
```
|
Loading…
Reference in New Issue