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

SPV support #108

Closed
mercadoa opened this issue Apr 12, 2019 · 3 comments
Closed

SPV support #108

mercadoa opened this issue Apr 12, 2019 · 3 comments
Assignees
Milestone

Comments

@mercadoa
Copy link
Contributor

(blocked by transaction block format, chain header oracle)

Support SPV via a built-in function that recognizes a JSON payload of a particular format.

The JSON payload contains an SPV merkle proof of some receipt on another chain plus intermediate/connecting merkle roots leading to the executing chain.

@mercadoa
Copy link
Contributor Author

➤ Lars Kuhtz commented:

The currently implemented SPV API doesn't require any intermediate/connection merkle roots.

This is the public API of Chainweb.Payload.SPV ( https://github.com/kadena-io/chainweb/blob/c9bb53fab1040193a23f32e25d4315b8221bb79b/src/Chainweb/Payload/SPV.hs#L17 ):

-- | Runs a transaction Proof. Returns the block hash on the target chain for
-- which inclusion is proven.

runTransactionProof :: TransactionProof SHA512t_256 -> BlockHash

-- | Verify a proof against the head of the target chain in the given CutDb. It guarantees that
-- the proof target Merkle hash is contained in the head of the target chain in the CutDb.

verifyTransactionProof
:: CutDb
-> TransactionProof SHA512t_256
-> IO Transaction

-- | Creates a witness that a transaction in is included in the head
-- of a chain in a chainweb.

createTransactionProof
:: PayloadCas cas
=> CutDb
-- ^ Block Header Database
-> PayloadDb cas
-- ^ Payload Database
-> ChainId
-- ^ target chain. The proof asserts that the subject
-- is included in the head of this chain.
-> ChainId
-- ^ source chain. This the chain of the subject
-> BlockHeight
-- ^ The block height of the transaction
-> Int
-- ^ The index of the transaction in the block
-> IO (TransactionProof SHA512t_256)

@mercadoa mercadoa added this to the Testnet v1 milestone Apr 12, 2019
@mercadoa
Copy link
Contributor Author

➤ Emily Pillmore commented:

Beginning this task as of tomorrow - syncing with Stuart today about requirements and the current status of SPV infra

@mercadoa
Copy link
Contributor Author

Moved issue over to chainweb-node (108)

@mercadoa mercadoa reopened this Apr 16, 2019
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