Skip to content

Various fixes for deadcat example - #4

Draft
stringhandler wants to merge 9 commits into
mainfrom
utxo-type-params
Draft

Various fixes for deadcat example#4
stringhandler wants to merge 9 commits into
mainfrom
utxo-type-params

Conversation

@stringhandler

Copy link
Copy Markdown
Owner

No description provided.

A utxo_type resolved its compile params and leaf refs against whatever was ambient at
each mention, so one type could derive two different addresses in two actions with no
error — an address is a hash, and a wrong one looks like a right one. Declaring
`params` now closes the scope: a site binds them with `args`, defaults may read
instance scope only, and validate proves every site binds what it must.

Also types two fields that were bare JSON (`destination`, taproot leaf payload items),
so the schema links them and malformed ones fail at load instead of silently skipping
an output; fixes a declared change output being dropped for having no amount_sat; adds
a backstop that no declared input can vanish from the PSET; and resolves covenant input
assets by label like every other path.
An address and its script hash are two views of one destination: the covenant commits
to the hash, the transaction pays to the address, and if they disagree the spend fails
on-chain. A manifest could only state them separately. `compute: {type: script_hash}`
now derives one from the other.

Three fixes found by using it. A pinned outpoint's amount and asset are read from the
chain rather than defaulted to 0 or retyped by hand — that value is what the sighash
commits to. `confidential: false` now beats an address's own blinding key, which a
covenant reading the output amount requires and which was honoured for wallet
destinations only. And a witness may be written as bare hex, which every hash this
crate produces is, without being reinterpreted when it is also valid decimal.
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

Successfully merging this pull request may close these issues.

1 participant