Comments (4)
I guess that might look something like:
taproot_message(uint8_t hash_type, uint8_t spend_type, tx, uint32_t input_index) {
uint8_t epoch = 0;
bm = epoch + hash_type + tx.nVersion + tx.nLockTime
if ((hash_type & ANYONECANPAY)== 0) bm += sha_prevouts(tx) + sha_amounts(tx) + sha_sequences(tx);
if ((hash_type & (NONE | SINGLE) == 0) bm += sha_outputs(tx);
bm += spend_type + scriptPubKey(tx, input_index);
if (hash_type & ANYONECANPAY) {
bm += outpoint(tx,input_index) + amount(tx,input_index) + nSequence(tx,input_index);
} else {
bm += input_index;
}
if (spend_type & 1) bm += sha_annex(tx, input_index);
if (hash_type & SINGLE) bm += sha_single_output(tx, input_index);
return bm;
}
tapscript_message(uint8_t hash_type, uint8_t spend_type, tx, uint32_t input_index,
uint8_t key_version, uint32_t codeseparator_position)
{
msg = taproot_message(hash_type, (spend_type | 0x02), tx, input_index);
msg += tapleaf_hash + key_version + codeseparator_position;
return msg;
}
presuming sha_annex
and so on are defined in text. For anyprevout (which drops outpoint(tx,input_index)
rather than just adding stuff on the end) you'd have to redefine the whole block of code that way, but that's still probably easier to follow...
from bips.
I was more thinking about keeping the existing "list of serialized fields" approach, but just separated out.
from bips.
Not quite sure that would look like, but sounds plausible
from bips.
See #186.
from bips.
Related Issues (20)
- bip-schnorr/taproot agree on terminology of points HOT 6
- bip-taproot: Add security argument HOT 5
- bip-taproot: Internal pubkey construction seems to be inconsistent. HOT 3
- bip-taproot: Motivation section doesn't address motivation clearly HOT 2
- Diagram under "Constructing and spending Taproot outputs" doesn't show HOT 2
- bip-taproot/tapscript: Prevention length-extension attacks in public key tweaking HOT 6
- bip-schnorr: Euler's criterion
- bip-schnorr: Inaccurate proof of quadratic residuosity HOT 2
- Syntactical issue in taproot footnote 16 HOT 2
- bip-taproot: Publick key tweak resulting in point-at-infinity HOT 5
- bip-schnorr: Add k values to test-vectors HOT 8
- Avoiding the EC multiplication during signing by using precomputed pubkey data HOT 15
- Squareness vs oddness tie-breaker for public keys HOT 8
- Discussion on power analysis attacks HOT 47
- bip-schnorr: nonce uses hash instead of PRF HOT 2
- Synthetic randomness for batch verification HOT 2
- Clarify relationship between synthetic nonces and anti-covert-channel HOT 1
- BIP340: clarify impact of pre-hashed messages, or support variable-length messages HOT 71
- bip340: Cite malleability issues with other schemes
- bip-340: Reduce size of batch verification randomizers to 128 bits HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bips.