elective-stereophonic
elective-stereophonic
Universal Gateway Protocol - goal is to have official GUI support this singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.12.2

Author Topic: Universal Gateway Protocol - goal is to have official GUI support this  (Read 4649 times)

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

I am proposing a standard AM + asset transfer protocol so that without any gateway specific software installed, the official NXT web GUI will be able to request deposit addresses and process withdrawals just by configuring the gateway's NXT address!

All gateway operators unite and we should be able to get this into the standard NXT GUI and this will make it super easy for users to deposit and withdraw from the gateways. I also would like to propose gateway <-> gateway acceptance of identical crypto assets at 1:1 exchange rate. This will make all NXT AE BTC assets worth exactly the same and avoid ripples nightmare of USD != USD. Super confusing to users, especially if there is a 20% difference in value.

Now, each gateway operator needs to be comfortable with the other to offer this 1:1, so contact me if you want to participate in the 1:1 plan and we can work out the details. I think all we need to do is guarantee redemption to each others satisfaction, so for respected members it wont be an issue. So as to not leave out any newcomer gateways, I can suggest putting up an escrow deposit with anon136 to substitute for reputation.

Anyway, the following is my proposal:

AM to request deposit address should have a binary header of XX bytes, the first 4 bytes being 0xxxxxxxxx, the rest being gateway specific

struct universal_gateway_AM
{
    uint32_t sig; // must be 0xxxxxxxx
    int32_t size; // total size of AM
    uint64_t nxt64bits; // address of sender to be used as error checking
    uint32_t funcid; // funcid 'g' to generate deposit address(es)
    uint32_t gatewayid,timestamp,jsonflag; // timestamp should be NXT timestamp of request and jsonflag should be 1
    char jsonstr[]; // JSON of deposit addr request goes here
};

Now the above is of course after the hex coding/decoding is done. source code to process this format is in NXTutils.h

The format for the JSON to make a request for deposit is:

{"BTC":"<withdraw address>","LTC":"<withdraw address>",<user defined custom fields>}

so for any supported currency, just make a JSON field with that name followed by "" or "<withdraw address>"
This allows storing of a default withdraw address with each account

The above is then put into the jsonstr[] portion of the pre encoded AM, which is then hexencoded and submitted.


Now the withdraw side is similar but using asset transfer instead of AM
send asset transfer to the gateway NXT address with a comment field:

{"redeem":"LTC","withdrawaddr":"",<user defined fields>}

If no withdraw address is specified, the default withdraw address is used. There will also be a user defined field(s) that can be added which will be totally gateway specific. In the GUI, there will just be a place for the users to fill in the custom fields and values. The custom fields allows advanced users to make special requests or just put message to communicate with the gateway.

TEAM will be implementing a reference version of this universal gateway protocol into the NXTservices enhanced GUI. From there we will work to get it ported into the official NXT GUI release.

If you are a gateway operator, please post here any changes you want. Now is the time to get this standardized

James

Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

There is also another AM that needs to be mentioned as part of this protocol and that is the return AM from the gateway with the deposit address.

currently MGW spews out a pretty complex JSON in the same AM format as the deposit address AM

{"NXTaddr":"14505659771222895011","address":"3Hwwg1GewhqF4UScQvz4hsdCmK7d5TjsYQ","redeemScript":"522103ac383f6dc38ec4de8d09ca17c204d12bd0f4b4cc953fc70afb7c1d5283b04d7c2103e59eeba785b00d8705358af44c6ed8cd2c2773d24470ce60fdbd69c6834770b22103b1f00b95d792dd83bad4f16dfeaf57956e2caa7bf03e05362a16a6e44dcc2edb53ae","coin":"LTC","coinid":"2","pubkey":[{"address":"LXJTAX6kZS7Ytf6fyVphQ5eMpULj4DtLxL","pubkey":"03ac383f6dc38ec4de8d09ca17c204d12bd0f4b4cc953fc70afb7c1d5283b04d7c"},{"address":"LS36rR1xdYZj7aGvZDh9peoP1rW4CAEHSb","pubkey":"03e59eeba785b00d8705358af44c6ed8cd2c2773d24470ce60fdbd69c6834770b2"},{"address":"Lgxmu4EB1eY3Ldzwm4wULwXBz3uHWLRMhF","pubkey":"03b1f00b95d792dd83bad4f16dfeaf57956e2caa7bf03e05362a16a6e44dcc2edb"}]}

Unless any other gateway is also doing multisig, it can just be:

{"NXTaddr":"14505659771222895011","address":"3Hwwg1GewhqF4UScQvz4hsdCmK7d5TjsYQ","coin":"LTC"}

and maybe we should make an array out of it so multiple coin addresses all fit in one AM to reduce cost and blockchain bloat

James
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

valarmg

  • Hero Member
  • *****
  • Karma: +178/-57
  • Offline Offline
  • Posts: 1766
    • View Profile


All gateway operators unite and we should be able to get this into the standard NXT GUI and this will make it super easy for users to deposit and withdraw from the gateways. I also would like to propose gateway <-> gateway acceptance of identical crypto assets at 1:1 exchange rate. This will make all NXT AE BTC assets worth exactly the same and avoid ripples nightmare of USD != USD. Super confusing to users, especially if there is a 20% difference in value.

Now, each gateway operator needs to be comfortable with the other to offer this 1:1, so contact me if you want to participate in the 1:1 plan and we can work out the details. I think all we need to do is guarantee redemption to each others satisfaction, so for respected members it wont be an issue. So as to not leave out any newcomer gateways, I can suggest putting up an escrow deposit with anon136 to substitute for reputation.


Wanted to discuss this a bit more. Seems like this will be troublesome in practice. You have created a super secure gateway, but once other gateways come online, all the hackers have to do is to hack the least secure gateway, and then use this 1:1 equivalency to take bitcoins from the other gateways. Who decides which gateways need escrow, who decides whether a gateway is secure enough to be allowed into this system? (We are creating the blockchain and multigateway to remove trust, and this just adds it back in.) Just seems like it could become a nightmare to manage this.

What not let the free market decide how much each BTC assets is worth? If someone opens a trusted gateway, then there's no reason it won't have 1 for 1 equivalency. If it becomes less trusted, then the market rate might go up or down naturally (like when MGox bitcoin was a different price to Bitstamp bitcoin.).
Logged
NXT-CSED-4PK5-AR4V-6UB5V

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile


All gateway operators unite and we should be able to get this into the standard NXT GUI and this will make it super easy for users to deposit and withdraw from the gateways. I also would like to propose gateway <-> gateway acceptance of identical crypto assets at 1:1 exchange rate. This will make all NXT AE BTC assets worth exactly the same and avoid ripples nightmare of USD != USD. Super confusing to users, especially if there is a 20% difference in value.

Now, each gateway operator needs to be comfortable with the other to offer this 1:1, so contact me if you want to participate in the 1:1 plan and we can work out the details. I think all we need to do is guarantee redemption to each others satisfaction, so for respected members it wont be an issue. So as to not leave out any newcomer gateways, I can suggest putting up an escrow deposit with anon136 to substitute for reputation.


Wanted to discuss this a bit more. Seems like this will be troublesome in practice. You have created a super secure gateway, but once other gateways come online, all the hackers have to do is to hack the least secure gateway, and then use this 1:1 equivalency to take bitcoins from the other gateways. Who decides which gateways need escrow, who decides whether a gateway is secure enough to be allowed into this system? (We are creating the blockchain and multigateway to remove trust, and this just adds it back in.) Just seems like it could become a nightmare to manage this.

What not let the free market decide how much each BTC assets is worth? If someone opens a trusted gateway, then there's no reason it won't have 1 for 1 equivalency. If it becomes less trusted, then the market rate might go up or down naturally (like when MGox bitcoin was a different price to Bitstamp bitcoin.).
good point. was trying to solve the user confusion problem
Maybe this needs a rethink
I think some sort of credit limit would take care of most issues
trying to balance decentralization, user confusion and security

maybe the 1:1 doesnt apply if a gateway gets hacked? Just when things are running smoothly for everyone. This way people would choose the most secure gateway, not sure...
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

valarmg

  • Hero Member
  • *****
  • Karma: +178/-57
  • Offline Offline
  • Posts: 1766
    • View Profile


good point. was trying to solve the user confusion problem
Maybe this needs a rethink
I think some sort of credit limit would take care of most issues
trying to balance decentralization, user confusion and security

maybe the 1:1 doesnt apply if a gateway gets hacked? Just when things are running smoothly for everyone. This way people would choose the most secure gateway, not sure...

You are talking about AE bitcoins not being exactly worth bitcoin. This should never happen as long as the gateway is working properly, right? It doesn't seem to be something that needs to be enforced. Under what circumstances do you see gateway AE bitcoins not being worth 1bitcoin?

Users have be aware exactly what each AE bitcoin asset is backed up by. If I just go now and create a bitcoin asset (not backed by anything) and a user buys it, then it won't be worth a bitcoin. You can't control what other asset exchange users do with their assets, you just have to make sure that the MGW_bitcoin asset is absolutely trusted and secure. (And similarly other owners of their gateways have to do the same). Does it matter to bitstamp if a bitcoin is worth slightly different on another exchange?




Logged
NXT-CSED-4PK5-AR4V-6UB5V

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile


good point. was trying to solve the user confusion problem
Maybe this needs a rethink
I think some sort of credit limit would take care of most issues
trying to balance decentralization, user confusion and security

maybe the 1:1 doesnt apply if a gateway gets hacked? Just when things are running smoothly for everyone. This way people would choose the most secure gateway, not sure...

You are talking about AE bitcoins not being exactly worth bitcoin. This should never happen as long as the gateway is working properly, right? It doesn't seem to be something that needs to be enforced. Under what circumstances do you see gateway AE bitcoins not being worth 1bitcoin?

Users have be aware exactly what each AE bitcoin asset is backed up by. If I just go now and create a bitcoin asset (not backed by anything) and a user buys it, then it won't be worth a bitcoin. You can't control what other asset exchange users do with their assets, you just have to make sure that the MGW_bitcoin asset is absolutely trusted and secure. (And similarly for other gateways)
that's what ripple said and an average 15% difference was immediately there for USD from snapswap vs bitstamp
you are talking theoretical high volume arbitraged prices
What if there isnt high volume?
What if there are any arbitrageurs?

maybe its not a problem, maybe I am just fighting the last battle (ripple), so we can wait and see what happens and address it if it becomes an issue
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

bitcoinpaul

  • Hero Member
  • *****
  • Karma: +590/-590
  • Offline Offline
  • Posts: 3097
  • Karmageddon
    • View Profile


What not let the free market decide how much each BTC assets is worth?


+10

I already discussed the idea long time ago in the monster thread when we talked about naming the assets. So goxBTC are were worth less than bitstampBTC. No way 1:1 is the way to go.
Logged
Like my Avatar? Reply now! NXT-M5JR-2L5Z-CFBP-8X7P3

valarmg

  • Hero Member
  • *****
  • Karma: +178/-57
  • Offline Offline
  • Posts: 1766
    • View Profile


that's what ripple said and an average 15% difference was immediately there for USD from snapswap vs bitstamp
you are talking theoretical high volume arbitraged prices
What if there isnt high volume?
What if there are any arbitrageurs?

maybe its not a problem, maybe I am just fighting the last battle (ripple), so we can wait and see what happens and address it if it becomes an issue
I'm not familiar with the reason for the ripple difference, but I'm sure there were some. Just like there was a reason for the MtGox/Bitstamp difference. I think you just have to let the market forces work. If there are no arbitrageurs, then do it yourself or find someone that will (free money!).

USDs are often hard to move around, which creates a difference in their value (e.g. Argentina black market rate). I find it hard to see any reason that the bitcoin/AE bitcoin value will be different to 1:1 since it's so easy to move bitcoins around (as long as the gateway is trusted). Now when the Fiat gateway comes along there will very likely be a difference between a 1:1 ratio, depending on how hard dollars are to get in/out of the system.
Logged
NXT-CSED-4PK5-AR4V-6UB5V

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile


that's what ripple said and an average 15% difference was immediately there for USD from snapswap vs bitstamp
you are talking theoretical high volume arbitraged prices
What if there isnt high volume?
What if there are any arbitrageurs?

maybe its not a problem, maybe I am just fighting the last battle (ripple), so we can wait and see what happens and address it if it becomes an issue
I'm not familiar with the reason for the ripple difference, but I'm sure there were some. Just like there was a reason for the MtGox/Bitstamp difference. I think you just have to let the market forces work. If there are no arbitrageurs, then do it yourself or find someone that will (free money!).

USDs are often hard to move around, which creates a difference in their value (e.g. Argentina black market rate). I find it hard to see any reason that the bitcoin/AE bitcoin value will be different to 1:1 since it's so easy to move bitcoins around (as long as the gateway is trusted). Now when the Fiat gateway comes along there will very likely be a difference between a 1:1 ratio, depending on how hard dollars are to get in/out of the system.
I believe you are right about the fiat issue
yes the USD had the biggest differences, but CNY was actually pretty close
the BTC price differences were mostly just giant spreads causing large effective differences, but that is a matter of liquidity not different values

so, nix the idea of 1:1
i am ok with that
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

Daedelus

  • Hero Member
  • *****
  • Karma: +230/-12
  • Offline Offline
  • Posts: 3280
    • View Profile

I am proposing a standard AM + asset transfer protocol so that without any gateway specific software installed, the official NXT web GUI will be able to request deposit addresses and process withdrawals just by configuring the gateway's NXT address!

I like this bit.

Any news?
Logged
NXT: NXT-4CS7-S4N5-PTH5-A8R2Q

bitcoinpaul

  • Hero Member
  • *****
  • Karma: +590/-590
  • Offline Offline
  • Posts: 3097
  • Karmageddon
    • View Profile

I am proposing a standard AM + asset transfer protocol so that without any gateway specific software installed, the official NXT web GUI will be able to request deposit addresses and process withdrawals just by configuring the gateway's NXT address!

I like this bit.

Any news?

Do you want to implement something for a service on top of Nxt (Gateways) into the standard Nxt client?
Logged
Like my Avatar? Reply now! NXT-M5JR-2L5Z-CFBP-8X7P3

bitcoinpaul

  • Hero Member
  • *****
  • Karma: +590/-590
  • Offline Offline
  • Posts: 3097
  • Karmageddon
    • View Profile

Anyone - do I understand this wrong?
Logged
Like my Avatar? Reply now! NXT-M5JR-2L5Z-CFBP-8X7P3

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

I am proposing a standard AM + asset transfer protocol so that without any gateway specific software installed, the official NXT web GUI will be able to request deposit addresses and process withdrawals just by configuring the gateway's NXT address!

I like this bit.

Any news?

Do you want to implement something for a service on top of Nxt (Gateways) into the standard Nxt client?
This would be disabled until the user put in their gateway's NXT address
At that point all it would do is send an AM to request deposit addresses and have a convenient withdraw form that does an asset transfer to the user specified gateway

it is totally gateway agnostic and just implements sending AM and asset transfer using standardized format so any gateway can get compatibility with NXT.

Think of it as defining an API that allows for easy integration into NXT for any and all gateways, so that is why I propose it for the core

Do you see anything wrong with this?

James
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

bitcoinpaul

  • Hero Member
  • *****
  • Karma: +590/-590
  • Offline Offline
  • Posts: 3097
  • Karmageddon
    • View Profile

Maybe we should instead find a secure solution for plugins/add-ons in the client to not clutter the official client with third party stuff and instead pave the way for many possibilities.
« Last Edit: June 24, 2014, 08:39:15 pm by bitcoinpaul »
Logged
Like my Avatar? Reply now! NXT-M5JR-2L5Z-CFBP-8X7P3

rudeboi

  • Hero Member
  • *****
  • Karma: +55/-4
  • Offline Offline
  • Posts: 633
  • Nxt Organization Member
    • View Profile

Maybe we should instead find a secure solution for plugins/add-ons in the client to not clutter the official client with third party stuff and instead pave the way for many possibilities.

+1
Logged
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬  ▄▀▀▀▀▀▀▀▀▄  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●  nimirum  ●▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
▬▬▬ ◖ENDING CENSORSHIP ONLINE◗  ◖ ICO OPEN NOW◗ ▬▬▬

jl777

  • Hero Member
  • *****
  • Karma: +718/-123
  • Offline Offline
  • Posts: 6170
    • View Profile

Maybe we should instead find a secure solution for plugins/add-ons in the client to not clutter the official client with third party stuff and instead pave the way for many possibilities.

+1
OK then, why not implement a universal gateway protocol within a plugin
I dont really care about the packaging, just think this would help NXT to have an easy way for any gateway to get supported

James
Logged
There are over 1000 people in SuperNET slack! http://slackinvite.supernet.org/ automatically sends you an invite

I am just a simple C programmer

Eadeqa

  • Hero Member
  • *****
  • Karma: +83/-68
  • Offline Offline
  • Posts: 1888
    • View Profile

Given only AM and AE are required, it should not be hard for Wesley to develop a universal protocol that any gateway can use to build an exchange that uses Nxt AE.  No plugins would be required.

A user could use AM commands to communicate with gateway server (for example, just sending  AM "help" to a server address would result in the server responding with instructions, and list of available coins , etc)
Logged
NXT-GZYP-FMRT-FQ9K-3YQGS
 

elective-stereophonic
elective-stereophonic
assembly
assembly