-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fee5e1b
commit 81b2173
Showing
22 changed files
with
1,083 additions
and
761 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
namespace bytecode(256); | ||
|
||
// Raw bytes | ||
pol commit bytes; | ||
pol commit bytes_pc; | ||
|
||
// Decomposed into 35 byte chunks to parse into instructions | ||
pol commit decomposed; | ||
|
||
// =============== BYTECODE HASHING + ADDRESS DERIVATION ================================================= | ||
// Bytes packed into 31 byte chunks | ||
pol commit packed; | ||
pol commit length_remaining; | ||
|
||
// Bytecode public commitment hash | ||
pol commit running_hash; | ||
|
||
// When this is 1, it represents when reached the end of a contract bytecode | ||
pol commit end_latch; | ||
end_latch * (1 - end_latch) = 0; | ||
|
||
// TODO: Come back to this; | ||
// pol commit class_id; | ||
// pol commit contract_address; | ||
/* Derive Class Id */ | ||
pol CONTRACT_LEAF = 16; | ||
pol commit arifact_hash; | ||
pol commit private_fn_root; | ||
// class_id = H(CONTRACT_LEAF, artifact_hash, private_fn_root, running_hash) | ||
pol commit class_id; | ||
|
||
/* Derive Contract Addr*/ | ||
pol CONTRACT_ADDRESS_V1 = 15; | ||
pol PARTIAL_ADDRESS = 27; | ||
// pol SALTED_INIT_HASH = H(PARTIAL_ADDR, salt, init_hash, deployer_addr); | ||
// pol PARTIAL_ADDR = H(PARTIAL_ADDR, class_id, SALTED_INIT_HASH); | ||
pol commit salt; | ||
pol commit initialization_hash; | ||
pol commit deployer_addr; | ||
pol commit public_key_hash; | ||
// contract_address = H(CONTRACT_ADDRESS_V1, public_key_hash, partial_address) | ||
pol commit contract_address; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.