Open Highjhacker opened 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!
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, ..)
Sure thing, if you want, we can use this issue to post what we find.
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.
We need to check if the address provided in the transaction is valid (See here )
We need to check the public key
We need to generate a valid txID
Optional vendorfield
Validate the password (and the second one too if it exists)
Calculate the correct timestamp (see this and tell me what you think about that)
...
Then we need to wrap it up and POST it to the correct endpoint
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.
Hm, clever, won't change much and should be better performances wise, less dependencies more freedom 😄 Gonna look at that.
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