stellar / go

Stellar's public monorepo of go code
https://stellar.org/developers
Apache License 2.0
1.29k stars 497 forks source link

Add JSON -> XDR Horizon endpoint #346

Open vladfaust opened 6 years ago

vladfaust commented 6 years ago

Many languages (like my favorite, Crystal) lack in a handful XDR implementation, which leads to a lower adoption. Currently such kind of developer can forward JSON'ed transaction to their Federation Bridge server and interact with Stellar from there, but such approach decreases decentralization. Horizon could have some builder endpoint itself which would convert JSON transaction input to XDR.

How I see it: an app builds a JSON transaction without signatures and sends it to /builder endpoint, getting XDR in response. A user then signs the XDR and sends it back to Horizon Create Transaction edpoint. I do know that signatures must be part of the XDR payload, but I think this could be overcome somehow without messing up with blockchain history (like appending signatures to the payload within Horizon itself).

The challenge here is to invent a JSON transaction protocol, but I don't see much difficulties here, because JSON structure would be same as XDR but with named fields Already done in Bridge

bartekn commented 6 years ago

We can discuss this but right now you can use /builder endpoint of the Bridge server.

vladfaust commented 6 years ago

@bartekn it decreases decentralization. There must be a third-party Bridge server to use /builder endpoint. How about merging the builder into Horizon?