0

I know that there are no implementations of the above, but I am trying to add UTXOs into Stellar. In vanilla Stellar, I use the Stellar lab to construct operations like createAccount, payment etc. Now, if I want to add another operation for UTXO payments in the same lab, how will I do it? If in case you don't know, UTXO transaction formation is not very straight forward, it takes data from the previous transaction like its hash and output index. And based on the amount to be sent, it computes how many UTXOs to be used and also creates output UTXOs. So the system has to compute all of that, it is not as straight forward as creating a Stellar Transaction, where some data is entered and an XDR is formed.

I am not looking for a definite answer, there is no wrong or right in this situation, I am looking for suggestions and an interesting discussion.

More importantly, it does not have to be in Stellar Lab, the ultimate object is to have a combined wallet which will have Stellar Operations and UTXO operation.

  • Stellar Laboratory has nothing to do with it, it's only a GUI on top of Horizon API calls. Stellar Core uses completely different paradigm (and it's essentially a foundation for all Stellar killing features). If you want UTXO model then use another blockchain. Modifying current consensus algorithm to support UTXO model will cost you a fortune, and the new blockchain won't be compatible with current Stellar network or tools built on it. Don't mix paradigms and blockchains, it won't bring any good. – Orbit Lens Feb 8 at 12:09
  • Actually, we are working on modifying the stellar source code. Stellar runs on account based model, we are trying to introduce UTXO model into it as well, like make it a hybrid. So I was looking for some suggestions of how the architecture of a wallet might be, which supports stellar transactions and UTXO transactions as well. – Deb Feb 9 at 8:16
0

Not sure if my understanding on UTXO being correct:

3 accounts: A1, B, A2
respective balances = 100, 200, 0

When A sends B 30, new balances = 0, 230, 70 (neglecting the small tx fee)

And then the holder of A1 turns to use A2


If the understanding is right, you CANNOT achieve this in one single tx (from A1):

On Stellar to do this, a few operations are needed:

OP1 - [Payment] send 30 to B

OP2 - [Create account] start (=send) A2 with 70

OP3 - [Merge account] merge A1 into A2

OP1 & OP2 can be wrapped into one Tx, as they share the same signature requirements, but NOT OP3.

So, you need at least 2 transactions.

(Additionally, you may enforce the 2nd Tx with the pre-authorized transaction feature)


(Edit) IMO, the trouble thing is key management (switching from A1 to A2). So I actually wonder why UTXO being advocated.

  • I don't want to do a UTXO transaction from the available operations in Stellar. I want to add a new operation along with the existing operations. And about UTXO, it is the model used in Bitcoin, it is analogous to fiat currency like if I have to pay you $50 and I have a $100 bill, I won't tear up my note into half, I will give you the $100 bill and you will give me $50 in return. Check this link to see how a bitcoin transaction object look like. klmoney.wordpress.com/bitcoin-dissecting-transactions-part-1 – Deb Feb 8 at 8:18
  • then i guess u're talking about modifying source code... – cesarm Feb 8 at 9:47
  • i think Stellar's inborn model does not support this, as it does not differentiate the $100 & $50 in the system (for they have the same issuer). That means $1 from $100 or from $50 are the same. – cesarm Feb 8 at 9:48
  • 1
    You can easily achieve UTXO transaction as what you mentioned above in stellar without modifying the code. If you want to send 100$ and get 50$ back, you can do that with 2 operations under one transaction. and make that as a multisignature transaction. – Sharmilan Feb 11 at 9:25
  • 1
    True. But iam not sure how feasible it will be to make it without using multi signature. As stellar transaction and SCP depend on sequence number. To make this success stellar ideally require a sequence number with cross transaction. Anyway its good one to try out. – Sharmilan Feb 11 at 9:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.