Highjhacker / Ark-Elixir

Ark API Wrapper in Elixir
MIT License
11 stars 0 forks source link

Post a new transaction on the network. #7

Open Highjhacker opened 6 years ago

Highjhacker commented 6 years ago

So, I think that we need to mention the elephant in the room ; creating a new transaction.

It's something needed, so if you have any thoughts on the subject, let's discuss it !

I guess the first thing to do is to check how it's implemented in Ark-js and check what we can do with elixir.

Swagger Doc

insanedefaults commented 6 years ago

Great issue! The transaction protocol is being updated. The details are outlined in AIP 11.

You may have noticed that the Swagger UI has a deprecated post transaction and a new one under peer. The ark-js project has an implementation of the new protocol here.

I suppose the question we should first answer is this do we support the old and new protocols or support only the new protocol?

From what I am seeing, the old protocol is still in use and the AIP for the new protocol still is in open discussion. I think implementing the old one now would be best. That said, I have no idea how to sign the transaction or anything, so it will likely require research to build a decent prototype. If you know more, that would be great!

Highjhacker commented 6 years ago

Agree, we should use the old/current one for now and then implement the new one when needed.

For making a new transaction, what I'm guessing is, you have to generate the correct json response, which can be easy for things like the timestamp of the transaction etc. But then some things are more complexes, like, the new transaction should have a valid TXID, but how to generate it to be in compliance with Ark ?

So I guess we should start looking at which crypto libs in Elixir can help us to achieve this and how the current process is implemented in the others Ark wrapper. (Arky, Ark-JS and SwiftyArk, ..)

insanedefaults commented 6 years ago

Sure thing, if you want, we can use this issue to post what we find.

Highjhacker commented 6 years ago

Gonna post the informations I'm gathering on how to create a valid transaction and edit this when I find something new.

This is what we need I guess.

insanedefaults commented 6 years ago

If the timex diff is just returning an epoch difference maybe we could skip around just using the library and calculate current_epoch_time - 1490187600.

I'm going to dig into putting the validateaddress function in Elixir later tonight.

Highjhacker commented 6 years ago

Hm, clever, won't change much and should be better performances wise, less dependencies more freedom 😄 Gonna look at that.

Highjhacker commented 6 years ago

Without Timex