Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operations on Ambients #10

Open
nud3l opened this issue Jul 30, 2019 · 1 comment
Open

Operations on Ambients #10

nud3l opened this issue Jul 30, 2019 · 1 comment

Comments

@nud3l
Copy link

nud3l commented Jul 30, 2019

Background

I was trying to play around with the Ambients proposal to create something like a "mini" Bitcoin on Ambients where one could spend previously unspent outputs to create a new transaction.

Question

Is it possible with Ambients to create new data from existing data logs? So for example, if I have a transaction 'tx_0' with one unspent output. I want to then create a new transaction 'tx_1' that uses the output of 'tx_0' as its input and creates a new unspent output. The following things are not clear to me:

  • I think there has to be a new reduction of 'tx_0' that indicates that this transaction is spent. In my understanding, that would mean any node in the network would need to be aware of 'tx_0' and 'tx_1' to see if it's spent. Is that assumption correct?
  • I am not sure how to enforce valid spending in the Ambients case. Assuming you would have a way to verify a signature inside Ambients, would the reduction of 'tx_0' and 'tx_1' only be valid if the signature is deemed valid?
@haadcode
Copy link
Contributor

Great question @nud3l!

Perhaps there's more to the question than I understand, but in simplified terms "a new transaction 'tx_1' that uses the output of 'tx_0'" would be written as (pseudo JS code):

const tx_0 = Tx.create() // "genesis"
const tx_1 = Tx.create(tx_0)

Does that make sense?

any node in the network would need to be aware of 'tx_0' and 'tx_1' to see if it's spent. Is that assumption correct?

Correct. Knowing tx_1 implies knowing tx_0 (as tx_1 references tx_0 in the execution log).

would the reduction of 'tx_0' and 'tx_1' only be valid if the signature is deemed valid?

Correct. Reduction of tx_0 and tx_1 is only valid if signatures for both are valid.

Hope this answers (some of) your questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants